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

Unified Diff: chrome/browser/signin/android_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/android_profile_oauth2_token_service.h
diff --git a/chrome/browser/signin/android_profile_oauth2_token_service.h b/chrome/browser/signin/android_profile_oauth2_token_service.h
index 00575408905fea144237fe67427c1abc463d4566..67e94ea80ee53260143407e6f5b0381848ba4f74 100644
--- a/chrome/browser/signin/android_profile_oauth2_token_service.h
+++ b/chrome/browser/signin/android_profile_oauth2_token_service.h
@@ -28,15 +28,9 @@ class TokenService;
// request from other thread, please use ProfileOAuth2TokenServiceRequest.
class AndroidProfileOAuth2TokenService : public ProfileOAuth2TokenService {
public:
- // StartRequest() fetches a token for the currently signed-in account; this
- // version uses the account corresponding to |username|. This allows fetching
- // tokens before a user is signed-in (e.g. during the sign-in flow).
- scoped_ptr<OAuth2TokenService::Request> StartRequestForUsername(
- const std::string& username,
- const OAuth2TokenService::ScopeSet& scopes,
- OAuth2TokenService::Consumer* consumer);
+ virtual bool RefreshTokenIsAvailable(
+ const std::string& account_id) OVERRIDE;
- virtual bool RefreshTokenIsAvailable() OVERRIDE;
virtual void InvalidateToken(const ScopeSet& scopes,
const std::string& invalid_token) OVERRIDE;
@@ -44,6 +38,9 @@ class AndroidProfileOAuth2TokenService : public ProfileOAuth2TokenService {
// JNI.
static bool Register(JNIEnv* env);
+ // Lists account IDs of all accounts with a refresh token.
+ virtual std::vector<std::string> GetAccounts() OVERRIDE;
+
protected:
friend class ProfileOAuth2TokenServiceFactory;
AndroidProfileOAuth2TokenService();
@@ -52,18 +49,12 @@ class AndroidProfileOAuth2TokenService : public ProfileOAuth2TokenService {
// Overridden from OAuth2TokenService to intercept token fetch requests and
// redirect them to the Account Manager.
virtual void FetchOAuth2Token(RequestImpl* request,
+ const std::string& account_id,
net::URLRequestContextGetter* getter,
const std::string& client_id,
const std::string& client_secret,
const ScopeSet& scopes) OVERRIDE;
- // Low-level helper function used by both FetchOAuth2Token and
- // StartRequestForUsername to fetch tokens. virtual to enable mocks.
- virtual void FetchOAuth2TokenWithUsername(
- RequestImpl* request,
- const std::string& username,
- const ScopeSet& scope);
-
private:
DISALLOW_COPY_AND_ASSIGN(AndroidProfileOAuth2TokenService);
};

Powered by Google App Engine
This is Rietveld 408576698