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

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: Rebasing to include the update to ProfileSyncService: r224220 Created 7 years, 3 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..6c4437797c9e9b8aa10f7d1721cdd0c64104b8d1 100644
--- a/chrome/browser/signin/android_profile_oauth2_token_service.h
+++ b/chrome/browser/signin/android_profile_oauth2_token_service.h
@@ -28,22 +28,16 @@ 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() OVERRIDE;
- virtual void InvalidateToken(const ScopeSet& scopes,
- const std::string& invalid_token) OVERRIDE;
+ virtual bool RefreshTokenIsAvailable(
+ const std::string& account_id) OVERRIDE;
// Registers the AndroidProfileOAuth2TokenService's native methods through
// 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,17 +46,18 @@ 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);
+ // Overridden from OAuth2TokenService to intercept token fetch requests and
+ // redirect them to the Account Manager.
+ virtual void InvalidateOAuth2Token(const std::string& account_id,
+ const std::string& client_id,
+ const ScopeSet& scopes,
+ const std::string& access_token) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(AndroidProfileOAuth2TokenService);
« no previous file with comments | « chrome/browser/profiles/profile_downloader.cc ('k') | chrome/browser/signin/android_profile_oauth2_token_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698