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 0a0f5541e6af22e7c1aefd5462c6a1d6f8e05954..3e918b98496f4f9c1f728cc96a27d14a1732124a 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); |
} |
} |
} |