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

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

Issue 2286353002: Use FormatPercent() in PowerStatusView (Closed)
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | 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 26c2baf4a340548ca97a6438746d7357371dd135..86e07ee74a5aa7b84f7434ccfc7298c1466912cd 100644
--- a/ash/common/system/chromeos/power/power_status_view.cc
+++ b/ash/common/system/chromeos/power/power_status_view.cc
@@ -9,7 +9,7 @@
#include "ash/common/system/chromeos/power/tray_power.h"
#include "ash/common/system/tray/fixed_sized_image_view.h"
#include "ash/common/system/tray/tray_constants.h"
-#include "base/i18n/message_formatter.h"
+#include "base/i18n/number_formatting.h"
#include "base/i18n/time_formatting.h"
#include "base/strings/utf_string_conversions.h"
#include "grit/ash_strings.h"
@@ -98,9 +98,7 @@ void PowerStatusView::UpdateText() {
battery_time_status =
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_BATTERY_FULL);
} else {
- battery_percentage = base::i18n::MessageFormatter::FormatWithNumberedArgs(
- base::ASCIIToUTF16("{0,number,percent}"),
- static_cast<double>(status.GetRoundedBatteryPercent()) / 100.0);
+ battery_percentage = base::FormatPercent(status.GetRoundedBatteryPercent());
if (status.IsUsbChargerConnected()) {
battery_time_status = l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_BATTERY_CHARGING_UNRELIABLE);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698