Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6699)

Unified Diff: chrome/browser/net/gaia/token_service.h

Issue 8680019: Integrate OAuth2 login token generation into TokenService: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/net/gaia/token_service.cc » ('j') | chrome/browser/net/gaia/token_service.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | chrome/browser/net/gaia/token_service.cc » ('j') | chrome/browser/net/gaia/token_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698