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

Side by Side Diff: chrome/browser/app_controller_mac.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/app/nibs/MainMenu.xib ('k') | chrome/browser/ui/cocoa/browser_window_command_handler.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import "chrome/browser/app_controller_mac.h" 5 #import "chrome/browser/app_controller_mac.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 #if defined(GOOGLE_CHROME_BUILD) 975 #if defined(GOOGLE_CHROME_BUILD)
976 case IDC_FEEDBACK: 976 case IDC_FEEDBACK:
977 enable = NO; 977 enable = NO;
978 break; 978 break;
979 #endif 979 #endif
980 default: 980 default:
981 enable = menuState_->IsCommandEnabled(tag) ? 981 enable = menuState_->IsCommandEnabled(tag) ?
982 ![self keyWindowIsModal] : NO; 982 ![self keyWindowIsModal] : NO;
983 } 983 }
984 } 984 }
985
986 // "Show as tab" should only appear when the current window is a popup.
987 // Since |validateUserInterfaceItem:| is called only when there are no
988 // key windows, we should just hide this.
989 // This is handled outside of the switch statement because we want to hide
990 // this regardless if the command is supported or not.
991 if (tag == IDC_SHOW_AS_TAB) {
992 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item);
993 [menuItem setHidden:YES];
994 }
985 } else if (action == @selector(terminate:)) { 995 } else if (action == @selector(terminate:)) {
986 enable = YES; 996 enable = YES;
987 } else if (action == @selector(showPreferences:)) { 997 } else if (action == @selector(showPreferences:)) {
988 enable = YES; 998 enable = YES;
989 } else if (action == @selector(orderFrontStandardAboutPanel:)) { 999 } else if (action == @selector(orderFrontStandardAboutPanel:)) {
990 enable = YES; 1000 enable = YES;
991 } else if (action == @selector(commandFromDock:)) { 1001 } else if (action == @selector(commandFromDock:)) {
992 enable = YES; 1002 enable = YES;
993 } else if (action == @selector(toggleConfirmToQuit:)) { 1003 } else if (action == @selector(toggleConfirmToQuit:)) {
994 [self updateConfirmToQuitPrefMenuItem:static_cast<NSMenuItem*>(item)]; 1004 [self updateConfirmToQuitPrefMenuItem:static_cast<NSMenuItem*>(item)];
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1695 1705
1696 //--------------------------------------------------------------------------- 1706 //---------------------------------------------------------------------------
1697 1707
1698 namespace app_controller_mac { 1708 namespace app_controller_mac {
1699 1709
1700 bool IsOpeningNewWindow() { 1710 bool IsOpeningNewWindow() {
1701 return g_is_opening_new_window; 1711 return g_is_opening_new_window;
1702 } 1712 }
1703 1713
1704 } // namespace app_controller_mac 1714 } // namespace app_controller_mac
OLDNEW
« no previous file with comments | « chrome/app/nibs/MainMenu.xib ('k') | chrome/browser/ui/cocoa/browser_window_command_handler.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698