Index: chrome/browser/ui/views/toolbar/app_menu.cc |
diff --git a/chrome/browser/ui/views/toolbar/app_menu.cc b/chrome/browser/ui/views/toolbar/app_menu.cc |
index 8e753d99a293d6c28163afd1bd20f6350bfa68ac..2143c69527e81698388577112a470f87a5dc10bc 100644 |
--- a/chrome/browser/ui/views/toolbar/app_menu.cc |
+++ b/chrome/browser/ui/views/toolbar/app_menu.cc |
@@ -10,9 +10,9 @@ |
#include <cmath> |
#include <set> |
+#include "base/i18n/number_formatting.h" |
#include "base/macros.h" |
#include "base/metrics/histogram.h" |
-#include "base/strings/string_number_conversions.h" |
#include "base/strings/utf_string_conversions.h" |
#include "build/build_config.h" |
#include "chrome/app/chrome_command_ids.h" |
@@ -526,8 +526,7 @@ class AppMenu::ZoomView : public AppMenuView { |
IDS_ZOOM_MINUS2, InMenuButtonBackground::LEFT_BUTTON, |
decrement_index, IDS_ACCNAME_ZOOM_MINUS2); |
- zoom_label_ = new Label( |
- l10n_util::GetStringFUTF16Int(IDS_ZOOM_PERCENT, 100)); |
jungshik at Google
2016/05/17 23:58:43
Please, drop IDS_ZOOM_PERCENT from a grd file.
Greg Levin
2016/05/18 21:33:44
Done.
|
+ zoom_label_ = new Label(base::FormatPercent(100)); |
zoom_label_->SetAutoColorReadabilityEnabled(false); |
zoom_label_->SetHorizontalAlignment(gfx::ALIGN_RIGHT); |
@@ -671,9 +670,7 @@ class AppMenu::ZoomView : public AppMenuView { |
decrement_button_->SetEnabled(zoom > |
selected_tab->GetMinimumZoomPercent()); |
} |
- zoom_label_->SetText( |
- l10n_util::GetStringFUTF16Int(IDS_ZOOM_PERCENT, zoom)); |
- |
+ zoom_label_->SetText(base::FormatPercent(zoom)); |
zoom_label_max_width_valid_ = false; |
} |
@@ -697,14 +694,12 @@ class AppMenu::ZoomView : public AppMenuView { |
zoom_controller->GetZoomPercent()); |
for (auto zoom : zoom_factors) { |
int w = gfx::GetStringWidth( |
- l10n_util::GetStringFUTF16Int(IDS_ZOOM_PERCENT, |
- static_cast<int>(zoom * 100 + 0.5)), |
+ base::FormatPercent(static_cast<int>(zoom * 100 + 0.5)), |
Peter Kasting
2016/05/18 02:37:25
Use std::round().
Greg Levin
2016/05/18 21:33:44
Done.
|
font_list); |
max_w = std::max(w, max_w); |
} |
} else { |
- max_w = gfx::GetStringWidth( |
- l10n_util::GetStringFUTF16Int(IDS_ZOOM_PERCENT, 100), font_list); |
+ max_w = gfx::GetStringWidth(base::FormatPercent(100), font_list); |
} |
zoom_label_max_width_ = max_w + border_width; |