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

Unified Diff: chrome/browser/chromeos/login/oauth2_login_manager.cc

Issue 12039044: Don't overwrite the refresh_token fetched by the policy_oauth_fetcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated comments Created 7 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/oauth2_login_manager.cc
diff --git a/chrome/browser/chromeos/login/oauth2_login_manager.cc b/chrome/browser/chromeos/login/oauth2_login_manager.cc
index 314708c3c5e70b6866850d7a8bd6299e29d356dd..5722ab1730977fe95289fb1a70c654709daf57ab 100644
--- a/chrome/browser/chromeos/login/oauth2_login_manager.cc
+++ b/chrome/browser/chromeos/login/oauth2_login_manager.cc
@@ -149,9 +149,12 @@ void OAuth2LoginManager::Observe(
TokenServiceFactory::GetForProfile(user_profile_);
switch (type) {
case chrome::NOTIFICATION_TOKEN_LOADING_FINISHED: {
- refresh_token_ = token_service->GetOAuth2LoginRefreshToken();
- // TODO(zelidrag): Figure out why just getting GaiaConstants::kGaiaService
- // token does not do the trick here.
+ // Don't overwrite the |refresh_token_| if it has already been fetched
+ // by the |oauth2_policy_fetcher_|.
+ if (restore_from_auth_cookies_ &&
+ !token_service->GetOAuth2LoginRefreshToken().empty()) {
+ refresh_token_ = token_service->GetOAuth2LoginRefreshToken();
+ }
RestoreSessionCookies();
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698