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

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

Issue 150003004: Replace PO2TS::GetPrimaryAccountId() with SMB::GetAuthenticatedAccountId. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 10 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 4e36757e1a53cecb33e0b9531a3b38df880eb0cc..4277f45e80d5e688a8d504d6c0ccc738928ad266 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service.cc
+++ b/chrome/browser/policy/cloud/user_policy_signin_service.cc
@@ -43,7 +43,7 @@ UserPolicySigninService::UserPolicySigninService(
// 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(
- oauth2_token_service_->GetPrimaryAccountId()));
+ signin_manager->GetAuthenticatedAccountId()));
// 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
@@ -116,7 +116,7 @@ void UserPolicySigninService::OnRefreshTokenAvailable(
}
// Ignore OAuth tokens for any account but the primary one.
- if (account_id != oauth2_token_service_->GetPrimaryAccountId())
+ if (account_id != signin_manager()->GetAuthenticatedAccountId())
return;
// ProfileOAuth2TokenService now has a refresh token so initialize the
@@ -153,7 +153,7 @@ void UserPolicySigninService::OnInitializationCompleted(
<< "Client already registered - not fetching DMToken";
if (!manager->IsClientRegistered()) {
if (!oauth2_token_service_->RefreshTokenIsAvailable(
- oauth2_token_service_->GetPrimaryAccountId())) {
+ signin_manager()->GetAuthenticatedAccountId())) {
// 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";
@@ -180,7 +180,7 @@ void UserPolicySigninService::RegisterCloudPolicyService() {
enterprise_management::DeviceRegisterRequest::BROWSER));
registration_helper_->StartRegistration(
oauth2_token_service_,
- oauth2_token_service_->GetPrimaryAccountId(),
+ signin_manager()->GetAuthenticatedAccountId(),
base::Bind(&UserPolicySigninService::OnRegistrationComplete,
base::Unretained(this)));
}
« no previous file with comments | « chrome/browser/policy/cloud/user_policy_signin_service.h ('k') | chrome/browser/profiles/profile_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698