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 <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/sequenced_task_runner.h" | 17 #include "base/sequenced_task_runner.h" |
18 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
20 #include "base/threading/sequenced_worker_pool.h" | 20 #include "base/threading/sequenced_worker_pool.h" |
21 #include "base/threading/thread_task_runner_handle.h" | 21 #include "base/threading/thread_task_runner_handle.h" |
| 22 #include "chrome/browser/browser_process.h" |
22 #include "chrome/browser/chromeos/attestation/attestation_ca_client.h" | 23 #include "chrome/browser/chromeos/attestation/attestation_ca_client.h" |
23 #include "chrome/browser/chromeos/policy/active_directory_policy_manager.h" | 24 #include "chrome/browser/chromeos/policy/active_directory_policy_manager.h" |
24 #include "chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.h" | 25 #include "chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.h" |
25 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r.h" | 26 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r.h" |
26 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r_impl.h" | 27 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r_impl.h" |
27 #include "chrome/browser/chromeos/policy/bluetooth_policy_handler.h" | 28 #include "chrome/browser/chromeos/policy/bluetooth_policy_handler.h" |
28 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" | 29 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" |
29 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" | 30 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" |
30 #include "chrome/browser/chromeos/policy/device_local_account.h" | 31 #include "chrome/browser/chromeos/policy/device_local_account.h" |
31 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" | 32 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
32 #include "chrome/browser/chromeos/policy/device_network_configuration_updater.h" | 33 #include "chrome/browser/chromeos/policy/device_network_configuration_updater.h" |
33 #include "chrome/browser/chromeos/policy/enrollment_config.h" | 34 #include "chrome/browser/chromeos/policy/enrollment_config.h" |
34 #include "chrome/browser/chromeos/policy/remote_commands/affiliated_remote_comma
nds_invalidator.h" | 35 #include "chrome/browser/chromeos/policy/remote_commands/affiliated_remote_comma
nds_invalidator.h" |
35 #include "chrome/browser/chromeos/policy/server_backed_state_keys_broker.h" | 36 #include "chrome/browser/chromeos/policy/server_backed_state_keys_broker.h" |
36 #include "chrome/browser/chromeos/settings/cros_settings.h" | 37 #include "chrome/browser/chromeos/settings/cros_settings.h" |
37 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 38 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
38 #include "chrome/browser/chromeos/settings/install_attributes.h" | 39 #include "chrome/browser/chromeos/settings/install_attributes.h" |
| 40 #include "chrome/browser/chromeos/system/timezone_util.h" |
39 #include "chrome/browser/policy/device_management_service_configuration.h" | 41 #include "chrome/browser/policy/device_management_service_configuration.h" |
40 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
41 #include "chromeos/attestation/attestation_flow.h" | 43 #include "chromeos/attestation/attestation_flow.h" |
42 #include "chromeos/chromeos_paths.h" | 44 #include "chromeos/chromeos_paths.h" |
43 #include "chromeos/chromeos_switches.h" | 45 #include "chromeos/chromeos_switches.h" |
44 #include "chromeos/cryptohome/async_method_caller.h" | 46 #include "chromeos/cryptohome/async_method_caller.h" |
45 #include "chromeos/cryptohome/system_salt_getter.h" | 47 #include "chromeos/cryptohome/system_salt_getter.h" |
46 #include "chromeos/dbus/cryptohome_client.h" | 48 #include "chromeos/dbus/cryptohome_client.h" |
47 #include "chromeos/dbus/dbus_thread_manager.h" | 49 #include "chromeos/dbus/dbus_thread_manager.h" |
48 #include "chromeos/dbus/upstart_client.h" | 50 #include "chromeos/dbus/upstart_client.h" |
49 #include "chromeos/network/network_handler.h" | 51 #include "chromeos/network/network_handler.h" |
50 #include "chromeos/network/onc/onc_certificate_importer_impl.h" | 52 #include "chromeos/network/onc/onc_certificate_importer_impl.h" |
51 #include "chromeos/settings/cros_settings_names.h" | 53 #include "chromeos/settings/cros_settings_names.h" |
52 #include "chromeos/settings/cros_settings_provider.h" | 54 #include "chromeos/settings/cros_settings_provider.h" |
53 #include "chromeos/settings/timezone_settings.h" | 55 #include "chromeos/settings/timezone_settings.h" |
54 #include "chromeos/system/statistics_provider.h" | 56 #include "chromeos/system/statistics_provider.h" |
55 #include "components/policy/core/common/cloud/cloud_policy_client.h" | 57 #include "components/policy/core/common/cloud/cloud_policy_client.h" |
56 #include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h" | 58 #include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h" |
57 #include "components/policy/core/common/proxy_policy_provider.h" | 59 #include "components/policy/core/common/proxy_policy_provider.h" |
58 #include "components/policy/proto/device_management_backend.pb.h" | 60 #include "components/policy/proto/device_management_backend.pb.h" |
59 #include "components/prefs/pref_registry_simple.h" | 61 #include "components/prefs/pref_registry_simple.h" |
| 62 #include "components/prefs/pref_service.h" |
60 #include "content/public/browser/browser_thread.h" | 63 #include "content/public/browser/browser_thread.h" |
61 #include "google_apis/gaia/gaia_auth_util.h" | 64 #include "google_apis/gaia/gaia_auth_util.h" |
62 #include "net/url_request/url_request_context_getter.h" | 65 #include "net/url_request/url_request_context_getter.h" |
63 | 66 |
64 using content::BrowserThread; | 67 using content::BrowserThread; |
65 | 68 |
66 namespace policy { | 69 namespace policy { |
67 | 70 |
68 namespace { | 71 namespace { |
69 | 72 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 &BrowserPolicyConnectorChromeOS::SetTimezoneIfPolicyAvailable, | 338 &BrowserPolicyConnectorChromeOS::SetTimezoneIfPolicyAvailable, |
336 weak_ptr_factory_.GetWeakPtr())); | 339 weak_ptr_factory_.GetWeakPtr())); |
337 | 340 |
338 if (result != Provider::TRUSTED) | 341 if (result != Provider::TRUSTED) |
339 return; | 342 return; |
340 | 343 |
341 std::string timezone; | 344 std::string timezone; |
342 if (chromeos::CrosSettings::Get()->GetString(chromeos::kSystemTimezonePolicy, | 345 if (chromeos::CrosSettings::Get()->GetString(chromeos::kSystemTimezonePolicy, |
343 &timezone) && | 346 &timezone) && |
344 !timezone.empty()) { | 347 !timezone.empty()) { |
345 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( | 348 chromeos::system::SetSigninScreenTimezone(timezone, true); |
346 base::UTF8ToUTF16(timezone)); | |
347 } | 349 } |
348 } | 350 } |
349 | 351 |
350 void BrowserPolicyConnectorChromeOS::RestartDeviceCloudPolicyInitializer() { | 352 void BrowserPolicyConnectorChromeOS::RestartDeviceCloudPolicyInitializer() { |
351 device_cloud_policy_initializer_ = | 353 device_cloud_policy_initializer_ = |
352 base::MakeUnique<DeviceCloudPolicyInitializer>( | 354 base::MakeUnique<DeviceCloudPolicyInitializer>( |
353 local_state_, device_management_service(), GetBackgroundTaskRunner(), | 355 local_state_, device_management_service(), GetBackgroundTaskRunner(), |
354 install_attributes_.get(), state_keys_broker_.get(), | 356 install_attributes_.get(), state_keys_broker_.get(), |
355 device_cloud_policy_manager_->device_store(), | 357 device_cloud_policy_manager_->device_store(), |
356 device_cloud_policy_manager_, | 358 device_cloud_policy_manager_, |
(...skipping 18 matching lines...) Expand all Loading... |
375 device_cloud_policy_manager_->device_store()->policy(); | 377 device_cloud_policy_manager_->device_store()->policy(); |
376 if (policy_data) { | 378 if (policy_data) { |
377 affiliation_ids.insert(policy_data->device_affiliation_ids().begin(), | 379 affiliation_ids.insert(policy_data->device_affiliation_ids().begin(), |
378 policy_data->device_affiliation_ids().end()); | 380 policy_data->device_affiliation_ids().end()); |
379 } | 381 } |
380 } | 382 } |
381 return affiliation_ids; | 383 return affiliation_ids; |
382 } | 384 } |
383 | 385 |
384 } // namespace policy | 386 } // namespace policy |
OLD | NEW |