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

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

Issue 1143323005: Refactor AO2TS to make it easier to componentize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address roger's comments Created 5 years, 7 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 9a5b97c82318da520cbc7da0473251f5440d3c48..63a5d7f2d840b0b1c9f5fd4233becebc2e70830e 100644
--- a/chrome/browser/signin/fake_profile_oauth2_token_service.h
+++ b/chrome/browser/signin/fake_profile_oauth2_token_service.h
@@ -58,32 +58,6 @@ class FakeProfileOAuth2TokenService
FakeProfileOAuth2TokenService();
~FakeProfileOAuth2TokenService() override;
- // Overriden to make sure it works on Android.
- bool RefreshTokenIsAvailable(const std::string& account_id) const override;
-
- // Overriden to make sure it works on iOS.
- void LoadCredentials(const std::string& primary_account_id) override;
-
- std::vector<std::string> GetAccounts() override;
-
- // Overriden to make sure it works on Android. Simply calls
- // IssueRefreshToken().
- void UpdateCredentials(const std::string& account_id,
- const std::string& refresh_token) override;
-
- // Sets the current refresh token. If |token| is non-empty, this will invoke
- // OnRefreshTokenAvailable() on all Observers, otherwise this will invoke
- // OnRefreshTokenRevoked().
- void IssueRefreshToken(const std::string& token);
-
- // TODO(fgorski,rogerta): Merge with UpdateCredentials when this class fully
- // supports multiple accounts.
- void IssueRefreshTokenForUser(const std::string& account_id,
- const std::string& token);
-
- // Fire OnRefreshTokensLoaded on all observers.
- void IssueAllRefreshTokensLoaded();
-
// Gets a list of active requests (can be used by tests to validate that the
// correct request has been issued).
std::vector<PendingRequest> GetPendingRequests();
@@ -122,17 +96,10 @@ class FakeProfileOAuth2TokenService
const std::string& client_secret,
const ScopeSet& scopes) override;
- OAuth2AccessTokenFetcher* CreateAccessTokenFetcher(
- const std::string& account_id,
- net::URLRequestContextGetter* getter,
- OAuth2AccessTokenConsumer* consumer) override;
-
- void InvalidateOAuth2Token(const std::string& account_id,
- const std::string& client_id,
- const ScopeSet& scopes,
- const std::string& access_token) override;
-
- net::URLRequestContextGetter* GetRequestContext() override;
+ void InvalidateAccessTokenImpl(const std::string& account_id,
+ const std::string& client_id,
+ const ScopeSet& scopes,
+ const std::string& access_token) override;
private:
// Helper function to complete pending requests - if |all_scopes| is true,
@@ -147,13 +114,8 @@ class FakeProfileOAuth2TokenService
const std::string& access_token,
const base::Time& expiration);
- std::string GetRefreshToken(const std::string& account_id) const;
-
std::vector<PendingRequest> pending_requests_;
- // Maps account ids to their refresh token strings.
- std::map<std::string, std::string> refresh_tokens_;
-
// If true, then this fake service will post responses to
// |FetchOAuth2Token| on the current run loop. There is no need to call
// |IssueTokenForScope| in this case.

Powered by Google App Engine
This is Rietveld 408576698