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

Unified Diff: chrome/browser/tab_contents/tab_contents_view_mac.mm

Issue 325004: Make user shortcuts override built-in shortcuts. (Closed)
Patch Set: 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/tab_contents/tab_contents_view_mac.mm
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm
index 908b41127435413bc16c5786f8bf6ccf743b5d2f..90e66721d0d3a799e78a9cab84bdf099a58363d2 100644
--- a/chrome/browser/tab_contents/tab_contents_view_mac.mm
+++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm
@@ -333,6 +333,14 @@ void TabContentsViewMac::Observe(NotificationType type,
// Do not fire shortcuts on key up.
if ([event type] == NSKeyDown) {
+ // Send the event to the menu before sending it to the browser/window
+ // shortcut handling, so that if a user configures cmd-left to mean
+ // "previous tab", it takes precedence over the built-in "history back"
+ // binding. Other than that, the |redispatchEvent| call would take care of
+ // invoking the original menu item shortcut as well.
+ if ([[NSApp mainMenu] performKeyEquivalent:event])
+ return;
+
if ([window handleExtraBrowserKeyboardShortcut:event])
return;
if ([window handleExtraWindowKeyboardShortcut:event])
« 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