summaryrefslogtreecommitdiffstats
path: root/ash/system/power
diff options
context:
space:
mode:
authorrharrison@chromium.org <rharrison@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-19 23:08:34 +0000
committerrharrison@chromium.org <rharrison@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-19 23:08:34 +0000
commit29e590e75818a5f41df2109222405294eade398c (patch)
treed3a268b3317c844087a68d9b5f77f318927d5896 /ash/system/power
parent7042b688fe403f1aa63e0ee5c44f63f4130e0392 (diff)
downloadchromium_src-29e590e75818a5f41df2109222405294eade398c.zip
chromium_src-29e590e75818a5f41df2109222405294eade398c.tar.gz
chromium_src-29e590e75818a5f41df2109222405294eade398c.tar.bz2
Extract the averaged time values from incomming protobuf
This CL adds in extracting the averaged battery time values from the incomming protobuf and storing it in an instance of PowerSupplyStatus. BUG=chromium-os:23647 TEST=Confirmed that build still worked. Review URL: http://codereview.chromium.org/10108028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133080 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/power')
-rw-r--r--ash/system/power/power_supply_status.cc8
-rw-r--r--ash/system/power/power_supply_status.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/ash/system/power/power_supply_status.cc b/ash/system/power/power_supply_status.cc
index 1f13170..a61b3a5 100644
--- a/ash/system/power/power_supply_status.cc
+++ b/ash/system/power/power_supply_status.cc
@@ -16,6 +16,8 @@ PowerSupplyStatus::PowerSupplyStatus()
battery_is_full(false),
battery_seconds_to_empty(0),
battery_seconds_to_full(0),
+ averaged_battery_time_to_empty(0),
+ averaged_battery_time_to_full(0),
battery_percentage(0),
is_calculating_battery_time(false) {}
@@ -40,6 +42,12 @@ std::string PowerSupplyStatus::ToString() const {
"battery_seconds_to_full = %"PRId64" ",
battery_seconds_to_full);
base::StringAppendF(&result,
+ "averaged_battery_time_to_empty = %"PRId64" ",
+ averaged_battery_time_to_empty);
+ base::StringAppendF(&result,
+ "averaged_battery_time_to_full = %"PRId64" ",
+ averaged_battery_time_to_full);
+ base::StringAppendF(&result,
"is_calculating_battery_time = %s ",
is_calculating_battery_time ? "true" : "false");
return result;
diff --git a/ash/system/power/power_supply_status.h b/ash/system/power/power_supply_status.h
index f759ac1..e1fe066 100644
--- a/ash/system/power/power_supply_status.h
+++ b/ash/system/power/power_supply_status.h
@@ -29,6 +29,8 @@ struct ASH_EXPORT PowerSupplyStatus {
// Time in seconds until the battery is empty or full, 0 for unknown.
int64 battery_seconds_to_empty;
int64 battery_seconds_to_full;
+ int64 averaged_battery_time_to_empty;
+ int64 averaged_battery_time_to_full;
double battery_percentage;