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

Side by Side Diff: chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.cc

Issue 2945023002: Introduce profile for lock screen apps (Closed)
Patch Set: rebase 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 unified diff | Download patch
OLDNEW
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
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 and the lock screen app
150 if (chromeos::ProfileHelper::IsSigninProfile(profile)) 150 // profile.
151 if (chromeos::ProfileHelper::IsSigninProfile(profile) ||
152 chromeos::ProfileHelper::IsLockScreenAppProfile(profile)) {
151 return {}; 153 return {};
154 }
152 155
153 // |user| should never be nullptr except for the signin profile. This object 156 // |user| should never be nullptr except for the signin and lock screen app
154 // is created as part of the Profile creation, which happens right after 157 // profile. This object is created as part of the Profile creation, which
155 // sign-in. The just-signed-in User is the active user during that time. 158 // happens right after sign-in. The just-signed-in User is the active user
159 // during that time.
156 const user_manager::User* user = 160 const user_manager::User* user =
157 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); 161 chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
158 CHECK(user); 162 CHECK(user);
159 163
160 // User policy exists for enterprise accounts only: 164 // User policy exists for enterprise accounts only:
161 // - For regular cloud-managed users (those who have a GAIA account), a 165 // - For regular cloud-managed users (those who have a GAIA account), a
162 // |UserCloudPolicyManagerChromeOS| is created here. 166 // |UserCloudPolicyManagerChromeOS| is created here.
163 // - For Active Directory managed users, an |ActiveDirectoryPolicyManager| 167 // - For Active Directory managed users, an |ActiveDirectoryPolicyManager|
164 // is created. 168 // is created.
165 // - For device-local accounts, policy is provided by 169 // - For device-local accounts, policy is provided by
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 325
322 bool UserPolicyManagerFactoryChromeOS::HasTestingFactory( 326 bool UserPolicyManagerFactoryChromeOS::HasTestingFactory(
323 content::BrowserContext* context) { 327 content::BrowserContext* context) {
324 return false; 328 return false;
325 } 329 }
326 330
327 void UserPolicyManagerFactoryChromeOS::CreateServiceNow( 331 void UserPolicyManagerFactoryChromeOS::CreateServiceNow(
328 content::BrowserContext* context) {} 332 content::BrowserContext* context) {}
329 333
330 } // namespace policy 334 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698