Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / extensions / api / identity / identity_api.h
index 3a062b4..489029c 100644 (file)
@@ -93,7 +93,7 @@ class IdentityAPI : public BrowserContextKeyedAPI,
   };
 
   explicit IdentityAPI(content::BrowserContext* context);
-  virtual ~IdentityAPI();
+  ~IdentityAPI() override;
 
   // Request serialization queue for getAuthToken.
   IdentityMintRequestQueue* mint_queue();
@@ -113,14 +113,14 @@ class IdentityAPI : public BrowserContextKeyedAPI,
   std::string FindAccountKeyByGaiaId(const std::string& gaia_id);
 
   // BrowserContextKeyedAPI implementation.
-  virtual void Shutdown() OVERRIDE;
+  void Shutdown() override;
   static BrowserContextKeyedAPIFactory<IdentityAPI>* GetFactoryInstance();
 
   // gaia::AccountTracker::Observer implementation:
-  virtual void OnAccountAdded(const gaia::AccountIds& ids) OVERRIDE;
-  virtual void OnAccountRemoved(const gaia::AccountIds& ids) OVERRIDE;
-  virtual void OnAccountSignInChanged(const gaia::AccountIds& ids,
-                                      bool is_signed_in) OVERRIDE;
+  void OnAccountAdded(const gaia::AccountIds& ids) override;
+  void OnAccountRemoved(const gaia::AccountIds& ids) override;
+  void OnAccountSignInChanged(const gaia::AccountIds& ids,
+                              bool is_signed_in) override;
 
   void AddShutdownObserver(ShutdownObserver* observer);
   void RemoveShutdownObserver(ShutdownObserver* observer);
@@ -153,10 +153,10 @@ class IdentityGetAccountsFunction : public ChromeUIThreadExtensionFunction {
   IdentityGetAccountsFunction();
 
  private:
-  virtual ~IdentityGetAccountsFunction();
+  ~IdentityGetAccountsFunction() override;
 
   // UIThreadExtensionFunction implementation.
-  virtual ExtensionFunction::ResponseAction Run() OVERRIDE;
+  ExtensionFunction::ResponseAction Run() override;
 };
 
 // identity.getAuthToken fetches an OAuth 2 function for the
@@ -194,28 +194,36 @@ class IdentityGetAuthTokenFunction : public ChromeAsyncExtensionFunction,
   }
 
  protected:
-  virtual ~IdentityGetAuthTokenFunction();
+  ~IdentityGetAuthTokenFunction() override;
 
   // IdentitySigninFlow::Delegate implementation:
-  virtual void SigninSuccess() OVERRIDE;
-  virtual void SigninFailed() OVERRIDE;
+  void SigninSuccess() override;
+  void SigninFailed() override;
 
   // GaiaWebAuthFlow::Delegate implementation:
-  virtual void OnGaiaFlowFailure(GaiaWebAuthFlow::Failure failure,
-                                 GoogleServiceAuthError service_error,
-                                 const std::string& oauth_error) OVERRIDE;
-  virtual void OnGaiaFlowCompleted(const std::string& access_token,
-                                   const std::string& expiration) OVERRIDE;
+  void OnGaiaFlowFailure(GaiaWebAuthFlow::Failure failure,
+                         GoogleServiceAuthError service_error,
+                         const std::string& oauth_error) override;
+  void OnGaiaFlowCompleted(const std::string& access_token,
+                           const std::string& expiration) override;
 
   // Starts a login access token request.
   virtual void StartLoginAccessTokenRequest();
 
   // OAuth2TokenService::Consumer implementation:
-  virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
-                                 const std::string& access_token,
-                                 const base::Time& expiration_time) OVERRIDE;
-  virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request,
-                                 const GoogleServiceAuthError& error) OVERRIDE;
+  void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
+                         const std::string& access_token,
+                         const base::Time& expiration_time) override;
+  void OnGetTokenFailure(const OAuth2TokenService::Request* request,
+                         const GoogleServiceAuthError& error) override;
+
+  // Starts a mint token request to GAIA.
+  // Exposed for testing.
+  virtual void StartGaiaRequest(const std::string& login_access_token);
+
+  // Caller owns the returned instance.
+  // Exposed for testing.
+  virtual OAuth2MintTokenFlow* CreateMintTokenFlow();
 
   scoped_ptr<OAuth2TokenService::Request> login_token_request_;
 
@@ -228,7 +236,7 @@ class IdentityGetAuthTokenFunction : public ChromeAsyncExtensionFunction,
   FRIEND_TEST_ALL_PREFIXES(GetAuthTokenFunctionTest, NoninteractiveShutdown);
 
   // ExtensionFunction:
