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 "chrome/browser/chromeos/attestation/attestation_policy_observer.h" | 9 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h" |
10 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" | 10 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 LOG(WARNING) << "Failed to get machine id."; | 150 LOG(WARNING) << "Failed to get machine id."; |
151 | 151 |
152 return machine_id; | 152 return machine_id; |
153 } | 153 } |
154 | 154 |
155 // static | 155 // static |
156 std::string DeviceCloudPolicyManagerChromeOS::GetMachineModel() { | 156 std::string DeviceCloudPolicyManagerChromeOS::GetMachineModel() { |
157 return GetMachineStatistic(kMachineInfoSystemHwqual); | 157 return GetMachineStatistic(kMachineInfoSystemHwqual); |
158 } | 158 } |
159 | 159 |
| 160 std::string DeviceCloudPolicyManagerChromeOS::GetRobotAccountId() { |
| 161 const enterprise_management::PolicyData* policy = device_store_->policy(); |
| 162 return policy ? policy->service_account_identity() : std::string(); |
| 163 } |
| 164 |
160 scoped_ptr<CloudPolicyClient> DeviceCloudPolicyManagerChromeOS::CreateClient() { | 165 scoped_ptr<CloudPolicyClient> DeviceCloudPolicyManagerChromeOS::CreateClient() { |
161 return make_scoped_ptr( | 166 return make_scoped_ptr( |
162 new CloudPolicyClient(GetMachineID(), GetMachineModel(), | 167 new CloudPolicyClient(GetMachineID(), GetMachineModel(), |
163 USER_AFFILIATION_NONE, | 168 USER_AFFILIATION_NONE, |
164 device_status_provider_.get(), | 169 device_status_provider_.get(), |
165 device_management_service_)); | 170 device_management_service_)); |
166 } | 171 } |
167 | 172 |
168 void DeviceCloudPolicyManagerChromeOS::EnrollmentCompleted( | 173 void DeviceCloudPolicyManagerChromeOS::EnrollmentCompleted( |
169 const EnrollmentCallback& callback, | 174 const EnrollmentCallback& callback, |
(...skipping 23 matching lines...) Expand all Loading... |
193 core()->Connect(CreateClient()); | 198 core()->Connect(CreateClient()); |
194 core()->StartRefreshScheduler(); | 199 core()->StartRefreshScheduler(); |
195 core()->TrackRefreshDelayPref(local_state_, | 200 core()->TrackRefreshDelayPref(local_state_, |
196 prefs::kDevicePolicyRefreshRate); | 201 prefs::kDevicePolicyRefreshRate); |
197 attestation_policy_observer_.reset( | 202 attestation_policy_observer_.reset( |
198 new chromeos::attestation::AttestationPolicyObserver(client())); | 203 new chromeos::attestation::AttestationPolicyObserver(client())); |
199 } | 204 } |
200 } | 205 } |
201 | 206 |
202 } // namespace policy | 207 } // namespace policy |
OLD | NEW |