| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser_policy_connector_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | |
| 8 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | 8 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 11 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 12 #include "base/prefs/pref_registry_simple.h" | 11 #include "base/prefs/pref_registry_simple.h" |
| 13 #include "base/sequenced_task_runner.h" | 12 #include "base/sequenced_task_runner.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/threading/sequenced_worker_pool.h" | 14 #include "base/threading/sequenced_worker_pool.h" |
| 16 #include "chrome/browser/chromeos/policy/app_pack_updater.h" | 15 #include "chrome/browser/chromeos/policy/app_pack_updater.h" |
| 17 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 16 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 118 |
| 120 scoped_ptr<CloudPolicyClient::StatusProvider> status_provider( | 119 scoped_ptr<CloudPolicyClient::StatusProvider> status_provider( |
| 121 new DeviceStatusCollector( | 120 new DeviceStatusCollector( |
| 122 local_state, | 121 local_state, |
| 123 chromeos::system::StatisticsProvider::GetInstance(), | 122 chromeos::system::StatisticsProvider::GetInstance(), |
| 124 NULL)); | 123 NULL)); |
| 125 device_cloud_policy_manager_->Connect( | 124 device_cloud_policy_manager_->Connect( |
| 126 local_state, device_management_service(), status_provider.Pass()); | 125 local_state, device_management_service(), status_provider.Pass()); |
| 127 } | 126 } |
| 128 | 127 |
| 129 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 128 device_local_account_policy_service_.reset( |
| 130 if (!command_line->HasSwitch(chromeos::switches::kDisableLocalAccounts)) { | 129 new DeviceLocalAccountPolicyService( |
| 131 device_local_account_policy_service_.reset( | 130 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(), |
| 132 new DeviceLocalAccountPolicyService( | 131 chromeos::DeviceSettingsService::Get(), |
| 133 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(), | 132 chromeos::CrosSettings::Get(), |
| 134 chromeos::DeviceSettingsService::Get(), | 133 GetBackgroundTaskRunner(), |
| 135 chromeos::CrosSettings::Get(), | 134 GetBackgroundTaskRunner(), |
| 136 GetBackgroundTaskRunner(), | 135 GetBackgroundTaskRunner(), |
| 137 GetBackgroundTaskRunner(), | 136 content::BrowserThread::GetMessageLoopProxyForThread( |
| 138 GetBackgroundTaskRunner(), | 137 content::BrowserThread::IO), |
| 139 content::BrowserThread::GetMessageLoopProxyForThread( | 138 request_context)); |
| 140 content::BrowserThread::IO), | 139 device_local_account_policy_service_->Connect(device_management_service()); |
| 141 request_context)); | |
| 142 device_local_account_policy_service_->Connect(device_management_service()); | |
| 143 } | |
| 144 | 140 |
| 145 // request_context is NULL in unit tests. | 141 // request_context is NULL in unit tests. |
| 146 if (request_context && install_attributes_) { | 142 if (request_context && install_attributes_) { |
| 147 app_pack_updater_.reset( | 143 app_pack_updater_.reset( |
| 148 new AppPackUpdater(request_context, install_attributes_.get())); | 144 new AppPackUpdater(request_context, install_attributes_.get())); |
| 149 } | 145 } |
| 150 | 146 |
| 151 SetTimezoneIfPolicyAvailable(); | 147 SetTimezoneIfPolicyAvailable(); |
| 152 | 148 |
| 153 network_configuration_updater_ = | 149 network_configuration_updater_ = |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 std::string timezone; | 236 std::string timezone; |
| 241 if (chromeos::CrosSettings::Get()->GetString(chromeos::kSystemTimezonePolicy, | 237 if (chromeos::CrosSettings::Get()->GetString(chromeos::kSystemTimezonePolicy, |
| 242 &timezone) && | 238 &timezone) && |
| 243 !timezone.empty()) { | 239 !timezone.empty()) { |
| 244 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( | 240 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( |
| 245 base::UTF8ToUTF16(timezone)); | 241 base::UTF8ToUTF16(timezone)); |
| 246 } | 242 } |
| 247 } | 243 } |
| 248 | 244 |
| 249 } // namespace policy | 245 } // namespace policy |
| OLD | NEW |