summaryrefslogtreecommitdiffstats
path: root/ash/system
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-06 19:35:32 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-06 19:35:32 +0000
commit2781409defa7484f927ffe302c70cebbf7967134 (patch)
tree943afcd2fbda9b5b05d04276c19d0d2d28451a67 /ash/system
parentf5fc8ce3401b601e8195dca5a2c05c65ad476bea (diff)
downloadchromium_src-2781409defa7484f927ffe302c70cebbf7967134.zip
chromium_src-2781409defa7484f927ffe302c70cebbf7967134.tar.gz
chromium_src-2781409defa7484f927ffe302c70cebbf7967134.tar.bz2
Adding extraction of is_calculating_battery_time field from protobuf
This CL adds in extracting the value from the incomming protobuf and storing it in an instance of PowerSupplyStatus. BUG=chromium-os:28881 TEST=Confirmed that build still worked. Review URL: https://chromiumcodereview.appspot.com/9977005 Patch from Ryan Harrison <rharrison@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131166 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system')
-rw-r--r--ash/system/power/power_supply_status.cc7
-rw-r--r--ash/system/power/power_supply_status.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/ash/system/power/power_supply_status.cc b/ash/system/power/power_supply_status.cc
index 79cfa86..1f13170 100644
--- a/ash/system/power/power_supply_status.cc
+++ b/ash/system/power/power_supply_status.cc
@@ -16,8 +16,8 @@ PowerSupplyStatus::PowerSupplyStatus()
battery_is_full(false),
battery_seconds_to_empty(0),
battery_seconds_to_full(0),
- battery_percentage(0) {
-}
+ battery_percentage(0),
+ is_calculating_battery_time(false) {}
std::string PowerSupplyStatus::ToString() const {
std::string result;
@@ -39,6 +39,9 @@ std::string PowerSupplyStatus::ToString() const {
base::StringAppendF(&result,
"battery_seconds_to_full = %"PRId64" ",
battery_seconds_to_full);
+ base::StringAppendF(&result,
+ "is_calculating_battery_time = %s ",
+ is_calculating_battery_time ? "true" : "false");
return result;
}
#endif // !defined(OS_CHROMEOS)
diff --git a/ash/system/power/power_supply_status.h b/ash/system/power/power_supply_status.h
index 03d70a5..f759ac1 100644
--- a/ash/system/power/power_supply_status.h
+++ b/ash/system/power/power_supply_status.h
@@ -32,6 +32,8 @@ struct ASH_EXPORT PowerSupplyStatus {
double battery_percentage;
+ bool is_calculating_battery_time;
+
PowerSupplyStatus();
std::string ToString() const;
};