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

Unified Diff: chrome/browser/signin/profile_oauth2_token_service.h

Issue 23382008: Making OAuth2TokenService multi-login aware, updating callers, minor fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates to AndroidPO2TS and removing the DCHECK(signin_manager) from GetPrimaryAccountId Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/signin/profile_oauth2_token_service.h
diff --git a/chrome/browser/signin/profile_oauth2_token_service.h b/chrome/browser/signin/profile_oauth2_token_service.h
index 79a5329c24a3ca5fb2b7226d33050598fe1aa5a2..a1d9627233003659cb67656c83fb9aa2b9d56d7e 100644
--- a/chrome/browser/signin/profile_oauth2_token_service.h
+++ b/chrome/browser/signin/profile_oauth2_token_service.h
@@ -59,8 +59,13 @@ class ProfileOAuth2TokenService : public OAuth2TokenService,
virtual GoogleServiceAuthError GetAuthStatus() const OVERRIDE;
// Takes injected TokenService for testing.
- bool ShouldCacheForRefreshToken(TokenService *token_service,
- const std::string& refresh_token);
+ bool ShouldCacheForRefreshToken(const std::string& refresh_token);
+
+ // Gets an account id of the primary account related to the profile.
+ std::string GetPrimaryAccountId();
Andrew T Wilson (Slow) 2013/09/03 14:04:24 Roger seemed to think maybe this should live elsew
Roger Tawa OOO till Jul 10th 2013/09/03 21:06:42 As a public api, seems like its better if it live
fgorski 2013/09/03 23:29:25 OK, I'll make a change tomorrow and retest everyth
+
+ // Lists account IDs of all accounts with a refresh token.
+ virtual std::vector<std::string> GetAccounts() OVERRIDE;
// Updates a |refresh_token| for an |account_id|. Credentials are persisted,
// and avialable through |LoadCredentials| after service is restarted.
@@ -89,14 +94,16 @@ class ProfileOAuth2TokenService : public OAuth2TokenService,
virtual ~ProfileOAuth2TokenService();
// OAuth2TokenService overrides.
- virtual std::string GetRefreshToken() OVERRIDE;
+ virtual std::string GetRefreshToken(const std::string& account_id) OVERRIDE;
// OAuth2TokenService implementation.
virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
// Updates the internal cache of the result from the most-recently-completed
// auth request (used for reporting errors to the user).
- virtual void UpdateAuthError(const GoogleServiceAuthError& error) OVERRIDE;
+ virtual void UpdateAuthError(
+ const std::string& account_id,
+ const GoogleServiceAuthError& error) OVERRIDE;
// Overridden to not cache tokens if the TokenService refresh token
// changes while a token fetch is in-flight. If the user logs out and

Powered by Google App Engine
This is Rietveld 408576698