OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROMEOS_POWER_POWER_DATA_COLLECTOR_H_ | 5 #ifndef CHROMEOS_POWER_POWER_DATA_COLLECTOR_H_ |
6 #define CHROMEOS_POWER_POWER_DATA_COLLECTOR_H_ | 6 #define CHROMEOS_POWER_POWER_DATA_COLLECTOR_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 PowerSupplySnapshot(); | 31 PowerSupplySnapshot(); |
32 | 32 |
33 // Time when the snapshot was captured. | 33 // Time when the snapshot was captured. |
34 base::TimeTicks time; | 34 base::TimeTicks time; |
35 | 35 |
36 // True if connected to external power at the time of the snapshot. | 36 // True if connected to external power at the time of the snapshot. |
37 bool external_power; | 37 bool external_power; |
38 | 38 |
39 // The battery charge as a percentage of full charge in range [0.0, 100.00]. | 39 // The battery charge as a percentage of full charge in range [0.0, 100.00]. |
40 double battery_percent; | 40 double battery_percent; |
| 41 |
| 42 // The battery discharge rate in W. Positive if the battery is being |
| 43 // discharged and negative if it's being charged. |
| 44 double battery_discharge_rate; |
41 }; | 45 }; |
42 | 46 |
43 const std::deque<PowerSupplySnapshot>& power_supply_data() const { | 47 const std::deque<PowerSupplySnapshot>& power_supply_data() const { |
44 return power_supply_data_; | 48 return power_supply_data_; |
45 } | 49 } |
46 | 50 |
47 // Can be called only after DBusThreadManager is initialized. | 51 // Can be called only after DBusThreadManager is initialized. |
48 static void Initialize(); | 52 static void Initialize(); |
49 | 53 |
50 // Can be called only if initialized via Initialize, and before | 54 // Can be called only if initialized via Initialize, and before |
(...skipping 23 matching lines...) Expand all Loading... |
74 void AddSnapshot(const PowerSupplySnapshot& snapshot); | 78 void AddSnapshot(const PowerSupplySnapshot& snapshot); |
75 | 79 |
76 std::deque<PowerSupplySnapshot> power_supply_data_; | 80 std::deque<PowerSupplySnapshot> power_supply_data_; |
77 | 81 |
78 DISALLOW_COPY_AND_ASSIGN(PowerDataCollector); | 82 DISALLOW_COPY_AND_ASSIGN(PowerDataCollector); |
79 }; | 83 }; |
80 | 84 |
81 } // namespace chromeos | 85 } // namespace chromeos |
82 | 86 |
83 #endif // CHROMEOS_POWER_POWER_DATA_COLLECTOR_H_ | 87 #endif // CHROMEOS_POWER_POWER_DATA_COLLECTOR_H_ |
OLD | NEW |