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

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

Issue 1108983002: Fetch policy with refresh token. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix user_cloud_policy_manager_chromeos_unittest 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.cc
diff --git a/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc b/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc
index f4191e7798dc5973403bc6e18a1bd7aa2aa2a72e..ba802715ca00e0e65f785ae4101fd1967e647a8a 100644
--- a/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc
+++ b/chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc
@@ -37,8 +37,6 @@ PolicyOAuth2TokenFetcher::PolicyOAuth2TokenFetcher(
const TokenCallback& callback)
: auth_context_getter_(auth_context_getter),
system_context_getter_(system_context_getter),
- retry_count_(0),
- failed_(false),
callback_(callback) {}
PolicyOAuth2TokenFetcher::PolicyOAuth2TokenFetcher(
@@ -47,8 +45,6 @@ PolicyOAuth2TokenFetcher::PolicyOAuth2TokenFetcher(
const TokenCallback& callback)
: auth_code_(auth_code),
system_context_getter_(system_context_getter),
- retry_count_(0),
- failed_(false),
callback_(callback) {
}
@@ -59,6 +55,13 @@ void PolicyOAuth2TokenFetcher::Start() {
StartFetchingRefreshToken();
}
+void PolicyOAuth2TokenFetcher::StartWithRefreshToken(
+ const std::string& oauth2_refresh_token) {
+ retry_count_ = 0;
+ oauth2_refresh_token_ = oauth2_refresh_token;
+ StartFetchingAccessToken();
+}
+
void PolicyOAuth2TokenFetcher::StartFetchingRefreshToken() {
if (auth_code_.empty()) {
refresh_token_fetcher_.reset(new GaiaAuthFetcher(

Powered by Google App Engine
This is Rietveld 408576698