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 #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 Loading... | |
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 if (tag == IDC_SHOW_AS_TAB) { | |
spqchan
2016/02/10 02:34:48
Note: I'm handling this outside of the switch stat
Avi (use Gerrit)
2016/02/10 06:05:04
If you have to note it in a comment to me, is it s
spqchan
2016/02/10 17:27:06
Fair enough
| |
990 NSMenuItem* menuItem = base::mac::ObjCCast<NSMenuItem>(item); | |
991 [menuItem setHidden:YES]; | |
992 } | |
985 } else if (action == @selector(terminate:)) { | 993 } else if (action == @selector(terminate:)) { |
986 enable = YES; | 994 enable = YES; |
987 } else if (action == @selector(showPreferences:)) { | 995 } else if (action == @selector(showPreferences:)) { |
988 enable = YES; | 996 enable = YES; |
989 } else if (action == @selector(orderFrontStandardAboutPanel:)) { | 997 } else if (action == @selector(orderFrontStandardAboutPanel:)) { |
990 enable = YES; | 998 enable = YES; |
991 } else if (action == @selector(commandFromDock:)) { | 999 } else if (action == @selector(commandFromDock:)) { |
992 enable = YES; | 1000 enable = YES; |
993 } else if (action == @selector(toggleConfirmToQuit:)) { | 1001 } else if (action == @selector(toggleConfirmToQuit:)) { |
994 [self updateConfirmToQuitPrefMenuItem:static_cast<NSMenuItem*>(item)]; | 1002 [self updateConfirmToQuitPrefMenuItem:static_cast<NSMenuItem*>(item)]; |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1695 | 1703 |
1696 //--------------------------------------------------------------------------- | 1704 //--------------------------------------------------------------------------- |
1697 | 1705 |
1698 namespace app_controller_mac { | 1706 namespace app_controller_mac { |
1699 | 1707 |
1700 bool IsOpeningNewWindow() { | 1708 bool IsOpeningNewWindow() { |
1701 return g_is_opening_new_window; | 1709 return g_is_opening_new_window; |
1702 } | 1710 } |
1703 | 1711 |
1704 } // namespace app_controller_mac | 1712 } // namespace app_controller_mac |
OLD | NEW |