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

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

Issue 23382008: Making OAuth2TokenService multi-login aware, updating callers, minor fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates to AndroidPO2TS and removing the DCHECK(signin_manager) from GetPrimaryAccountId Created 7 years, 4 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/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 baef750073bc0171cdf4c8808932358a8e591fe7..8b26a1b802523a94e78cb4f3c14f28ad0523d93c 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service.cc
+++ b/chrome/browser/policy/cloud/user_policy_signin_service.cc
@@ -39,7 +39,8 @@ UserPolicySigninService::UserPolicySigninService(
// ProfileOAuth2TokenService should not yet have loaded its tokens since this
// happens in the background after PKS initialization - so this service
// should always be created before the oauth token is available.
- DCHECK(!oauth2_token_service_->RefreshTokenIsAvailable());
+ DCHECK(!oauth2_token_service_->RefreshTokenIsAvailable(
+ oauth2_token_service_->GetPrimaryAccountId()));
// Listen for an OAuth token to become available so we can register a client
// if for some reason the client is not already registered (for example, if
@@ -145,7 +146,8 @@ void UserPolicySigninService::OnInitializationCompleted(
DVLOG_IF(1, manager->IsClientRegistered())
<< "Client already registered - not fetching DMToken";
if (!manager->IsClientRegistered()) {
- if (!oauth2_token_service_->RefreshTokenIsAvailable()) {
+ if (!oauth2_token_service_->RefreshTokenIsAvailable(
+ oauth2_token_service_->GetPrimaryAccountId())) {
// No token yet - this class listens for OnRefreshTokenAvailable()
// and will re-attempt registration once the token is available.
DLOG(WARNING) << "No OAuth Refresh Token - delaying policy download";

Powered by Google App Engine
This is Rietveld 408576698