Chromium Code Reviews| Index: chrome/browser/net/gaia/token_service.h |
| =================================================================== |
| --- chrome/browser/net/gaia/token_service.h (revision 111499) |
| +++ chrome/browser/net/gaia/token_service.h (working copy) |
| @@ -51,6 +51,7 @@ |
| #include "content/public/browser/notification_registrar.h" |
| class Profile; |
| +class TokenServiceTest; |
| namespace net { |
| class URLRequestContextGetter; |
| @@ -154,6 +155,9 @@ |
| void StartFetchingOAuthTokens(); |
| virtual bool HasTokenForService(const char* service) const; |
| const std::string& GetTokenForService(const char* const service) const; |
| + virtual bool HasOAuthLoginToken() const; |
|
Rick Campbell
2011/11/28 22:51:07
I think that these should not be singled out for s
Munjal (Google)
2011/11/28 23:41:14
These methods are more like OAuth1 methods and les
|
| + const std::string& GetOAuth2LoginRefreshToken() const; |
| + const std::string& GetOAuth2LoginAccessToken() const; |
| // For tests only. Doesn't save to the WebDB. |
| void IssueAuthTokenForTest(const std::string& service, |
| @@ -165,6 +169,11 @@ |
| virtual void OnIssueAuthTokenFailure( |
| const std::string& service, |
| const GoogleServiceAuthError& error) OVERRIDE; |
| + virtual void OnOAuthLoginTokenSuccess(const std::string& refresh_token, |
| + const std::string& access_token, |
| + int expires_in_secs) OVERRIDE; |
| + virtual void OnOAuthLoginTokenFailure(const GoogleServiceAuthError& error) |
| + OVERRIDE; |
| // GaiaOAuthConsumer implementation. |
| virtual void OnOAuthGetAccessTokenSuccess(const std::string& token, |
| @@ -197,12 +206,20 @@ |
| void FireTokenRequestFailedNotification(const std::string& service, |
| const GoogleServiceAuthError& error); |
| - void LoadTokensIntoMemory(const std::map<std::string, std::string>& in_toks, |
| - std::map<std::string, std::string>* out_toks); |
| + void LoadTokensIntoMemory( |
| + const std::map<std::string, std::string>& db_tokens, |
| + std::map<std::string, std::string>* in_memory_tokens); |
| + void LoadSingleTokenIntoMemory( |
| + const std::map<std::string, std::string>& db_tokens, |
| + std::map<std::string, std::string>* in_memory_tokens, |
| + const std::string& service); |
| void SaveAuthTokenToDB(const std::string& service, |
| const std::string& auth_token); |
| + // Returns the index of the given service. |
| + static int GetServiceIndex(const std::string& service); |
| + |
| // The profile with which this instance was initialized, or NULL. |
| Profile* profile_; |
| @@ -252,6 +269,7 @@ |
| content::NotificationRegistrar registrar_; |
| + friend class TokenServiceTest; |
| FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryBasic); |
| FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryAdvanced); |
| FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, FullIntegrationNewServicesAdded); |