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

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

Issue 2745233002: base: Make TimeDurationFormat* report failures. (Closed)
Patch Set: merge Created 3 years, 9 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/common/system/chromeos/power/battery_notification.cc ('k') | base/i18n/time_formatting.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/power/power_status_view.cc
diff --git a/ash/common/system/chromeos/power/power_status_view.cc b/ash/common/system/chromeos/power/power_status_view.cc
index ade3d0b021a93de634a267cd9a47af7e350aad20..8e8d3d0b5528c58446afb47981abcc63ad25eb72 100644
--- a/ash/common/system/chromeos/power/power_status_view.cc
+++ b/ash/common/system/chromeos/power/power_status_view.cc
@@ -124,11 +124,15 @@ void PowerStatusView::UpdateText() {
: status.GetBatteryTimeToEmpty();
if (PowerStatus::ShouldDisplayBatteryTime(time) &&
!status.IsBatteryDischargingOnLinePower()) {
+ base::string16 duration;
+ if (!base::TimeDurationFormat(time, base::DURATION_WIDTH_NUMERIC,
+ &duration))
+ LOG(ERROR) << "Failed to format duration " << time.ToInternalValue();
battery_time_status = l10n_util::GetStringFUTF16(
status.IsBatteryCharging()
? IDS_ASH_STATUS_TRAY_BATTERY_TIME_UNTIL_FULL_SHORT
: IDS_ASH_STATUS_TRAY_BATTERY_TIME_LEFT_SHORT,
- TimeDurationFormat(time, base::DURATION_WIDTH_NUMERIC));
+ duration);
}
}
}
« no previous file with comments | « ash/common/system/chromeos/power/battery_notification.cc ('k') | base/i18n/time_formatting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698