| 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_status_collector.h" | 5 #include "chrome/browser/chromeos/policy/device_status_collector.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 chrome::VersionInfo version_info; | 364 chrome::VersionInfo version_info; |
| 365 request->set_browser_version(version_info.Version()); | 365 request->set_browser_version(version_info.Version()); |
| 366 request->set_os_version(os_version_); | 366 request->set_os_version(os_version_); |
| 367 request->set_firmware_version(firmware_version_); | 367 request->set_firmware_version(firmware_version_); |
| 368 } | 368 } |
| 369 | 369 |
| 370 void DeviceStatusCollector::GetBootMode( | 370 void DeviceStatusCollector::GetBootMode( |
| 371 em::DeviceStatusReportRequest* request) { | 371 em::DeviceStatusReportRequest* request) { |
| 372 std::string dev_switch_mode; | 372 std::string dev_switch_mode; |
| 373 if (statistics_provider_->GetMachineStatistic( | 373 if (statistics_provider_->GetMachineStatistic( |
| 374 "devsw_boot", &dev_switch_mode)) { | 374 chromeos::system::kDevSwitchBootMode, &dev_switch_mode)) { |
| 375 if (dev_switch_mode == "1") | 375 if (dev_switch_mode == "1") |
| 376 request->set_boot_mode("Dev"); | 376 request->set_boot_mode("Dev"); |
| 377 else if (dev_switch_mode == "0") | 377 else if (dev_switch_mode == "0") |
| 378 request->set_boot_mode("Verified"); | 378 request->set_boot_mode("Verified"); |
| 379 } | 379 } |
| 380 } | 380 } |
| 381 | 381 |
| 382 void DeviceStatusCollector::GetLocation( | 382 void DeviceStatusCollector::GetLocation( |
| 383 em::DeviceStatusReportRequest* request) { | 383 em::DeviceStatusReportRequest* request) { |
| 384 em::DeviceLocation* location = request->mutable_device_location(); | 384 em::DeviceLocation* location = request->mutable_device_location(); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 location.SetDouble(kSpeed, position.speed); | 506 location.SetDouble(kSpeed, position.speed); |
| 507 location.SetString(kTimestamp, | 507 location.SetString(kTimestamp, |
| 508 base::Int64ToString(position.timestamp.ToInternalValue())); | 508 base::Int64ToString(position.timestamp.ToInternalValue())); |
| 509 local_state_->Set(prefs::kDeviceLocation, location); | 509 local_state_->Set(prefs::kDeviceLocation, location); |
| 510 } | 510 } |
| 511 | 511 |
| 512 ScheduleGeolocationUpdateRequest(); | 512 ScheduleGeolocationUpdateRequest(); |
| 513 } | 513 } |
| 514 | 514 |
| 515 } // namespace policy | 515 } // namespace policy |
| OLD | NEW |