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" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 bool enabled = chrome::IsCommandEnabled(browser_, command_id); | 162 bool enabled = chrome::IsCommandEnabled(browser_, command_id); |
163 // Special handling for the contents of the Encoding submenu. On Mac OS, | 163 // Special handling for the contents of the Encoding submenu. On Mac OS, |
164 // instead of enabling/disabling the top-level menu item, the submenu's | 164 // instead of enabling/disabling the top-level menu item, the submenu's |
165 // contents get disabled, per Apple's HIG. | 165 // contents get disabled, per Apple's HIG. |
166 #if defined(OS_MACOSX) | 166 #if defined(OS_MACOSX) |
167 enabled &= chrome::IsCommandEnabled(browser_, IDC_ENCODING_MENU); | 167 enabled &= chrome::IsCommandEnabled(browser_, IDC_ENCODING_MENU); |
168 #endif | 168 #endif |
169 return enabled; | 169 return enabled; |
170 } | 170 } |
171 | 171 |
172 bool EncodingMenuModel::GetAcceleratorForCommandId( | |
173 int command_id, | |
174 ui::Accelerator* accelerator) const { | |
175 return false; | |
176 } | |
177 | |
178 void EncodingMenuModel::ExecuteCommand(int command_id, int event_flags) { | 172 void EncodingMenuModel::ExecuteCommand(int command_id, int event_flags) { |
179 chrome::ExecuteCommand(browser_, command_id); | 173 chrome::ExecuteCommand(browser_, command_id); |
180 } | 174 } |
181 | 175 |
182 //////////////////////////////////////////////////////////////////////////////// | 176 //////////////////////////////////////////////////////////////////////////////// |
183 // ZoomMenuModel | 177 // ZoomMenuModel |
184 | 178 |
185 ZoomMenuModel::ZoomMenuModel(ui::SimpleMenuModel::Delegate* delegate) | 179 ZoomMenuModel::ZoomMenuModel(ui::SimpleMenuModel::Delegate* delegate) |
186 : SimpleMenuModel(delegate) { | 180 : SimpleMenuModel(delegate) { |
187 Build(); | 181 Build(); |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 browser_->tab_strip_model()->GetActiveWebContents()) | 934 browser_->tab_strip_model()->GetActiveWebContents()) |
941 ->GetZoomPercent(); | 935 ->GetZoomPercent(); |
942 } | 936 } |
943 zoom_label_ = base::FormatPercent(zoom_percent); | 937 zoom_label_ = base::FormatPercent(zoom_percent); |
944 } | 938 } |
945 | 939 |
946 void AppMenuModel::OnZoomLevelChanged( | 940 void AppMenuModel::OnZoomLevelChanged( |
947 const content::HostZoomMap::ZoomLevelChange& change) { | 941 const content::HostZoomMap::ZoomLevelChange& change) { |
948 UpdateZoomControls(); | 942 UpdateZoomControls(); |
949 } | 943 } |
OLD | NEW |