OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
11 #include "chrome/browser/chromeos/version_loader.h" | |
11 #include "chrome/browser/idle.h" | 12 #include "chrome/browser/idle.h" |
12 | 13 |
13 using base::Time; | 14 using base::Time; |
15 using chromeos::VersionLoader; | |
Joao da Silva
2011/12/12 14:23:04
Nit: I'd avoid this, but it's your call. I'd rathe
Patrick Dubroy
2011/12/12 15:18:01
Done.
| |
14 | 16 |
15 namespace enterprise_management { | 17 namespace enterprise_management { |
16 class DeviceStatusReportRequest; | 18 class DeviceStatusReportRequest; |
17 } | 19 } |
18 | 20 |
19 class PrefService; | 21 class PrefService; |
20 | 22 |
21 namespace policy { | 23 namespace policy { |
22 | 24 |
23 // Collects and summarizes the status of an enterprised-managed ChromeOS device. | 25 // Collects and summarizes the status of an enterprised-managed ChromeOS device. |
(...skipping 18 matching lines...) Expand all Loading... | |
42 | 44 |
43 // Callback which receives the results of the idle state check. | 45 // Callback which receives the results of the idle state check. |
44 void IdleStateCallback(IdleState state); | 46 void IdleStateCallback(IdleState state); |
45 | 47 |
46 // The maximum number of active periods timestamps to be stored. | 48 // The maximum number of active periods timestamps to be stored. |
47 unsigned int max_stored_active_periods_; | 49 unsigned int max_stored_active_periods_; |
48 | 50 |
49 private: | 51 private: |
50 void AddActivePeriod(base::Time start, base::Time end); | 52 void AddActivePeriod(base::Time start, base::Time end); |
51 | 53 |
54 // Callbacks from chromeos::VersionLoader. | |
55 void OnOSVersion(VersionLoader::Handle handle, | |
56 std::string version); | |
57 void OnOSFirmware(VersionLoader::Handle handle, | |
58 std::string version); | |
59 | |
52 // How often to poll to see if the user is idle. | 60 // How often to poll to see if the user is idle. |
53 int poll_interval_seconds_; | 61 int poll_interval_seconds_; |
54 | 62 |
55 PrefService* local_state_; | 63 PrefService* local_state_; |
56 | 64 |
57 // The last time an idle state check was performed. | 65 // The last time an idle state check was performed. |
58 Time last_idle_check_; | 66 Time last_idle_check_; |
59 | 67 |
60 // The idle state the last time it was checked. | 68 // The idle state the last time it was checked. |
61 IdleState last_idle_state_; | 69 IdleState last_idle_state_; |
62 | 70 |
63 base::RepeatingTimer<DeviceStatusCollector> timer_; | 71 base::RepeatingTimer<DeviceStatusCollector> timer_; |
64 | 72 |
73 VersionLoader version_loader_; | |
74 CancelableRequestConsumer consumer_; | |
75 | |
76 std::string os_version_; | |
77 std::string firmware_version_; | |
78 | |
65 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); | 79 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); |
66 }; | 80 }; |
67 | 81 |
68 } // namespace policy | 82 } // namespace policy |
69 | 83 |
70 #endif // CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 84 #endif // CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
OLD | NEW |