-  virtual bool RunAsync() OVERRIDE;
+  bool RunAsync() override;
 
   // Helpers to report async function results to the caller.
   void StartAsyncRun();
@@ -242,18 +250,16 @@ class IdentityGetAuthTokenFunction : public ChromeAsyncExtensionFunction,
   void CompleteMintTokenFlow();
 
   // IdentityMintRequestQueue::Request implementation:
-  virtual void StartMintToken(IdentityMintRequestQueue::MintType type) OVERRIDE;
+  void StartMintToken(IdentityMintRequestQueue::MintType type) override;
 
   // OAuth2MintTokenFlow::Delegate implementation:
-  virtual void OnMintTokenSuccess(const std::string& access_token,
-                                  int time_to_live) OVERRIDE;
-  virtual void OnMintTokenFailure(
-      const GoogleServiceAuthError& error) OVERRIDE;
-  virtual void OnIssueAdviceSuccess(
-      const IssueAdviceInfo& issue_advice) OVERRIDE;
+  void OnMintTokenSuccess(const std::string& access_token,
+                          int time_to_live) override;
+  void OnMintTokenFailure(const GoogleServiceAuthError& error) override;
+  void OnIssueAdviceSuccess(const IssueAdviceInfo& issue_advice) override;
 
   // IdentityAPI::ShutdownObserver implementation:
-  virtual void OnShutdown() OVERRIDE;
+  void OnShutdown() override;
 
 #if defined(OS_CHROMEOS)
   // Starts a login access token request for device robot account. This method
@@ -261,15 +267,9 @@ class IdentityGetAuthTokenFunction : public ChromeAsyncExtensionFunction,
   virtual void StartDeviceLoginAccessTokenRequest();
 #endif
 
-  // Starts a mint token request to GAIA.
-  void StartGaiaRequest(const std::string& login_access_token);
-
   // Methods for invoking UI. Overridable for testing.
   virtual void ShowLoginPopup();
   virtual void ShowOAuthApprovalDialog(const IssueAdviceInfo& issue_advice);
-  // Caller owns the returned instance.
-  virtual OAuth2MintTokenFlow* CreateMintTokenFlow(
-      const std::string& login_access_token);
 
   // Checks if there is a master login token to mint tokens for the extension.
   bool HasLoginToken() const;
@@ -304,10 +304,10 @@ class IdentityGetProfileUserInfoFunction
   IdentityGetProfileUserInfoFunction();
 
  private:
-  virtual ~IdentityGetProfileUserInfoFunction();
+  ~IdentityGetProfileUserInfoFunction() override;
 
   // UIThreadExtensionFunction implementation.
-  virtual ExtensionFunction::ResponseAction Run() OVERRIDE;
+  ExtensionFunction::ResponseAction Run() override;
 };
 
 class IdentityRemoveCachedAuthTokenFunction
@@ -318,10 +318,10 @@ class IdentityRemoveCachedAuthTokenFunction
   IdentityRemoveCachedAuthTokenFunction();
 
  protected:
-  virtual ~IdentityRemoveCachedAuthTokenFunction();
+  ~IdentityRemoveCachedAuthTokenFunction() override;
 
   // SyncExtensionFunction implementation:
-  virtual bool RunSync() OVERRIDE;
+  bool RunSync() override;
 };
 
 class IdentityLaunchWebAuthFlowFunction : public ChromeAsyncExtensionFunction,
@@ -336,13 +336,13 @@ class IdentityLaunchWebAuthFlowFunction : public ChromeAsyncExtensionFunction,
   void InitFinalRedirectURLPrefixForTest(const std::string& extension_id);
 
  private:
-  virtual ~IdentityLaunchWebAuthFlowFunction();
-  virtual bool RunAsync() OVERRIDE;
+  ~IdentityLaunchWebAuthFlowFunction() override;
+  bool RunAsync() override;
 
   // WebAuthFlow::Delegate implementation.
-  virtual void OnAuthFlowFailure(WebAuthFlow::Failure failure) OVERRIDE;
-  virtual void OnAuthFlowURLChange(const GURL& redirect_url) OVERRIDE;
-  virtual void OnAuthFlowTitleChange(const std::string& title) OVERRIDE {}
+  void OnAuthFlowFailure(WebAuthFlow::Failure failure) override;
+  void OnAuthFlowURLChange(const GURL& redirect_url) override;
+  void OnAuthFlowTitleChange(const std::string& title) override {}
 
   // Helper to initialize final URL prefix.
   void InitFinalRedirectURLPrefix(const std::string& extension_id);