| 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_cloud_policy_manager_factory_chrom
eos.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 scoped_refptr<base::SequencedTaskRunner> background_task_runner) { | 118 scoped_refptr<base::SequencedTaskRunner> background_task_runner) { |
| 119 const base::CommandLine* command_line = | 119 const base::CommandLine* command_line = |
| 120 base::CommandLine::ForCurrentProcess(); | 120 base::CommandLine::ForCurrentProcess(); |
| 121 // Don't initialize cloud policy for the signin profile. | 121 // Don't initialize cloud policy for the signin profile. |
| 122 if (chromeos::ProfileHelper::IsSigninProfile(profile)) | 122 if (chromeos::ProfileHelper::IsSigninProfile(profile)) |
| 123 return scoped_ptr<UserCloudPolicyManagerChromeOS>(); | 123 return scoped_ptr<UserCloudPolicyManagerChromeOS>(); |
| 124 | 124 |
| 125 // |user| should never be NULL except for the signin profile. This object is | 125 // |user| should never be NULL except for the signin profile. This object is |
| 126 // created as part of the Profile creation, which happens right after | 126 // created as part of the Profile creation, which happens right after |
| 127 // sign-in. The just-signed-in User is the active user during that time. | 127 // sign-in. The just-signed-in User is the active user during that time. |
| 128 user_manager::User* user = | 128 const user_manager::User* user = |
| 129 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 129 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
| 130 CHECK(user); | 130 CHECK(user); |
| 131 | 131 |
| 132 // User policy exists for enterprise accounts only: | 132 // User policy exists for enterprise accounts only: |
| 133 // - For regular enterprise users (those who have a GAIA account), a | 133 // - For regular enterprise users (those who have a GAIA account), a |
| 134 // |UserCloudPolicyManagerChromeOS| is created here. | 134 // |UserCloudPolicyManagerChromeOS| is created here. |
| 135 // - For device-local accounts, policy is provided by | 135 // - For device-local accounts, policy is provided by |
| 136 // |DeviceLocalAccountPolicyService|. | 136 // |DeviceLocalAccountPolicyService|. |
| 137 // All other user types do not have user policy. | 137 // All other user types do not have user policy. |
| 138 const std::string& username = user->email(); | 138 const std::string& username = user->email(); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 251 |
| 252 bool UserCloudPolicyManagerFactoryChromeOS::HasTestingFactory( | 252 bool UserCloudPolicyManagerFactoryChromeOS::HasTestingFactory( |
| 253 content::BrowserContext* context) { | 253 content::BrowserContext* context) { |
| 254 return false; | 254 return false; |
| 255 } | 255 } |
| 256 | 256 |
| 257 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow( | 257 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow( |
| 258 content::BrowserContext* context) {} | 258 content::BrowserContext* context) {} |
| 259 | 259 |
| 260 } // namespace policy | 260 } // namespace policy |
| OLD | NEW |