| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 chromeos::system::StatisticsProvider* provider = | 225 chromeos::system::StatisticsProvider* provider = |
| 226 chromeos::system::StatisticsProvider::GetInstance(); | 226 chromeos::system::StatisticsProvider::GetInstance(); |
| 227 for (size_t i = 0; i < arraysize(kMachineInfoSerialNumberKeys); i++) { | 227 for (size_t i = 0; i < arraysize(kMachineInfoSerialNumberKeys); i++) { |
| 228 if (provider->HasMachineStatistic(kMachineInfoSerialNumberKeys[i]) && | 228 if (provider->HasMachineStatistic(kMachineInfoSerialNumberKeys[i]) && |
| 229 provider->GetMachineStatistic(kMachineInfoSerialNumberKeys[i], | 229 provider->GetMachineStatistic(kMachineInfoSerialNumberKeys[i], |
| 230 &machine_id) && | 230 &machine_id) && |
| 231 !machine_id.empty()) { | 231 !machine_id.empty()) { |
| 232 break; | 232 break; |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 | |
| 236 if (machine_id.empty()) { | |
| 237 LOG(WARNING) << "Failed to get machine id. This is only an error if the " | |
| 238 "device has not yet been enrolled or claimed by a local " | |
| 239 "user."; | |
| 240 } | |
| 241 | |
| 242 return machine_id; | 235 return machine_id; |
| 243 } | 236 } |
| 244 | 237 |
| 245 // static | 238 // static |
| 246 std::string DeviceCloudPolicyManagerChromeOS::GetMachineModel() { | 239 std::string DeviceCloudPolicyManagerChromeOS::GetMachineModel() { |
| 247 return GetMachineStatistic(chromeos::system::kHardwareClassKey); | 240 return GetMachineStatistic(chromeos::system::kHardwareClassKey); |
| 248 } | 241 } |
| 249 | 242 |
| 250 // static | 243 // static |
| 251 ZeroTouchEnrollmentMode | 244 ZeroTouchEnrollmentMode |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 base::MakeUnique<DeviceStatusCollector>( | 372 base::MakeUnique<DeviceStatusCollector>( |
| 380 local_state_, chromeos::system::StatisticsProvider::GetInstance(), | 373 local_state_, chromeos::system::StatisticsProvider::GetInstance(), |
| 381 DeviceStatusCollector::LocationUpdateRequester(), | 374 DeviceStatusCollector::LocationUpdateRequester(), |
| 382 DeviceStatusCollector::VolumeInfoFetcher(), | 375 DeviceStatusCollector::VolumeInfoFetcher(), |
| 383 DeviceStatusCollector::CPUStatisticsFetcher(), | 376 DeviceStatusCollector::CPUStatisticsFetcher(), |
| 384 DeviceStatusCollector::CPUTempFetcher()), | 377 DeviceStatusCollector::CPUTempFetcher()), |
| 385 task_runner_)); | 378 task_runner_)); |
| 386 } | 379 } |
| 387 | 380 |
| 388 } // namespace policy | 381 } // namespace policy |
| OLD | NEW |