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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_command_handler.mm

Issue 1417423003: chrome: Rename WrenchMenuModel to AppMenuModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #import "chrome/browser/ui/cocoa/browser_window_command_handler.h" 5 #import "chrome/browser/ui/cocoa/browser_window_command_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/foundation_util.h" 8 #import "base/mac/foundation_util.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #import "chrome/browser/app_controller_mac.h" 10 #import "chrome/browser/app_controller_mac.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 Profile* original_profile = browser->profile()->GetOriginalProfile(); 171 Profile* original_profile = browser->profile()->GetOriginalProfile();
172 [AppController updateSigninItem:item 172 [AppController updateSigninItem:item
173 shouldShow:enable 173 shouldShow:enable
174 currentProfile:original_profile]; 174 currentProfile:original_profile];
175 break; 175 break;
176 } 176 }
177 case IDC_BOOKMARK_PAGE: { 177 case IDC_BOOKMARK_PAGE: {
178 // Extensions have the ability to hide the bookmark page menu item. 178 // Extensions have the ability to hide the bookmark page menu item.
179 // This only affects the bookmark page menu item under the main menu. 179 // This only affects the bookmark page menu item under the main menu.
180 // The bookmark page menu item under the wrench menu has its 180 // The bookmark page menu item under the wrench menu has its
181 // visibility controlled by WrenchMenuModel. 181 // visibility controlled by AppMenuModel.
182 bool shouldHide = 182 bool shouldHide =
183 chrome::ShouldRemoveBookmarkThisPageUI(browser->profile()); 183 chrome::ShouldRemoveBookmarkThisPageUI(browser->profile());
184 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item); 184 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item);
185 [menuItem setHidden:shouldHide]; 185 [menuItem setHidden:shouldHide];
186 break; 186 break;
187 } 187 }
188 case IDC_BOOKMARK_ALL_TABS: { 188 case IDC_BOOKMARK_ALL_TABS: {
189 // Extensions have the ability to hide the bookmark all tabs menu 189 // Extensions have the ability to hide the bookmark all tabs menu
190 // item. This only affects the bookmark page menu item under the main 190 // item. This only affects the bookmark page menu item under the main
191 // menu. The bookmark page menu item under the wrench menu has its 191 // menu. The bookmark page menu item under the wrench menu has its
192 // visibility controlled by WrenchMenuModel. 192 // visibility controlled by AppMenuModel.
193 bool shouldHide = 193 bool shouldHide =
194 chrome::ShouldRemoveBookmarkOpenPagesUI(browser->profile()); 194 chrome::ShouldRemoveBookmarkOpenPagesUI(browser->profile());
195 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item); 195 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item);
196 [menuItem setHidden:shouldHide]; 196 [menuItem setHidden:shouldHide];
197 break; 197 break;
198 } 198 }
199 default: 199 default:
200 // Special handling for the contents of the Text Encoding submenu. On 200 // Special handling for the contents of the Text Encoding submenu. On
201 // Mac OS, instead of enabling/disabling the top-level menu item, we 201 // Mac OS, instead of enabling/disabling the top-level menu item, we
202 // enable/disable the submenu's contents (per Apple's HIG). 202 // enable/disable the submenu's contents (per Apple's HIG).
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // the background" in this case. 242 // the background" in this case.
243 modifierFlags &= ~NSCommandKeyMask; 243 modifierFlags &= ~NSCommandKeyMask;
244 } 244 }
245 chrome::ExecuteCommandWithDisposition( 245 chrome::ExecuteCommandWithDisposition(
246 FindBrowserForSender(sender, window), command, 246 FindBrowserForSender(sender, window), command,
247 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent], 247 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent],
248 modifierFlags)); 248 modifierFlags));
249 } 249 }
250 250
251 @end 251 @end
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_window_browsertest.cc ('k') | chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698