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

Unified Diff: ash/system/chromeos/power/battery_notification.cc

Issue 1951493002: Fix i18n number formats in tray power displays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use MessageFormatter in power_status_view.cc Created 4 years, 7 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
Index: ash/system/chromeos/power/battery_notification.cc
diff --git a/ash/system/chromeos/power/battery_notification.cc b/ash/system/chromeos/power/battery_notification.cc
index d35868bf1ef6d7bf5fa4ac61c2193f38bfa78996..551942576db1a9b85d0ba5c0df7085694b590171 100644
--- a/ash/system/chromeos/power/battery_notification.cc
+++ b/ash/system/chromeos/power/battery_notification.cc
@@ -6,7 +6,7 @@
#include "ash/system/chromeos/power/power_status.h"
#include "ash/system/system_notifier.h"
-#include "base/strings/string_number_conversions.h"
+#include "base/i18n/number_formatting.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "grit/ash_resources.h"
@@ -49,7 +49,7 @@ std::unique_ptr<Notification> CreateNotification(
base::string16 message = l10n_util::GetStringFUTF16(
IDS_ASH_STATUS_TRAY_BATTERY_PERCENT,
- base::IntToString16(status.GetRoundedBatteryPercent()));
+ base::FormatNumber(status.GetRoundedBatteryPercent()));
const base::TimeDelta time = status.IsBatteryCharging()
? status.GetBatteryTimeToFull()
@@ -64,8 +64,8 @@ std::unique_ptr<Notification> CreateNotification(
PowerStatus::SplitTimeIntoHoursAndMinutes(time, &hour, &min);
if (status.IsBatteryCharging()) {
time_message = l10n_util::GetStringFUTF16(
- IDS_ASH_STATUS_TRAY_BATTERY_TIME_UNTIL_FULL,
- base::IntToString16(hour), base::IntToString16(min));
+ IDS_ASH_STATUS_TRAY_BATTERY_TIME_UNTIL_FULL, base::FormatNumber(hour),
+ base::FormatNumber(min));
} else {
// This is a low battery warning prompting the user in minutes.
time_message = ui::TimeFormat::Simple(

Powered by Google App Engine
This is Rietveld 408576698