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/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.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/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
11 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h" | 11 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h" |
12 #include "chrome/browser/chromeos/login/startup_utils.h" | 12 #include "chrome/browser/chromeos/login/startup_utils.h" |
13 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" | 13 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" |
14 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h" | 14 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h" |
15 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" | 15 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h" |
16 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" | 16 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" |
17 #include "chrome/browser/policy/cloud/cloud_policy_store.h" | 17 #include "chrome/browser/policy/cloud/cloud_policy_store.h" |
18 #include "chrome/browser/policy/cloud/device_management_service.h" | 18 #include "chrome/browser/policy/cloud/device_management_service.h" |
19 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" | 19 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" |
20 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
21 #include "chromeos/chromeos_constants.h" | 21 #include "chromeos/chromeos_constants.h" |
22 #include "chromeos/system/statistics_provider.h" | 22 #include "chromeos/system/statistics_provider.h" |
| 23 #include "content/public/browser/browser_thread.h" |
| 24 |
| 25 using content::BrowserThread; |
23 | 26 |
24 namespace em = enterprise_management; | 27 namespace em = enterprise_management; |
25 | 28 |
26 namespace policy { | 29 namespace policy { |
27 | 30 |
28 namespace { | 31 namespace { |
29 | 32 |
30 // MachineInfo key names. | 33 // MachineInfo key names. |
31 const char kMachineInfoSystemHwqual[] = "hardware_class"; | 34 const char kMachineInfoSystemHwqual[] = "hardware_class"; |
32 | 35 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 84 |
82 DeviceCloudPolicyManagerChromeOS::DeviceCloudPolicyManagerChromeOS( | 85 DeviceCloudPolicyManagerChromeOS::DeviceCloudPolicyManagerChromeOS( |
83 scoped_ptr<DeviceCloudPolicyStoreChromeOS> store, | 86 scoped_ptr<DeviceCloudPolicyStoreChromeOS> store, |
84 const scoped_refptr<base::SequencedTaskRunner>& task_runner, | 87 const scoped_refptr<base::SequencedTaskRunner>& task_runner, |
85 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, | 88 const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, |
86 EnterpriseInstallAttributes* install_attributes) | 89 EnterpriseInstallAttributes* install_attributes) |
87 : CloudPolicyManager( | 90 : CloudPolicyManager( |
88 PolicyNamespaceKey(dm_protocol::kChromeDevicePolicyType, | 91 PolicyNamespaceKey(dm_protocol::kChromeDevicePolicyType, |
89 std::string()), | 92 std::string()), |
90 store.get(), | 93 store.get(), |
91 task_runner), | 94 task_runner, |
| 95 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), |
| 96 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)), |
92 device_store_(store.Pass()), | 97 device_store_(store.Pass()), |
93 background_task_runner_(background_task_runner), | 98 background_task_runner_(background_task_runner), |
94 install_attributes_(install_attributes), | 99 install_attributes_(install_attributes), |
95 device_management_service_(NULL), | 100 device_management_service_(NULL), |
96 local_state_(NULL) {} | 101 local_state_(NULL) {} |
97 | 102 |
98 DeviceCloudPolicyManagerChromeOS::~DeviceCloudPolicyManagerChromeOS() {} | 103 DeviceCloudPolicyManagerChromeOS::~DeviceCloudPolicyManagerChromeOS() {} |
99 | 104 |
100 void DeviceCloudPolicyManagerChromeOS::Connect( | 105 void DeviceCloudPolicyManagerChromeOS::Connect( |
101 PrefService* local_state, | 106 PrefService* local_state, |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 core()->Connect(CreateClient()); | 274 core()->Connect(CreateClient()); |
270 core()->StartRefreshScheduler(); | 275 core()->StartRefreshScheduler(); |
271 core()->TrackRefreshDelayPref(local_state_, | 276 core()->TrackRefreshDelayPref(local_state_, |
272 prefs::kDevicePolicyRefreshRate); | 277 prefs::kDevicePolicyRefreshRate); |
273 attestation_policy_observer_.reset( | 278 attestation_policy_observer_.reset( |
274 new chromeos::attestation::AttestationPolicyObserver(client())); | 279 new chromeos::attestation::AttestationPolicyObserver(client())); |
275 } | 280 } |
276 } | 281 } |
277 | 282 |
278 } // namespace policy | 283 } // namespace policy |
OLD | NEW |