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/device_cloud_policy_initializer.h" | 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/prefs/pref_service.h" | |
14 #include "base/sequenced_task_runner.h" | 13 #include "base/sequenced_task_runner.h" |
15 #include "base/values.h" | 14 #include "base/values.h" |
16 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.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" |
18 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" | 17 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" |
19 #include "chrome/browser/chromeos/policy/device_status_collector.h" | 18 #include "chrome/browser/chromeos/policy/device_status_collector.h" |
20 #include "chrome/browser/chromeos/policy/enrollment_config.h" | 19 #include "chrome/browser/chromeos/policy/enrollment_config.h" |
21 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h" | 20 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h" |
22 #include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h" | 21 #include "chrome/browser/chromeos/policy/enrollment_status_chromeos.h" |
23 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" | 22 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" |
24 #include "chrome/browser/chromeos/policy/server_backed_device_state.h" | 23 #include "chrome/browser/chromeos/policy/server_backed_device_state.h" |
25 #include "chrome/common/chrome_content_client.h" | 24 #include "chrome/common/chrome_content_client.h" |
26 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
27 #include "chromeos/system/statistics_provider.h" | 26 #include "chromeos/system/statistics_provider.h" |
28 #include "components/policy/core/common/cloud/cloud_policy_core.h" | 27 #include "components/policy/core/common/cloud/cloud_policy_core.h" |
29 #include "components/policy/core/common/cloud/device_management_service.h" | 28 #include "components/policy/core/common/cloud/device_management_service.h" |
30 #include "components/policy/core/common/cloud/system_policy_request_context.h" | 29 #include "components/policy/core/common/cloud/system_policy_request_context.h" |
| 30 #include "components/prefs/pref_service.h" |
31 #include "net/url_request/url_request_context_getter.h" | 31 #include "net/url_request/url_request_context_getter.h" |
32 | 32 |
33 namespace policy { | 33 namespace policy { |
34 | 34 |
35 namespace { | 35 namespace { |
36 | 36 |
37 // Gets a machine flag from StatisticsProvider, returning the given | 37 // Gets a machine flag from StatisticsProvider, returning the given |
38 // |default_value| if not present. | 38 // |default_value| if not present. |
39 bool GetMachineFlag(const std::string& key, bool default_value) { | 39 bool GetMachineFlag(const std::string& key, bool default_value) { |
40 bool value = default_value; | 40 bool value = default_value; |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 StartConnection(CreateClient(service)); | 259 StartConnection(CreateClient(service)); |
260 } | 260 } |
261 | 261 |
262 void DeviceCloudPolicyInitializer::StartConnection( | 262 void DeviceCloudPolicyInitializer::StartConnection( |
263 scoped_ptr<CloudPolicyClient> client) { | 263 scoped_ptr<CloudPolicyClient> client) { |
264 if (!manager_->core()->service()) | 264 if (!manager_->core()->service()) |
265 manager_->StartConnection(std::move(client), install_attributes_); | 265 manager_->StartConnection(std::move(client), install_attributes_); |
266 } | 266 } |
267 | 267 |
268 } // namespace policy | 268 } // namespace policy |
OLD | NEW |