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

Unified Diff: chrome/browser/cocoa/browser_window_cocoa.mm

Issue 337040: [mac] Fix Cmd-w in the one-tab case. (Closed)
Patch Set: Add comment Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_cocoa.mm
diff --git a/chrome/browser/cocoa/browser_window_cocoa.mm b/chrome/browser/cocoa/browser_window_cocoa.mm
index 25cd6388d6de3a640de31451661e365dd58ce302..f48746ea187ead37acbed20cd839566ef0b22d0f 100644
--- a/chrome/browser/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/cocoa/browser_window_cocoa.mm
@@ -5,6 +5,7 @@
#include "base/gfx/rect.h"
#include "base/logging.h"
#include "base/sys_string_conversions.h"
+#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/cocoa/browser_window_cocoa.h"
#import "chrome/browser/cocoa/browser_window_controller.h"
@@ -364,6 +365,12 @@ int BrowserWindowCocoa::GetCommandId(const NativeWebKeyboardEvent& event) {
if (item && [item action] == @selector(commandDispatch:) && [item tag] > 0)
return [item tag];
+ // "Close window" doesn't use the |commandDispatch:| mechanism. Menu items
+ // that do not correspond to IDC_ constants need no special treatment however,
+ // as they can't be blacklisted in |Browser::IsReservedAccelerator()| anyhow.
+ if (item && [item action] == @selector(performClose:))
+ return IDC_CLOSE_WINDOW;
+
// Look in secondary keyboard shortcuts.
NSUInteger modifiers = [event.os_event modifierFlags];
const bool cmdKey = (modifiers & NSCommandKeyMask) != 0;
« 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