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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // TODO(bartfab): Remove this once crbug.com/125931 is addressed and a proper | 45 // TODO(bartfab): Remove this once crbug.com/125931 is addressed and a proper |
46 // way to mock geolocation exists. | 46 // way to mock geolocation exists. |
47 typedef void(*LocationUpdateRequester)( | 47 typedef void(*LocationUpdateRequester)( |
48 const content::GeolocationUpdateCallback& callback); | 48 const content::GeolocationUpdateCallback& callback); |
49 | 49 |
50 DeviceStatusCollector(PrefService* local_state, | 50 DeviceStatusCollector(PrefService* local_state, |
51 chromeos::system::StatisticsProvider* provider, | 51 chromeos::system::StatisticsProvider* provider, |
52 LocationUpdateRequester location_update_requester); | 52 LocationUpdateRequester location_update_requester); |
53 virtual ~DeviceStatusCollector(); | 53 virtual ~DeviceStatusCollector(); |
54 | 54 |
| 55 // Initializes the collector, making it start to observe setting updates |
| 56 // and schedule the next status collection time. |
| 57 void Init(); |
| 58 |
55 void GetStatus(enterprise_management::DeviceStatusReportRequest* request); | 59 void GetStatus(enterprise_management::DeviceStatusReportRequest* request); |
56 | 60 |
57 static void RegisterPrefs(PrefService* local_state); | 61 static void RegisterPrefs(PrefService* local_state); |
58 | 62 |
59 // How often, in seconds, to poll to see if the user is idle. | 63 // How often, in seconds, to poll to see if the user is idle. |
60 static const unsigned int kIdlePollIntervalSeconds = 30; | 64 static const unsigned int kIdlePollIntervalSeconds = 30; |
61 | 65 |
62 protected: | 66 protected: |
63 // Check whether the user has been idle for a certain period of time. | 67 // Check whether the user has been idle for a certain period of time. |
64 virtual void CheckIdleState(); | 68 virtual void CheckIdleState(); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 bool report_activity_times_; | 154 bool report_activity_times_; |
151 bool report_boot_mode_; | 155 bool report_boot_mode_; |
152 bool report_location_; | 156 bool report_location_; |
153 | 157 |
154 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); | 158 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); |
155 }; | 159 }; |
156 | 160 |
157 } // namespace policy | 161 } // namespace policy |
158 | 162 |
159 #endif // CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 163 #endif // CHROME_BROWSER_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
OLD | NEW |