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

Side by Side Diff: chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm

Issue 23477029: Show all Edit menu items when an app window is focused. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/apps/app_shim_menu_controller_mac.h" 5 #import "chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h"
6 6
7 #include "apps/app_shim/extension_app_shim_handler_mac.h" 7 #include "apps/app_shim/extension_app_shim_handler_mac.h"
8 #include "apps/shell_window.h" 8 #include "apps/shell_window.h"
9 #include "apps/shell_window_registry.h" 9 #include "apps/shell_window_registry.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 keyEquivalent:@"q"]; 101 keyEquivalent:@"q"];
102 [appMenuQuitItem setKeyEquivalentModifierMask: 102 [appMenuQuitItem setKeyEquivalentModifierMask:
103 [chromeMenuQuitItem_ keyEquivalentModifierMask]]; 103 [chromeMenuQuitItem_ keyEquivalentModifierMask]];
104 [appMenuQuitItem setTarget:self]; 104 [appMenuQuitItem setTarget:self];
105 [appMenuItem_ setSubmenu:appMenu]; 105 [appMenuItem_ setSubmenu:appMenu];
106 106
107 // File menu. 107 // File menu.
108 fileMenuItem_.reset([NewTopLevelItemFrom(IDC_FILE_MENU) retain]); 108 fileMenuItem_.reset([NewTopLevelItemFrom(IDC_FILE_MENU) retain]);
109 AddDuplicateItem(fileMenuItem_, IDC_FILE_MENU, IDC_CLOSE_WINDOW); 109 AddDuplicateItem(fileMenuItem_, IDC_FILE_MENU, IDC_CLOSE_WINDOW);
110 110
111 // Edit menu. 111 // Edit menu. This is copied entirely.
Nico 2013/09/03 17:35:03 There's "Find->Search the web" which copies the om
jackhou1 2013/09/04 00:59:26 "Search the web" opens up a Chrome window. Find do
112 editMenuItem_.reset([NewTopLevelItemFrom(IDC_EDIT_MENU) retain]); 112 editMenuItem_.reset([[[NSApp mainMenu] itemWithTag:IDC_EDIT_MENU] copy]);
113 AddDuplicateItem(editMenuItem_, IDC_EDIT_MENU, IDC_CONTENT_CONTEXT_UNDO);
114 AddDuplicateItem(editMenuItem_, IDC_EDIT_MENU, IDC_CONTENT_CONTEXT_REDO);
115 [[editMenuItem_ submenu] addItem:[NSMenuItem separatorItem]];
116 AddDuplicateItem(editMenuItem_, IDC_EDIT_MENU, IDC_CONTENT_CONTEXT_CUT);
117 AddDuplicateItem(editMenuItem_, IDC_EDIT_MENU, IDC_CONTENT_CONTEXT_COPY);
118 AddDuplicateItem(editMenuItem_, IDC_EDIT_MENU, IDC_CONTENT_CONTEXT_PASTE);
119 AddDuplicateItem(editMenuItem_, IDC_EDIT_MENU, IDC_CONTENT_CONTEXT_DELETE);
120 AddDuplicateItem(editMenuItem_, IDC_EDIT_MENU, IDC_CONTENT_CONTEXT_SELECTALL);
121 113
122 // Window menu. 114 // Window menu.
123 windowMenuItem_.reset([NewTopLevelItemFrom(IDC_WINDOW_MENU) retain]); 115 windowMenuItem_.reset([NewTopLevelItemFrom(IDC_WINDOW_MENU) retain]);
124 AddDuplicateItem(windowMenuItem_, IDC_WINDOW_MENU, IDC_MINIMIZE_WINDOW); 116 AddDuplicateItem(windowMenuItem_, IDC_WINDOW_MENU, IDC_MINIMIZE_WINDOW);
125 AddDuplicateItem(windowMenuItem_, IDC_WINDOW_MENU, IDC_MAXIMIZE_WINDOW); 117 AddDuplicateItem(windowMenuItem_, IDC_WINDOW_MENU, IDC_MAXIMIZE_WINDOW);
126 [[windowMenuItem_ submenu] addItem:[NSMenuItem separatorItem]]; 118 [[windowMenuItem_ submenu] addItem:[NSMenuItem separatorItem]];
127 AddDuplicateItem(windowMenuItem_, IDC_WINDOW_MENU, IDC_ALL_WINDOWS_FRONT); 119 AddDuplicateItem(windowMenuItem_, IDC_WINDOW_MENU, IDC_ALL_WINDOWS_FRONT);
128 } 120 }
129 121
130 - (void)registerEventHandlers { 122 - (void)registerEventHandlers {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 222
231 - (void)quitCurrentPlatformApp { 223 - (void)quitCurrentPlatformApp {
232 apps::ShellWindow* shellWindow = 224 apps::ShellWindow* shellWindow =
233 apps::ShellWindowRegistry::GetShellWindowForNativeWindowAnyProfile( 225 apps::ShellWindowRegistry::GetShellWindowForNativeWindowAnyProfile(
234 [NSApp keyWindow]); 226 [NSApp keyWindow]);
235 if (shellWindow) 227 if (shellWindow)
236 apps::ExtensionAppShimHandler::QuitAppForWindow(shellWindow); 228 apps::ExtensionAppShimHandler::QuitAppForWindow(shellWindow);
237 } 229 }
238 230
239 @end 231 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698