Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromeos/policy/user_policy_manager_factory_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 UserPolicyManagerFactoryChromeOS::CreateManagerForProfile( | 139 UserPolicyManagerFactoryChromeOS::CreateManagerForProfile( |
| 140 Profile* profile, | 140 Profile* profile, |
| 141 bool force_immediate_load, | 141 bool force_immediate_load, |
| 142 scoped_refptr<base::SequencedTaskRunner> background_task_runner) { | 142 scoped_refptr<base::SequencedTaskRunner> background_task_runner) { |
| 143 DCHECK(cloud_managers_.find(profile) == cloud_managers_.end()); | 143 DCHECK(cloud_managers_.find(profile) == cloud_managers_.end()); |
| 144 DCHECK(active_directory_managers_.find(profile) == | 144 DCHECK(active_directory_managers_.find(profile) == |
| 145 active_directory_managers_.end()); | 145 active_directory_managers_.end()); |
| 146 | 146 |
| 147 const base::CommandLine* command_line = | 147 const base::CommandLine* command_line = |
| 148 base::CommandLine::ForCurrentProcess(); | 148 base::CommandLine::ForCurrentProcess(); |
| 149 // Don't initialize cloud policy for the signin profile. | 149 // Don't initialize cloud policy for the signin profile. |
|
emaxx
2017/06/23 16:16:30
nit: Add " and the lock screen app profile".
tbarzic
2017/06/23 17:18:40
Done.
| |
| 150 if (chromeos::ProfileHelper::IsSigninProfile(profile)) | 150 if (chromeos::ProfileHelper::IsSigninProfile(profile) || |
| 151 chromeos::ProfileHelper::IsLockScreenAppProfile(profile)) { | |
| 151 return {}; | 152 return {}; |
| 153 } | |
| 152 | 154 |
| 153 // |user| should never be nullptr except for the signin profile. This object | 155 // |user| should never be nullptr except for the signin profile. This object |
|
emaxx
2017/06/23 16:16:30
nit: Update this comment too.
tbarzic
2017/06/23 17:18:40
Done.
| |
| 154 // is created as part of the Profile creation, which happens right after | 156 // is created as part of the Profile creation, which happens right after |
| 155 // sign-in. The just-signed-in User is the active user during that time. | 157 // sign-in. The just-signed-in User is the active user during that time. |
| 156 const user_manager::User* user = | 158 const user_manager::User* user = |
| 157 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 159 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
| 158 CHECK(user); | 160 CHECK(user); |
| 159 | 161 |
| 160 // User policy exists for enterprise accounts only: | 162 // User policy exists for enterprise accounts only: |
| 161 // - For regular cloud-managed users (those who have a GAIA account), a | 163 // - For regular cloud-managed users (those who have a GAIA account), a |
| 162 // |UserCloudPolicyManagerChromeOS| is created here. | 164 // |UserCloudPolicyManagerChromeOS| is created here. |
| 163 // - For Active Directory managed users, an |ActiveDirectoryPolicyManager| | 165 // - For Active Directory managed users, an |ActiveDirectoryPolicyManager| |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 | 323 |
| 322 bool UserPolicyManagerFactoryChromeOS::HasTestingFactory( | 324 bool UserPolicyManagerFactoryChromeOS::HasTestingFactory( |
| 323 content::BrowserContext* context) { | 325 content::BrowserContext* context) { |
| 324 return false; | 326 return false; |
| 325 } | 327 } |
| 326 | 328 |
| 327 void UserPolicyManagerFactoryChromeOS::CreateServiceNow( | 329 void UserPolicyManagerFactoryChromeOS::CreateServiceNow( |
| 328 content::BrowserContext* context) {} | 330 content::BrowserContext* context) {} |
| 329 | 331 |
| 330 } // namespace policy | 332 } // namespace policy |
| OLD | NEW |