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

Unified Diff: ash/system/power/power_status_view.cc

Issue 10535118: Work around the crOS battery time reporting issue in ash tray battery UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/power/power_status_view.cc
diff --git a/ash/system/power/power_status_view.cc b/ash/system/power/power_status_view.cc
index cd47f71696e0b6c7ce17ad4fbecfb2e2e74d55f9..05f318b219ef53770062f5d0fc6e9af2bd643e5c 100644
--- a/ash/system/power/power_status_view.cc
+++ b/ash/system/power/power_status_view.cc
@@ -87,8 +87,14 @@ void PowerStatusView::UpdateTextForDefaultView() {
int hour = 0;
int min = 0;
if (!supply_status_.is_calculating_battery_time) {
+ // TODO(jennyz): Due to crosbug.com/31633, averaged_battery_time_to_empty
+ // from PowerSupplyStatus object can contain garbage data for the first
+ // call in a crOS session. Until this bug is fixed, use
+ // supply_status_.battery_seconds_to_empty to render battery time.
+ // Change back to use averaged_battery_time_to_empty to display in UI
+ // once crosbug.com/31633 is fixed.
base::TimeDelta time = base::TimeDelta::FromSeconds(
- supply_status_.averaged_battery_time_to_empty);
+ supply_status_.battery_seconds_to_empty);
sadrul 2012/06/11 21:43:15 Interesting. Just the seconds_to_empty is garbage,
hour = time.InHours();
min = (time - base::TimeDelta::FromHours(hour)).InMinutes();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698