Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Side by Side Diff: chromeos/power/power_data_collector.h

Issue 140663004: [chromeos] Add a battery discharge rate plot to about:power page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comment Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/chromeos/power_ui.cc ('k') | chromeos/power/power_data_collector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/power_ui.cc ('k') | chromeos/power/power_data_collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698