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

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

Issue 1256283002: GAIA ID migration for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: simple version Created 5 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_mobile.cc
diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_mobile.cc b/chrome/browser/policy/cloud/user_policy_signin_service_mobile.cc
index 5db81f8208f1bbb629b70bc1fb9c9831af6c3a08..06521c69c90995a291cb993e86baf1e232ad6b15 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service_mobile.cc
+++ b/chrome/browser/policy/cloud/user_policy_signin_service_mobile.cc
@@ -69,8 +69,9 @@ UserPolicySigninService::~UserPolicySigninService() {}
void UserPolicySigninService::RegisterForPolicy(
const std::string& username,
+ const std::string& accountId,
const PolicyRegistrationCallback& callback) {
- RegisterForPolicyInternal(username, "", callback);
+ RegisterForPolicyInternal(username, accountId, "", callback);
}
#if !defined(OS_ANDROID)
@@ -78,7 +79,7 @@ void UserPolicySigninService::RegisterForPolicyWithAccessToken(
const std::string& username,
const std::string& access_token,
const PolicyRegistrationCallback& callback) {
- RegisterForPolicyInternal(username, access_token, callback);
+ RegisterForPolicyInternal(username, "", access_token, callback);
Roger Tawa OOO till Jul 10th 2015/08/12 15:28:47 This won't work on non-android platforms. Since t
gogerald1 2015/08/13 18:12:12 This interface go with access_token, so we no need
}
// static
@@ -89,6 +90,7 @@ std::vector<std::string> UserPolicySigninService::GetScopes() {
void UserPolicySigninService::RegisterForPolicyInternal(
const std::string& username,
+ const std::string& accountId,
const std::string& access_token,
const PolicyRegistrationCallback& callback) {
// Create a new CloudPolicyClient for fetching the DMToken.
@@ -109,11 +111,9 @@ void UserPolicySigninService::RegisterForPolicyInternal(
if (access_token.empty()) {
registration_helper_->StartRegistration(
- oauth2_token_service_,
- username,
+ oauth2_token_service_, accountId,
base::Bind(&UserPolicySigninService::CallPolicyRegistrationCallback,
- base::Unretained(this),
- base::Passed(&policy_client),
+ base::Unretained(this), base::Passed(&policy_client),
callback));
} else {
#if defined(OS_ANDROID)
@@ -203,8 +203,7 @@ void UserPolicySigninService::RegisterCloudPolicyService() {
policy_manager()->core()->client(),
kCloudPolicyRegistrationType));
registration_helper_->StartRegistration(
- oauth2_token_service_,
- signin_manager()->GetAuthenticatedUsername(),
+ oauth2_token_service_, signin_manager()->GetAuthenticatedAccountId(),
Roger Tawa OOO till Jul 10th 2015/08/12 15:28:47 Good catch.
gogerald1 2015/08/13 18:12:12 Done.
base::Bind(&UserPolicySigninService::OnRegistrationDone,
base::Unretained(this)));
}

Powered by Google App Engine
This is Rietveld 408576698