Index: ash/common/system/chromeos/power/battery_notification.cc |
diff --git a/ash/common/system/chromeos/power/battery_notification.cc b/ash/common/system/chromeos/power/battery_notification.cc |
index 23395ff2a312c8c2930f8ca705fb7abf6e6a5402..e817a6bcf368b70c0a3e0f5349da5950a26e0e68 100644 |
--- a/ash/common/system/chromeos/power/battery_notification.cc |
+++ b/ash/common/system/chromeos/power/battery_notification.cc |
@@ -62,9 +62,11 @@ std::unique_ptr<Notification> CreateNotification( |
} else if (PowerStatus::ShouldDisplayBatteryTime(time) && |
!status.IsBatteryDischargingOnLinePower()) { |
if (status.IsBatteryCharging()) { |
+ base::string16 duration; |
+ if (!TimeDurationFormat(time, base::DURATION_WIDTH_NARROW, &duration)) |
+ LOG(ERROR) << "Failed to format duration " << time.ToInternalValue(); |
time_message = l10n_util::GetStringFUTF16( |
- IDS_ASH_STATUS_TRAY_BATTERY_TIME_UNTIL_FULL, |
- TimeDurationFormat(time, base::DURATION_WIDTH_NARROW)); |
+ IDS_ASH_STATUS_TRAY_BATTERY_TIME_UNTIL_FULL, duration); |
} else { |
// This is a low battery warning prompting the user in minutes. |
time_message = ui::TimeFormat::Simple(ui::TimeFormat::FORMAT_REMAINING, |