OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/toolbar/app_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/app_menu_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/debug/debugging_flags.h" | 11 #include "base/debug/debugging_flags.h" |
12 #include "base/debug/profiler.h" | 12 #include "base/debug/profiler.h" |
| 13 #include "base/i18n/number_formatting.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
15 #include "base/strings/string_number_conversions.h" | |
16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "chrome/app/chrome_command_ids.h" | 19 #include "chrome/app/chrome_command_ids.h" |
20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
21 #include "chrome/browser/defaults.h" | 21 #include "chrome/browser/defaults.h" |
22 #include "chrome/browser/extensions/extension_util.h" | 22 #include "chrome/browser/extensions/extension_util.h" |
23 #include "chrome/browser/media/router/media_router_feature.h" | 23 #include "chrome/browser/media/router/media_router_feature.h" |
24 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 24 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 } | 933 } |
934 | 934 |
935 void AppMenuModel::UpdateZoomControls() { | 935 void AppMenuModel::UpdateZoomControls() { |
936 int zoom_percent = 100; | 936 int zoom_percent = 100; |
937 if (browser_->tab_strip_model() && | 937 if (browser_->tab_strip_model() && |
938 browser_->tab_strip_model()->GetActiveWebContents()) { | 938 browser_->tab_strip_model()->GetActiveWebContents()) { |
939 zoom_percent = ui_zoom::ZoomController::FromWebContents( | 939 zoom_percent = ui_zoom::ZoomController::FromWebContents( |
940 browser_->tab_strip_model()->GetActiveWebContents()) | 940 browser_->tab_strip_model()->GetActiveWebContents()) |
941 ->GetZoomPercent(); | 941 ->GetZoomPercent(); |
942 } | 942 } |
943 zoom_label_ = l10n_util::GetStringFUTF16( | 943 zoom_label_ = base::FormatPercent(zoom_percent); |
944 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | |
945 } | 944 } |
946 | 945 |
947 void AppMenuModel::OnZoomLevelChanged( | 946 void AppMenuModel::OnZoomLevelChanged( |
948 const content::HostZoomMap::ZoomLevelChange& change) { | 947 const content::HostZoomMap::ZoomLevelChange& change) { |
949 UpdateZoomControls(); | 948 UpdateZoomControls(); |
950 } | 949 } |
OLD | NEW |