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

Unified Diff: chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h

Issue 1109133004: Cleanup PolicyOAuth2TokenFetcher method signatures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@policy
Patch Set: Add safety DCHECKs Created 5 years, 8 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/chromeos/policy/policy_oauth2_token_fetcher.h
diff --git a/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h b/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h
index 61829485df3b372d20621ae1252c721886814204..5aaa64c2a84867743700b8514dfe5c5efd83cc22 100644
--- a/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h
+++ b/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h
@@ -38,24 +38,22 @@ class PolicyOAuth2TokenFetcher
typedef base::Callback<void(const std::string&,
const GoogleServiceAuthError&)> TokenCallback;
- // Fetches the device management service's oauth2 token, after also retrieving
- // the OAuth2 refresh tokens.
- PolicyOAuth2TokenFetcher(net::URLRequestContextGetter* auth_context_getter,
- net::URLRequestContextGetter* system_context_getter,
- const TokenCallback& callback);
-
- PolicyOAuth2TokenFetcher(const std::string& auth_code,
- net::URLRequestContextGetter* system_context_getter,
- const TokenCallback& callback);
-
+ PolicyOAuth2TokenFetcher();
~PolicyOAuth2TokenFetcher() override;
- // Starts process of minting device management service OAuth2 access token.
- void Start();
-
- // Starts minting device management service OAuth2 access token with the given
- // |oauth2_refresh_token|.
- void StartWithRefreshToken(const std::string& oauth2_refresh_token);
+ // Fetches the device management service's oauth2 token. This may be fetched
+ // via signin context, auth code, or oauth2 refresh token.
+ void StartWithSigninContext(
+ net::URLRequestContextGetter* auth_context_getter,
+ net::URLRequestContextGetter* system_context_getter,
+ const TokenCallback& callback);
+ void StartWithAuthCode(const std::string& auth_code,
+ net::URLRequestContextGetter* system_context_getter,
+ const TokenCallback& callback);
+ void StartWithRefreshToken(
+ const std::string& oauth2_refresh_token,
+ net::URLRequestContextGetter* system_context_getter,
+ const TokenCallback& callback);
// Returns true if we have previously attempted to fetch tokens with this
// class and failed.
@@ -99,7 +97,7 @@ class PolicyOAuth2TokenFetcher
const GoogleServiceAuthError& error);
// Auth code which is used to retreive a refresh token.
- const std::string auth_code_;
+ std::string auth_code_;
scoped_refptr<net::URLRequestContextGetter> auth_context_getter_;
scoped_refptr<net::URLRequestContextGetter> system_context_getter_;

Powered by Google App Engine
This is Rietveld 408576698