| 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" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 LOG(WARNING) << "Failed to get machine id."; | 216 LOG(WARNING) << "Failed to get machine id."; |
| 217 | 217 |
| 218 return machine_id; | 218 return machine_id; |
| 219 } | 219 } |
| 220 | 220 |
| 221 // static | 221 // static |
| 222 std::string DeviceCloudPolicyManagerChromeOS::GetMachineModel() { | 222 std::string DeviceCloudPolicyManagerChromeOS::GetMachineModel() { |
| 223 return GetMachineStatistic(kMachineInfoSystemHwqual); | 223 return GetMachineStatistic(kMachineInfoSystemHwqual); |
| 224 } | 224 } |
| 225 | 225 |
| 226 std::string DeviceCloudPolicyManagerChromeOS::GetRobotAccountId() { |
| 227 const enterprise_management::PolicyData* policy = device_store_->policy(); |
| 228 return policy ? policy->service_account_identity() : std::string(); |
| 229 } |
| 230 |
| 226 scoped_ptr<CloudPolicyClient> DeviceCloudPolicyManagerChromeOS::CreateClient() { | 231 scoped_ptr<CloudPolicyClient> DeviceCloudPolicyManagerChromeOS::CreateClient() { |
| 227 return make_scoped_ptr( | 232 return make_scoped_ptr( |
| 228 new CloudPolicyClient(GetMachineID(), GetMachineModel(), | 233 new CloudPolicyClient(GetMachineID(), GetMachineModel(), |
| 229 USER_AFFILIATION_NONE, | 234 USER_AFFILIATION_NONE, |
| 230 device_status_provider_.get(), | 235 device_status_provider_.get(), |
| 231 device_management_service_)); | 236 device_management_service_)); |
| 232 } | 237 } |
| 233 | 238 |
| 234 void DeviceCloudPolicyManagerChromeOS::EnrollmentCompleted( | 239 void DeviceCloudPolicyManagerChromeOS::EnrollmentCompleted( |
| 235 const EnrollmentCallback& callback, | 240 const EnrollmentCallback& callback, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 259 core()->Connect(CreateClient()); | 264 core()->Connect(CreateClient()); |
| 260 core()->StartRefreshScheduler(); | 265 core()->StartRefreshScheduler(); |
| 261 core()->TrackRefreshDelayPref(local_state_, | 266 core()->TrackRefreshDelayPref(local_state_, |
| 262 prefs::kDevicePolicyRefreshRate); | 267 prefs::kDevicePolicyRefreshRate); |
| 263 attestation_policy_observer_.reset( | 268 attestation_policy_observer_.reset( |
| 264 new chromeos::attestation::AttestationPolicyObserver(client())); | 269 new chromeos::attestation::AttestationPolicyObserver(client())); |
| 265 } | 270 } |
| 266 } | 271 } |
| 267 | 272 |
| 268 } // namespace policy | 273 } // namespace policy |
| OLD | NEW |