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/policy/device_status_collector.h" | 5 #include "chrome/browser/policy/device_status_collector.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/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 GetVersionInfo(request); | 361 GetVersionInfo(request); |
362 | 362 |
363 if (report_boot_mode_) | 363 if (report_boot_mode_) |
364 GetBootMode(request); | 364 GetBootMode(request); |
365 | 365 |
366 if (report_location_) | 366 if (report_location_) |
367 GetLocation(request); | 367 GetLocation(request); |
368 } | 368 } |
369 | 369 |
370 void DeviceStatusCollector::OnOSVersion(VersionLoader::Handle handle, | 370 void DeviceStatusCollector::OnOSVersion(VersionLoader::Handle handle, |
371 std::string version) { | 371 const std::string& version) { |
372 os_version_ = version; | 372 os_version_ = version; |
373 } | 373 } |
374 | 374 |
375 void DeviceStatusCollector::OnOSFirmware(VersionLoader::Handle handle, | 375 void DeviceStatusCollector::OnOSFirmware(VersionLoader::Handle handle, |
376 std::string version) { | 376 const std::string& version) { |
377 firmware_version_ = version; | 377 firmware_version_ = version; |
378 } | 378 } |
379 | 379 |
380 void DeviceStatusCollector::Observe( | 380 void DeviceStatusCollector::Observe( |
381 int type, | 381 int type, |
382 const content::NotificationSource& source, | 382 const content::NotificationSource& source, |
383 const content::NotificationDetails& details) { | 383 const content::NotificationDetails& details) { |
384 if (type == chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED) | 384 if (type == chrome::NOTIFICATION_SYSTEM_SETTING_CHANGED) |
385 UpdateReportingSettings(); | 385 UpdateReportingSettings(); |
386 else | 386 else |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 location.SetDouble(kSpeed, position.speed); | 436 location.SetDouble(kSpeed, position.speed); |
437 location.SetString(kTimestamp, | 437 location.SetString(kTimestamp, |
438 base::Int64ToString(position.timestamp.ToInternalValue())); | 438 base::Int64ToString(position.timestamp.ToInternalValue())); |
439 local_state_->Set(prefs::kDeviceLocation, location); | 439 local_state_->Set(prefs::kDeviceLocation, location); |
440 } | 440 } |
441 | 441 |
442 ScheduleGeolocationUpdateRequest(); | 442 ScheduleGeolocationUpdateRequest(); |
443 } | 443 } |
444 | 444 |
445 } // namespace policy | 445 } // namespace policy |
OLD | NEW |