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

Side by Side Diff: chrome/browser/signin/token_service.h

Issue 10656033: [sync] Automatic bootstrapping of Sync on Win 8 from cached credentials (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit tests Created 8 years, 5 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // The TokenService will supply authentication tokens for any service that 5 // The TokenService will supply authentication tokens for any service that
6 // needs it, such as sync. Whenever the user logs in, a controller watching 6 // needs it, such as sync. Whenever the user logs in, a controller watching
7 // the token service is expected either to call ClientLogin to derive a new 7 // the token service is expected either to call ClientLogin to derive a new
8 // SID and LSID, or to use GAIA OAuth requests to derive an OAuth1 access 8 // SID and LSID, or to use GAIA OAuth requests to derive an OAuth1 access
9 // token for the OAuthLogin scope. Whenever such credentials are available, 9 // token for the OAuthLogin scope. Whenever such credentials are available,
10 // the TokenService should be updated with new credentials. The controller 10 // the TokenService should be updated with new credentials. The controller
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 const std::string& GetTokenForService(const char* const service) const; 145 const std::string& GetTokenForService(const char* const service) const;
146 146
147 // OAuth login token is an all-powerful token that allows creating OAuth2 147 // OAuth login token is an all-powerful token that allows creating OAuth2
148 // tokens for any other scope (i.e. down-scoping). 148 // tokens for any other scope (i.e. down-scoping).
149 // Typical use is to create an OAuth2 token for appropriate scope and then 149 // Typical use is to create an OAuth2 token for appropriate scope and then
150 // use that token to call a Google API. 150 // use that token to call a Google API.
151 virtual bool HasOAuthLoginToken() const; 151 virtual bool HasOAuthLoginToken() const;
152 virtual const std::string& GetOAuth2LoginRefreshToken() const; 152 virtual const std::string& GetOAuth2LoginRefreshToken() const;
153 const std::string& GetOAuth2LoginAccessToken() const; 153 const std::string& GetOAuth2LoginAccessToken() const;
154 154
155 // Called when a sync token is successfully read from the credential cache.
156 // Saves the token to DB and notifies observers.
157 void SaveCachedSyncTokenToDB(const std::string& sync_token);
Andrew T Wilson (Slow) 2012/07/20 01:04:05 I think the intended way for external components t
Raghu Simha 2012/07/20 23:35:22 Agree. This method is no longer required.
158
155 // For tests only. Doesn't save to the WebDB. 159 // For tests only. Doesn't save to the WebDB.
156 void IssueAuthTokenForTest(const std::string& service, 160 void IssueAuthTokenForTest(const std::string& service,
157 const std::string& auth_token); 161 const std::string& auth_token);
158 162
159 // GaiaAuthConsumer implementation. 163 // GaiaAuthConsumer implementation.
160 virtual void OnIssueAuthTokenSuccess(const std::string& service, 164 virtual void OnIssueAuthTokenSuccess(const std::string& service,
161 const std::string& auth_token) OVERRIDE; 165 const std::string& auth_token) OVERRIDE;
162 virtual void OnIssueAuthTokenFailure( 166 virtual void OnIssueAuthTokenFailure(
163 const std::string& service, 167 const std::string& service,
164 const GoogleServiceAuthError& error) OVERRIDE; 168 const GoogleServiceAuthError& error) OVERRIDE;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 237
234 friend class TokenServiceTest; 238 friend class TokenServiceTest;
235 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryBasic); 239 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryBasic);
236 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryAdvanced); 240 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryAdvanced);
237 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, FullIntegrationNewServicesAdded); 241 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, FullIntegrationNewServicesAdded);
238 242
239 DISALLOW_COPY_AND_ASSIGN(TokenService); 243 DISALLOW_COPY_AND_ASSIGN(TokenService);
240 }; 244 };
241 245
242 #endif // CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_H_ 246 #endif // CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/signin/token_service.cc » ('j') | chrome/browser/sync/credential_cache_service_factory_win.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698