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/browser_policy_connector.h" | 5 #include "chrome/browser/policy/browser_policy_connector.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #include "chrome/browser/chromeos/policy/network_configuration_updater_impl.h" | 61 #include "chrome/browser/chromeos/policy/network_configuration_updater_impl.h" |
62 #include "chrome/browser/chromeos/policy/network_configuration_updater_impl_cros
.h" | 62 #include "chrome/browser/chromeos/policy/network_configuration_updater_impl_cros
.h" |
63 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 63 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
64 #include "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h" | 64 #include "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h" |
65 #include "chrome/browser/chromeos/settings/cros_settings.h" | 65 #include "chrome/browser/chromeos/settings/cros_settings.h" |
66 #include "chrome/browser/chromeos/settings/cros_settings_provider.h" | 66 #include "chrome/browser/chromeos/settings/cros_settings_provider.h" |
67 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 67 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
68 #include "chrome/browser/chromeos/system/statistics_provider.h" | 68 #include "chrome/browser/chromeos/system/statistics_provider.h" |
69 #include "chrome/browser/chromeos/system/timezone_settings.h" | 69 #include "chrome/browser/chromeos/system/timezone_settings.h" |
70 #include "chrome/browser/policy/cloud/resource_cache.h" | 70 #include "chrome/browser/policy/cloud/resource_cache.h" |
| 71 #include "chromeos/chromeos_paths.h" |
71 #include "chromeos/chromeos_switches.h" | 72 #include "chromeos/chromeos_switches.h" |
72 #include "chromeos/dbus/cryptohome_client.h" | 73 #include "chromeos/dbus/cryptohome_client.h" |
73 #include "chromeos/dbus/dbus_thread_manager.h" | 74 #include "chromeos/dbus/dbus_thread_manager.h" |
74 #else | 75 #else |
75 #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h" | 76 #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h" |
76 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 77 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
77 #endif | 78 #endif |
78 | 79 |
79 using content::BrowserThread; | 80 using content::BrowserThread; |
80 | 81 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // |cros_library| may be NULL on unit tests. DBusThreadManager may not be | 132 // |cros_library| may be NULL on unit tests. DBusThreadManager may not be |
132 // initialized on unit tests.. | 133 // initialized on unit tests.. |
133 if (cros_library && chromeos::DBusThreadManager::IsInitialized()) { | 134 if (cros_library && chromeos::DBusThreadManager::IsInitialized()) { |
134 chromeos::CryptohomeLibrary* cryptohome = | 135 chromeos::CryptohomeLibrary* cryptohome = |
135 cros_library->GetCryptohomeLibrary(); | 136 cros_library->GetCryptohomeLibrary(); |
136 chromeos::CryptohomeClient* cryptohome_client = | 137 chromeos::CryptohomeClient* cryptohome_client = |
137 chromeos::DBusThreadManager::Get()->GetCryptohomeClient(); | 138 chromeos::DBusThreadManager::Get()->GetCryptohomeClient(); |
138 install_attributes_.reset( | 139 install_attributes_.reset( |
139 new EnterpriseInstallAttributes(cryptohome, cryptohome_client)); | 140 new EnterpriseInstallAttributes(cryptohome, cryptohome_client)); |
140 base::FilePath install_attrs_file; | 141 base::FilePath install_attrs_file; |
141 CHECK(PathService::Get(chrome::FILE_INSTALL_ATTRIBUTES, | 142 CHECK(PathService::Get(chromeos::FILE_INSTALL_ATTRIBUTES, |
142 &install_attrs_file)); | 143 &install_attrs_file)); |
143 install_attributes_->ReadCacheFile(install_attrs_file); | 144 install_attributes_->ReadCacheFile(install_attrs_file); |
144 | 145 |
145 scoped_ptr<DeviceCloudPolicyStoreChromeOS> device_cloud_policy_store( | 146 scoped_ptr<DeviceCloudPolicyStoreChromeOS> device_cloud_policy_store( |
146 new DeviceCloudPolicyStoreChromeOS( | 147 new DeviceCloudPolicyStoreChromeOS( |
147 chromeos::DeviceSettingsService::Get(), | 148 chromeos::DeviceSettingsService::Get(), |
148 install_attributes_.get())); | 149 install_attributes_.get())); |
149 device_cloud_policy_manager_.reset( | 150 device_cloud_policy_manager_.reset( |
150 new DeviceCloudPolicyManagerChromeOS( | 151 new DeviceCloudPolicyManagerChromeOS( |
151 device_cloud_policy_store.Pass(), | 152 device_cloud_policy_store.Pass(), |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 base::FilePath profile_dir; | 329 base::FilePath profile_dir; |
329 CHECK(PathService::Get(chrome::DIR_USER_DATA, &profile_dir)); | 330 CHECK(PathService::Get(chrome::DIR_USER_DATA, &profile_dir)); |
330 profile_dir = profile_dir.Append( | 331 profile_dir = profile_dir.Append( |
331 command_line->GetSwitchValuePath(chromeos::switches::kLoginProfile)); | 332 command_line->GetSwitchValuePath(chromeos::switches::kLoginProfile)); |
332 const base::FilePath legacy_dir = profile_dir.Append(kDeviceManagementDir); | 333 const base::FilePath legacy_dir = profile_dir.Append(kDeviceManagementDir); |
333 const base::FilePath policy_cache_file = legacy_dir.Append(kPolicy); | 334 const base::FilePath policy_cache_file = legacy_dir.Append(kPolicy); |
334 const base::FilePath token_cache_file = legacy_dir.Append(kToken); | 335 const base::FilePath token_cache_file = legacy_dir.Append(kToken); |
335 const base::FilePath resource_cache_dir = | 336 const base::FilePath resource_cache_dir = |
336 profile_dir.Append(kPolicy).Append(kResourceDir); | 337 profile_dir.Append(kPolicy).Append(kResourceDir); |
337 base::FilePath policy_key_dir; | 338 base::FilePath policy_key_dir; |
338 CHECK(PathService::Get(chrome::DIR_USER_POLICY_KEYS, &policy_key_dir)); | 339 CHECK(PathService::Get(chromeos::DIR_USER_POLICY_KEYS, &policy_key_dir)); |
339 | 340 |
340 if (wait_for_policy_fetch) | 341 if (wait_for_policy_fetch) |
341 device_management_service_->ScheduleInitialization(0); | 342 device_management_service_->ScheduleInitialization(0); |
342 if (is_public_account && device_local_account_policy_service_) { | 343 if (is_public_account && device_local_account_policy_service_) { |
343 device_local_account_policy_provider_.reset( | 344 device_local_account_policy_provider_.reset( |
344 new DeviceLocalAccountPolicyProvider( | 345 new DeviceLocalAccountPolicyProvider( |
345 user_name, device_local_account_policy_service_.get())); | 346 user_name, device_local_account_policy_service_.get())); |
346 | 347 |
347 device_local_account_policy_provider_->Init(); | 348 device_local_account_policy_provider_->Init(); |
348 global_user_cloud_policy_provider_.SetDelegate( | 349 global_user_cloud_policy_provider_.SetDelegate( |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 return new AsyncPolicyProvider(loader.Pass()); | 597 return new AsyncPolicyProvider(loader.Pass()); |
597 } else { | 598 } else { |
598 return NULL; | 599 return NULL; |
599 } | 600 } |
600 #else | 601 #else |
601 return NULL; | 602 return NULL; |
602 #endif | 603 #endif |
603 } | 604 } |
604 | 605 |
605 } // namespace policy | 606 } // namespace policy |
OLD | NEW |