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

Unified Diff: chrome/browser/signin/fake_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/fake_profile_oauth2_token_service.h
diff --git a/chrome/browser/signin/fake_profile_oauth2_token_service.h b/chrome/browser/signin/fake_profile_oauth2_token_service.h
index 336938e6de2a623c80b4fa43f35c7c0b82f787cd..e8e7dc85e6518d8900c38c5a1757d7528c1d6a55 100644
--- a/chrome/browser/signin/fake_profile_oauth2_token_service.h
+++ b/chrome/browser/signin/fake_profile_oauth2_token_service.h
@@ -52,6 +52,7 @@ class FakeProfileOAuth2TokenService
PendingRequest();
~PendingRequest();
+ std::string account_id;
std::string client_id;
std::string client_secret;
ScopeSet scopes;
@@ -61,6 +62,10 @@ class FakeProfileOAuth2TokenService
FakeProfileOAuth2TokenService();
virtual ~FakeProfileOAuth2TokenService();
+ // Overriden to make sure it works on Android.
+ virtual bool RefreshTokenIsAvailable(
+ const std::string& account_id) OVERRIDE;
+
// Sets the current refresh token. If |token| is non-empty, this will invoke
// OnRefreshTokenAvailable() on all Observers, otherwise this will invoke
// OnRefreshTokenRevoked().
@@ -71,6 +76,7 @@ class FakeProfileOAuth2TokenService
std::vector<PendingRequest> GetPendingRequests();
// Helper routines to issue tokens for pending requests.
+ // TODO(fgorski): Add account IDs as parameters.
void IssueTokenForScope(const ScopeSet& scopes,
const std::string& access_token,
const base::Time& expiration);
@@ -90,12 +96,13 @@ class FakeProfileOAuth2TokenService
protected:
// OAuth2TokenService overrides.
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;
- virtual std::string GetRefreshToken() OVERRIDE;
+ virtual std::string GetRefreshToken(const std::string& account_id) OVERRIDE;
virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698