Chromium Code Reviews| Index: chrome/browser/signin/oauth2_token_service.h |
| diff --git a/chrome/browser/signin/oauth2_token_service.h b/chrome/browser/signin/oauth2_token_service.h |
| index ac993de001916063142bee3387969c2109114ab1..e7094ccec3906da9b6fb9f46f27d4c17f50324de 100644 |
| --- a/chrome/browser/signin/oauth2_token_service.h |
| +++ b/chrome/browser/signin/oauth2_token_service.h |
| @@ -77,8 +77,6 @@ class OAuth2TokenService : public base::NonThreadSafe { |
| // Classes that want to listen for token availability should implement this |
| // interface and register with the AddObserver() call. |
| - // TODO(rogerta): may get rid of |error| argument for OnRefreshTokenRevoked() |
| - // once we stop supporting ClientLogin. Need to evaluate if its still useful. |
| class Observer { |
| public: |
| // Called whenever a new login-scoped refresh token is available for |
| @@ -92,8 +90,6 @@ class OAuth2TokenService : public base::NonThreadSafe { |
| // Called after all refresh tokens are loaded during OAuth2TokenService |
| // startup. |
| virtual void OnRefreshTokensLoaded() {} |
| - // Called after all refresh tokens are removed from OAuth2TokenService. |
| - virtual void OnRefreshTokensCleared() {} |
| protected: |
| virtual ~Observer() {} |
| }; |
| @@ -116,13 +112,15 @@ class OAuth2TokenService : public base::NonThreadSafe { |
| // is not deleted. |
| // TODO(atwilson): Make this non-virtual when we change |
| // ProfileOAuth2TokenServiceRequestTest to use FakeProfileOAuth2TokenService. |
| - virtual scoped_ptr<Request> StartRequest(const ScopeSet& scopes, |
| + virtual scoped_ptr<Request> StartRequest(const std::string& account_id, |
| + const ScopeSet& scopes, |
| Consumer* consumer); |
| // This method does the same as |StartRequest| except it uses |client_id| and |
| // |client_secret| to identify OAuth client app instead of using |
| // Chrome's default values. |
| - scoped_ptr<Request> StartRequestForClient( |
| + virtual scoped_ptr<Request> StartRequestForClient( |
| + const std::string& account_id, |
| const std::string& client_id, |
| const std::string& client_secret, |
| const ScopeSet& scopes, |
| @@ -131,14 +129,15 @@ class OAuth2TokenService : public base::NonThreadSafe { |
| // This method does the same as |StartRequest| except it uses the request |
| // context given by |getter| instead of using the one returned by |
| // |GetRequestContext| implemented by derived classes. |
| - scoped_ptr<Request> StartRequestWithContext( |
| + virtual scoped_ptr<Request> StartRequestWithContext( |
| + const std::string& account_id, |
| net::URLRequestContextGetter* getter, |
| const ScopeSet& scopes, |
| Consumer* consumer); |
|
Roger Tawa OOO till Jul 10th
2013/08/26 21:04:53
Do the three StartRequest() methods need to be vir
|
| // Returns true if a refresh token exists. If false, calls to |
| // |StartRequest| will result in a Consumer::OnGetTokenFailure callback. |
| - virtual bool RefreshTokenIsAvailable(); |
| + virtual bool RefreshTokenIsAvailable(const std::string& account_id); |
| // Mark an OAuth2 access token as invalid. This should be done if the token |
| // was received from this class, but was not accepted by the server (e.g., |
| @@ -174,10 +173,12 @@ class OAuth2TokenService : public base::NonThreadSafe { |
| // Subclasses should return the refresh token maintained. |
| // If no token is available, return an empty string. |
| - virtual std::string GetRefreshToken() = 0; |
| + virtual std::string GetRefreshToken(const std::string& account_id) = 0; |
| // Subclasses can override if they want to report errors to the user. |
| - virtual void UpdateAuthError(const GoogleServiceAuthError& error); |
| + virtual void UpdateAuthError( |
| + const std::string& account_id, |
| + const GoogleServiceAuthError& error); |
| // Add a new entry to the cache. |
| // Subclasses can override if there are implementation-specific reasons |
| @@ -210,7 +211,6 @@ class OAuth2TokenService : public base::NonThreadSafe { |
| void FireRefreshTokenAvailable(const std::string& account_id); |
| void FireRefreshTokenRevoked(const std::string& account_id); |
| void FireRefreshTokensLoaded(); |
| - void FireRefreshTokensCleared(); |
| // Derived classes must provide a request context used for fetching access |
| // tokens with the |StartRequest| method. |
| @@ -219,6 +219,7 @@ class OAuth2TokenService : public base::NonThreadSafe { |
| // Fetches an OAuth token for the specified client/scopes. Virtual so it can |
| // be overridden for tests and for platform-specific behavior on Android. |
| virtual void FetchOAuth2Token(RequestImpl* request, |
| + const std::string& account_id, |
| net::URLRequestContextGetter* getter, |
| const std::string& client_id, |
| const std::string& client_secret, |
| @@ -240,6 +241,7 @@ class OAuth2TokenService : public base::NonThreadSafe { |
| // uses |client_id| and |client_secret| to identify OAuth |
| // client app instead of using Chrome's default values. |
| scoped_ptr<Request> StartRequestForClientWithContext( |
| + const std::string& account_id, |
| net::URLRequestContextGetter* getter, |
| const std::string& client_id, |
| const std::string& client_secret, |