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

Unified Diff: chrome/browser/policy/cloud/user_policy_signin_service.cc

Issue 33173005: Correctly deal with tokens for supervised users in ProfileOAuth2TokenService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 1 month 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/policy/cloud/user_policy_signin_service.cc
diff --git a/chrome/browser/policy/cloud/user_policy_signin_service.cc b/chrome/browser/policy/cloud/user_policy_signin_service.cc
index c69826c74699306c2ba9424f9512d4c011ddd871..0ca237fbf24577999d189f07015ab0a73fea4e14 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service.cc
+++ b/chrome/browser/policy/cloud/user_policy_signin_service.cc
@@ -111,12 +111,13 @@ void UserPolicySigninService::OnRefreshTokenAvailable(
return;
}
- std::string username = GetSigninManager()->GetAuthenticatedUsername();
- // Should not have OAuth tokens if the user isn't signed in.
- DCHECK(!username.empty());
+ // Ignore OAuth tokens for any account but the primary one.
+ if (account_id != oauth2_token_service_->GetPrimaryAccountId())
+ return;
+
// ProfileOAuth2TokenService now has a refresh token so initialize the
// UserCloudPolicyManager.
- InitializeForSignedInUser(username);
+ InitializeForSignedInUser(GetSigninManager()->GetAuthenticatedUsername());
}
void UserPolicySigninService::InitializeUserCloudPolicyManager(

Powered by Google App Engine
This is Rietveld 408576698