| 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" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/message_loop/message_loop_proxy.h" | 12 #include "base/message_loop/message_loop_proxy.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/sequenced_task_runner.h" | 14 #include "base/sequenced_task_runner.h" |
| 15 #include "base/threading/sequenced_worker_pool.h" | 15 #include "base/threading/sequenced_worker_pool.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/chromeos/login/login_utils.h" |
| 18 #include "chrome/browser/chromeos/login/user.h" | 19 #include "chrome/browser/chromeos/login/user.h" |
| 19 #include "chrome/browser/chromeos/login/user_manager.h" | 20 #include "chrome/browser/chromeos/login/user_manager.h" |
| 20 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 21 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 21 #include "chrome/browser/chromeos/policy/user_cloud_external_data_manager.h" | 22 #include "chrome/browser/chromeos/policy/user_cloud_external_data_manager.h" |
| 22 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 23 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
| 23 #include "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h" | 24 #include "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h" |
| 24 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 25 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 25 #include "chrome/browser/policy/schema_registry_service.h" | 26 #include "chrome/browser/policy/schema_registry_service.h" |
| 26 #include "chrome/browser/policy/schema_registry_service_factory.h" | 27 #include "chrome/browser/policy/schema_registry_service_factory.h" |
| 27 #include "chrome/browser/profiles/profile.h" | 28 #include "chrome/browser/profiles/profile.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 scoped_ptr<UserCloudPolicyManagerChromeOS> manager( | 193 scoped_ptr<UserCloudPolicyManagerChromeOS> manager( |
| 193 new UserCloudPolicyManagerChromeOS( | 194 new UserCloudPolicyManagerChromeOS( |
| 194 store.PassAs<CloudPolicyStore>(), | 195 store.PassAs<CloudPolicyStore>(), |
| 195 external_data_manager.Pass(), | 196 external_data_manager.Pass(), |
| 196 component_policy_cache_dir, | 197 component_policy_cache_dir, |
| 197 wait_for_initial_policy, | 198 wait_for_initial_policy, |
| 198 base::TimeDelta::FromSeconds(kInitialPolicyFetchTimeoutSeconds), | 199 base::TimeDelta::FromSeconds(kInitialPolicyFetchTimeoutSeconds), |
| 199 base::MessageLoopProxy::current(), | 200 base::MessageLoopProxy::current(), |
| 200 file_task_runner, | 201 file_task_runner, |
| 201 io_task_runner)); | 202 io_task_runner)); |
| 203 |
| 204 bool wildcard_match = false; |
| 205 if (connector->IsEnterpriseManaged() && |
| 206 chromeos::LoginUtils::IsWhitelisted(username, &wildcard_match) && |
| 207 wildcard_match && |
| 208 !connector->IsNonEnterpriseUser(username)) { |
| 209 manager->EnableWildcardLoginCheck(username); |
| 210 } |
| 211 |
| 202 manager->Init(SchemaRegistryServiceFactory::GetForContext(profile)); | 212 manager->Init(SchemaRegistryServiceFactory::GetForContext(profile)); |
| 203 manager->Connect(g_browser_process->local_state(), | 213 manager->Connect(g_browser_process->local_state(), |
| 204 device_management_service, | 214 device_management_service, |
| 205 g_browser_process->system_request_context(), | 215 g_browser_process->system_request_context(), |
| 206 affiliation); | 216 affiliation); |
| 207 | 217 |
| 208 DCHECK(managers_.find(profile) == managers_.end()); | 218 DCHECK(managers_.find(profile) == managers_.end()); |
| 209 managers_[profile] = manager.get(); | 219 managers_[profile] = manager.get(); |
| 210 return manager.Pass(); | 220 return manager.Pass(); |
| 211 } | 221 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 227 BrowserContextKeyedBaseFactory::BrowserContextDestroyed(context); | 237 BrowserContextKeyedBaseFactory::BrowserContextDestroyed(context); |
| 228 } | 238 } |
| 229 | 239 |
| 230 void UserCloudPolicyManagerFactoryChromeOS::SetEmptyTestingFactory( | 240 void UserCloudPolicyManagerFactoryChromeOS::SetEmptyTestingFactory( |
| 231 content::BrowserContext* context) {} | 241 content::BrowserContext* context) {} |
| 232 | 242 |
| 233 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow( | 243 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow( |
| 234 content::BrowserContext* context) {} | 244 content::BrowserContext* context) {} |
| 235 | 245 |
| 236 } // namespace policy | 246 } // namespace policy |
| OLD | NEW |