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

Side by Side Diff: chrome/browser/ui/toolbar/app_menu_model.cc

Issue 2140963002: Added default implementations of GetAcceleratorForCommandId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@acceleratorprovider-const
Patch Set: Rebase. 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/app_menu_model.h ('k') | chrome/browser/ui/toolbar/media_router_contextual_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698