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_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 // Virtual to allow mocking. | 104 // Virtual to allow mocking. |
105 virtual bool IsAutoLaunchedKioskSession(); | 105 virtual bool IsAutoLaunchedKioskSession(); |
106 | 106 |
107 // Samples the current CPU and RAM usage and updates our cache of samples. | 107 // Samples the current CPU and RAM usage and updates our cache of samples. |
108 void SampleResourceUsage(); | 108 void SampleResourceUsage(); |
109 | 109 |
110 // Returns the percentage of total CPU that each process uses. Virtual so it | 110 // Returns the percentage of total CPU that each process uses. Virtual so it |
111 // can be mocked. | 111 // can be mocked. |
112 virtual std::vector<double> GetPerProcessCPUUsage(); | 112 virtual std::vector<double> GetPerProcessCPUUsage(); |
113 | 113 |
114 // Gets the version of the passed app. Virtual to allow mocking. | |
115 virtual std::string GetAppVersion(std::string app_id); | |
bartfab (slow)
2015/02/11 17:28:43
Nit: Pass |app_id| by const ref.
Andrew T Wilson (Slow)
2015/02/12 15:15:39
Done.
| |
116 | |
114 // The number of days in the past to store device activity. | 117 // The number of days in the past to store device activity. |
115 // This is kept in case device status uploads fail for a number of days. | 118 // This is kept in case device status uploads fail for a number of days. |
116 unsigned int max_stored_past_activity_days_; | 119 unsigned int max_stored_past_activity_days_; |
117 | 120 |
118 // The number of days in the future to store device activity. | 121 // The number of days in the future to store device activity. |
119 // When changing the system time and/or timezones, it's possible to record | 122 // When changing the system time and/or timezones, it's possible to record |
120 // activity time that is slightly in the future. | 123 // activity time that is slightly in the future. |
121 unsigned int max_stored_future_activity_days_; | 124 unsigned int max_stored_future_activity_days_; |
122 | 125 |
123 private: | 126 private: |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 geolocation_subscription_; | 231 geolocation_subscription_; |
229 | 232 |
230 // Cached values of the reporting settings from the device policy. | 233 // Cached values of the reporting settings from the device policy. |
231 bool report_version_info_; | 234 bool report_version_info_; |
232 bool report_activity_times_; | 235 bool report_activity_times_; |
233 bool report_boot_mode_; | 236 bool report_boot_mode_; |
234 bool report_location_; | 237 bool report_location_; |
235 bool report_network_interfaces_; | 238 bool report_network_interfaces_; |
236 bool report_users_; | 239 bool report_users_; |
237 bool report_hardware_status_; | 240 bool report_hardware_status_; |
241 bool report_session_status_; | |
238 | 242 |
239 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | 243 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
240 version_info_subscription_; | 244 version_info_subscription_; |
241 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | 245 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
242 activity_times_subscription_; | 246 activity_times_subscription_; |
243 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | 247 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
244 boot_mode_subscription_; | 248 boot_mode_subscription_; |
245 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | 249 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
246 location_subscription_; | 250 location_subscription_; |
247 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | 251 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
248 network_interfaces_subscription_; | 252 network_interfaces_subscription_; |
249 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | 253 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
250 users_subscription_; | 254 users_subscription_; |
251 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | 255 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> |
252 hardware_status_subscription_; | 256 hardware_status_subscription_; |
257 scoped_ptr<chromeos::CrosSettings::ObserverSubscription> | |
258 session_status_subscription_; | |
253 | 259 |
254 base::WeakPtrFactory<DeviceStatusCollector> weak_factory_; | 260 base::WeakPtrFactory<DeviceStatusCollector> weak_factory_; |
255 | 261 |
256 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); | 262 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); |
257 }; | 263 }; |
258 | 264 |
259 } // namespace policy | 265 } // namespace policy |
260 | 266 |
261 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 267 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
OLD | NEW |