| 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 #ifndef CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 5 #ifndef CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
| 6 #define CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 6 #define CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/timer.h" | 10 #include "base/timer.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 void AddActivePeriod(base::Time start, base::Time end); | 56 void AddActivePeriod(base::Time start, base::Time end); |
| 57 | 57 |
| 58 // Callbacks from chromeos::VersionLoader. | 58 // Callbacks from chromeos::VersionLoader. |
| 59 void OnOSVersion(chromeos::VersionLoader::Handle handle, | 59 void OnOSVersion(chromeos::VersionLoader::Handle handle, |
| 60 std::string version); | 60 std::string version); |
| 61 void OnOSFirmware(chromeos::VersionLoader::Handle handle, | 61 void OnOSFirmware(chromeos::VersionLoader::Handle handle, |
| 62 std::string version); | 62 std::string version); |
| 63 | 63 |
| 64 // Helpers for the various portions of the status. |
| 65 void GetActivityTimes( |
| 66 enterprise_management::DeviceStatusReportRequest* request); |
| 67 void GetVersionInfo( |
| 68 enterprise_management::DeviceStatusReportRequest* request); |
| 69 void GetBootMode( |
| 70 enterprise_management::DeviceStatusReportRequest* request); |
| 71 |
| 64 // How often to poll to see if the user is idle. | 72 // How often to poll to see if the user is idle. |
| 65 int poll_interval_seconds_; | 73 int poll_interval_seconds_; |
| 66 | 74 |
| 67 PrefService* local_state_; | 75 PrefService* local_state_; |
| 68 | 76 |
| 69 // The last time an idle state check was performed. | 77 // The last time an idle state check was performed. |
| 70 base::Time last_idle_check_; | 78 base::Time last_idle_check_; |
| 71 | 79 |
| 72 // The idle state the last time it was checked. | 80 // The idle state the last time it was checked. |
| 73 IdleState last_idle_state_; | 81 IdleState last_idle_state_; |
| 74 | 82 |
| 75 base::RepeatingTimer<DeviceStatusCollector> timer_; | 83 base::RepeatingTimer<DeviceStatusCollector> timer_; |
| 76 | 84 |
| 77 chromeos::VersionLoader version_loader_; | 85 chromeos::VersionLoader version_loader_; |
| 78 CancelableRequestConsumer consumer_; | 86 CancelableRequestConsumer consumer_; |
| 79 | 87 |
| 80 std::string os_version_; | 88 std::string os_version_; |
| 81 std::string firmware_version_; | 89 std::string firmware_version_; |
| 82 | 90 |
| 83 chromeos::system::StatisticsProvider* statistics_provider_; | 91 chromeos::system::StatisticsProvider* statistics_provider_; |
| 84 | 92 |
| 85 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); | 93 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); |
| 86 }; | 94 }; |
| 87 | 95 |
| 88 } // namespace policy | 96 } // namespace policy |
| 89 | 97 |
| 90 #endif // CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 98 #endif // CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
| OLD | NEW |