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

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

Issue 1681863005: Added the "Show as Tab" option for popups on OSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item); 212 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item);
213 [menuItem setHidden:shouldHide]; 213 [menuItem setHidden:shouldHide];
214 break; 214 break;
215 } 215 }
216 case IDC_TOGGLE_FULLSCREEN_TOOLBAR: { 216 case IDC_TOGGLE_FULLSCREEN_TOOLBAR: {
217 if (!chrome::mac::SupportsSystemFullscreen()) { 217 if (!chrome::mac::SupportsSystemFullscreen()) {
218 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item); 218 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item);
219 [menuItem setHidden:YES]; 219 [menuItem setHidden:YES];
220 enable = NO; 220 enable = NO;
221 } 221 }
222 break;
223 }
224 case IDC_SHOW_AS_TAB: {
225 // Hide this menu option if the window is tabbed.
226 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item);
227 [menuItem setHidden:browser->is_type_tabbed()];
228 break;
222 } 229 }
223 default: 230 default:
224 // Special handling for the contents of the Text Encoding submenu. On 231 // Special handling for the contents of the Text Encoding submenu. On
225 // Mac OS, instead of enabling/disabling the top-level menu item, we 232 // Mac OS, instead of enabling/disabling the top-level menu item, we
226 // enable/disable the submenu's contents (per Apple's HIG). 233 // enable/disable the submenu's contents (per Apple's HIG).
227 EncodingMenuController encoding_controller; 234 EncodingMenuController encoding_controller;
228 if (encoding_controller.DoesCommandBelongToEncodingMenu(tag)) 235 if (encoding_controller.DoesCommandBelongToEncodingMenu(tag))
229 enable &= chrome::IsCommandEnabled(browser, IDC_ENCODING_MENU); 236 enable &= chrome::IsCommandEnabled(browser, IDC_ENCODING_MENU);
230 } 237 }
231 238
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 // the background" in this case. 273 // the background" in this case.
267 modifierFlags &= ~NSCommandKeyMask; 274 modifierFlags &= ~NSCommandKeyMask;
268 } 275 }
269 chrome::ExecuteCommandWithDisposition( 276 chrome::ExecuteCommandWithDisposition(
270 FindBrowserForSender(sender, window), command, 277 FindBrowserForSender(sender, window), command,
271 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent], 278 ui::WindowOpenDispositionFromNSEventWithFlags([NSApp currentEvent],
272 modifierFlags)); 279 modifierFlags));
273 } 280 }
274 281
275 @end 282 @end
OLDNEW
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698