| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 protected: | 92 protected: |
| 93 // Check whether the user has been idle for a certain period of time. | 93 // Check whether the user has been idle for a certain period of time. |
| 94 virtual void CheckIdleState(); | 94 virtual void CheckIdleState(); |
| 95 | 95 |
| 96 // Used instead of base::Time::Now(), to make testing possible. | 96 // Used instead of base::Time::Now(), to make testing possible. |
| 97 virtual base::Time GetCurrentTime(); | 97 virtual base::Time GetCurrentTime(); |
| 98 | 98 |
| 99 // Callback which receives the results of the idle state check. | 99 // Callback which receives the results of the idle state check. |
| 100 void IdleStateCallback(ui::IdleState state); | 100 void IdleStateCallback(ui::IdleState state); |
| 101 | 101 |
| 102 // Returns true if the currently active session is an auto-launched |
| 103 // kiosk session (this enables functionality such as network reporting). |
| 104 // Virtual to allow mocking. |
| 105 virtual bool IsAutoLaunchedKioskSession(); |
| 106 |
| 102 // 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. |
| 103 void SampleResourceUsage(); | 108 void SampleResourceUsage(); |
| 104 | 109 |
| 105 // 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 |
| 106 // can be mocked. | 111 // can be mocked. |
| 107 virtual std::vector<double> GetPerProcessCPUUsage(); | 112 virtual std::vector<double> GetPerProcessCPUUsage(); |
| 108 | 113 |
| 109 // The number of days in the past to store device activity. | 114 // The number of days in the past to store device activity. |
| 110 // This is kept in case device status uploads fail for a number of days. | 115 // This is kept in case device status uploads fail for a number of days. |
| 111 unsigned int max_stored_past_activity_days_; | 116 unsigned int max_stored_past_activity_days_; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 hardware_status_subscription_; | 252 hardware_status_subscription_; |
| 248 | 253 |
| 249 base::WeakPtrFactory<DeviceStatusCollector> weak_factory_; | 254 base::WeakPtrFactory<DeviceStatusCollector> weak_factory_; |
| 250 | 255 |
| 251 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); | 256 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); |
| 252 }; | 257 }; |
| 253 | 258 |
| 254 } // namespace policy | 259 } // namespace policy |
| 255 | 260 |
| 256 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 261 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
| OLD | NEW |