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

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

Issue 2953253002: [DICE] Enable sync for an account that is already present in the token service. (Closed)
Patch Set: Address code review Created 3 years, 5 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 89ca8321739e02ffba85e1c26fc90d0d3dd007db..7536472f584979cb6050ed6625866e377a8002fc 100644
--- a/chrome/browser/policy/cloud/user_policy_signin_service_mobile.cc
+++ b/chrome/browser/policy/cloud/user_policy_signin_service_mobile.cc
@@ -62,36 +62,14 @@ UserPolicySigninService::UserPolicySigninService(
UserPolicySigninService::~UserPolicySigninService() {}
-void UserPolicySigninService::RegisterForPolicy(
- const std::string& username,
- const std::string& account_id,
- const PolicyRegistrationCallback& callback) {
- RegisterForPolicyInternal(username, account_id, "", callback);
-}
-
-#if !defined(OS_ANDROID)
-void UserPolicySigninService::RegisterForPolicyWithAccessToken(
- const std::string& username,
- const std::string& access_token,
- const PolicyRegistrationCallback& callback) {
- RegisterForPolicyInternal(username, "", access_token, callback);
-}
-
-// static
-std::vector<std::string> UserPolicySigninService::GetScopes() {
- return CloudPolicyClientRegistrationHelper::GetScopes();
-}
-#endif
-
void UserPolicySigninService::ShutdownUserCloudPolicyManager() {
CancelPendingRegistration();
UserPolicySigninServiceBase::ShutdownUserCloudPolicyManager();
}
-void UserPolicySigninService::RegisterForPolicyInternal(
+void UserPolicySigninService::RegisterForPolicyWithAccountId(
const std::string& username,
const std::string& account_id,
- const std::string& access_token,
const PolicyRegistrationCallback& callback) {
// Create a new CloudPolicyClient for fetching the DMToken.
std::unique_ptr<CloudPolicyClient> policy_client =
@@ -114,17 +92,8 @@ void UserPolicySigninService::RegisterForPolicyInternal(
auto registration_callback = base::Bind(
&UserPolicySigninService::CallPolicyRegistrationCallback,
base::Unretained(this), base::Passed(&policy_client), callback);
- if (access_token.empty()) {
- registration_helper_->StartRegistration(
- oauth2_token_service_, account_id, registration_callback);
- } else {
-#if defined(OS_ANDROID)
- NOTREACHED();
-#else
- registration_helper_->StartRegistrationWithAccessToken(
- access_token, registration_callback);
-#endif
- }
+ registration_helper_->StartRegistration(oauth2_token_service_, account_id,
+ registration_callback);
}
void UserPolicySigninService::CallPolicyRegistrationCallback(

Powered by Google App Engine
This is Rietveld 408576698