Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/policy/cloud/user_policy_signin_service.h" | 5 #include "chrome/browser/policy/cloud/user_policy_signin_service.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 218 void CloudPolicyClientRegistrationHelper::OnClientError( | 218 void CloudPolicyClientRegistrationHelper::OnClientError( |
| 219 policy::CloudPolicyClient* client) { | 219 policy::CloudPolicyClient* client) { |
| 220 DVLOG(1) << "Client registration failed"; | 220 DVLOG(1) << "Client registration failed"; |
| 221 DCHECK_EQ(client, client_); | 221 DCHECK_EQ(client, client_); |
| 222 RequestCompleted(); | 222 RequestCompleted(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 UserPolicySigninService::UserPolicySigninService( | 225 UserPolicySigninService::UserPolicySigninService( |
| 226 Profile* profile) | 226 Profile* profile) |
| 227 : profile_(profile), | 227 : profile_(profile), |
| 228 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 228 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
|
tapted
2013/04/24 08:08:35
heads up: I just saw a change land that got rid of
gab
2013/04/24 20:24:59
Ok thanks.
| |
| 229 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 229 if (profile_->GetPrefs()->GetBoolean(prefs::kDisableCloudPolicyOnSignin)) |
| 230 if (profile_->GetPrefs()->GetBoolean(prefs::kDisableCloudPolicyOnSignin) || | |
| 231 ProfileManager::IsImportProcess(*cmd_line)) { | |
| 232 return; | 230 return; |
| 233 } | |
| 234 | 231 |
| 235 // Initialize/shutdown the UserCloudPolicyManager when the user signs out. | 232 // Initialize/shutdown the UserCloudPolicyManager when the user signs out. |
| 236 registrar_.Add(this, | 233 registrar_.Add(this, |
| 237 chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, | 234 chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, |
| 238 content::Source<Profile>(profile)); | 235 content::Source<Profile>(profile)); |
| 239 | 236 |
| 240 // Listen for an OAuth token to become available so we can register a client | 237 // Listen for an OAuth token to become available so we can register a client |
| 241 // if for some reason the client is not already registered (for example, if | 238 // if for some reason the client is not already registered (for example, if |
| 242 // the policy load failed during initial signin). | 239 // the policy load failed during initial signin). |
| 243 registrar_.Add(this, | 240 registrar_.Add(this, |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 586 // before UserCloudPolicyManager shuts down the CloudPolicyClient. | 583 // before UserCloudPolicyManager shuts down the CloudPolicyClient. |
| 587 registration_helper_.reset(); | 584 registration_helper_.reset(); |
| 588 StopObserving(); | 585 StopObserving(); |
| 589 } | 586 } |
| 590 | 587 |
| 591 UserCloudPolicyManager* UserPolicySigninService::GetManager() { | 588 UserCloudPolicyManager* UserPolicySigninService::GetManager() { |
| 592 return UserCloudPolicyManagerFactory::GetForProfile(profile_); | 589 return UserCloudPolicyManagerFactory::GetForProfile(profile_); |
| 593 } | 590 } |
| 594 | 591 |
| 595 } // namespace policy | 592 } // namespace policy |
| OLD | NEW |