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

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

Issue 10010037: ash: Show 'calculating' when the battery time is still being computed, instead of showing incorrec… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « ash/ash_strings.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/power/tray_power.cc
diff --git a/ash/system/power/tray_power.cc b/ash/system/power/tray_power.cc
index 8419dbca7f70c155ba1b5eaf72286fe316bed979..df895d131dbdf1814f52c1e7d1819bfb792c34b5 100644
--- a/ash/system/power/tray_power.cc
+++ b/ash/system/power/tray_power.cc
@@ -121,13 +121,21 @@ class PowerPopupView : public views::Label {
private:
void UpdateText() {
+ if (supply_status_.is_calculating_battery_time) {
+ SetText(l10n_util::GetStringFUTF16(supply_status_.line_power_on ?
+ IDS_ASH_STATUS_TRAY_BATTERY_CALCULATING_ON :
+ IDS_ASH_STATUS_TRAY_BATTERY_CALCULATING_OFF,
+ base::IntToString16(
+ static_cast<int>(supply_status_.battery_percentage))));
+ return;
+ }
+
base::TimeDelta time = base::TimeDelta::FromSeconds(
supply_status_.line_power_on ?
supply_status_.battery_seconds_to_full :
supply_status_.battery_seconds_to_empty);
int hour = time.InHours();
int min = (time - base::TimeDelta::FromHours(hour)).InMinutes();
- ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
if (hour || min) {
SetText(l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_BATTERY_STATUS,
base::IntToString16(
@@ -136,7 +144,8 @@ class PowerPopupView : public views::Label {
base::IntToString16(min)));
} else {
if (supply_status_.line_power_on) {
- SetText(bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_BATTERY_FULL));
+ SetText(ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
+ IDS_ASH_STATUS_TRAY_BATTERY_FULL));
} else {
// Completely discharged? ... ha?
SetText(string16());
« no previous file with comments | « ash/ash_strings.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698