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

Side by Side Diff: chrome/browser/global_keyboard_shortcuts_mac.mm

Issue 7810009: PrintPreview:[MAC] Make Cmd+Opt+P as advance print shortcut to display the native print dialog. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include <AppKit/NSEvent.h> 5 #include <AppKit/NSEvent.h>
6 #include <Carbon/Carbon.h> 6 #include <Carbon/Carbon.h>
7 7
8 #include "chrome/browser/global_keyboard_shortcuts_mac.h" 8 #include "chrome/browser/global_keyboard_shortcuts_mac.h"
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 const KeyboardShortcutData* GetBrowserKeyboardShortcutTable( 74 const KeyboardShortcutData* GetBrowserKeyboardShortcutTable(
75 size_t* num_entries) { 75 size_t* num_entries) {
76 static const KeyboardShortcutData keyboard_shortcuts[] = { 76 static const KeyboardShortcutData keyboard_shortcuts[] = {
77 //cmd shift cntrl option 77 //cmd shift cntrl option
78 //--- ----- ----- ------ 78 //--- ----- ----- ------
79 {true, false, false, false, kVK_LeftArrow, 0, IDC_BACK}, 79 {true, false, false, false, kVK_LeftArrow, 0, IDC_BACK},
80 {true, false, false, false, kVK_RightArrow, 0, IDC_FORWARD}, 80 {true, false, false, false, kVK_RightArrow, 0, IDC_FORWARD},
81 {false, false, false, false, kVK_Delete, 0, IDC_BACK}, 81 {false, false, false, false, kVK_Delete, 0, IDC_BACK},
82 {false, true, false, false, kVK_Delete, 0, IDC_FORWARD}, 82 {false, true, false, false, kVK_Delete, 0, IDC_FORWARD},
83 {true, true, false, false, 0, 'c', IDC_DEV_TOOLS_INSPECT}, 83 {true, true, false, false, 0, 'c', IDC_DEV_TOOLS_INSPECT},
84 {true, true, false, false, 0, 'p', IDC_ADVANCED_PRINT},
85 }; 84 };
86 85
87 *num_entries = arraysize(keyboard_shortcuts); 86 *num_entries = arraysize(keyboard_shortcuts);
88 87
89 return keyboard_shortcuts; 88 return keyboard_shortcuts;
90 } 89 }
91 90
92 static bool MatchesEventForKeyboardShortcut( 91 static bool MatchesEventForKeyboardShortcut(
93 const KeyboardShortcutData& shortcut, 92 const KeyboardShortcutData& shortcut,
94 bool command_key, bool shift_key, bool cntrl_key, bool opt_key, 93 bool command_key, bool shift_key, bool cntrl_key, bool opt_key,
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 return rawChar; 212 return rawChar;
214 } 213 }
215 214
216 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8). 215 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8).
217 if ([event modifierFlags] & NSAlternateKeyMask) 216 if ([event modifierFlags] & NSAlternateKeyMask)
218 return [characters characterAtIndex:0]; 217 return [characters characterAtIndex:0];
219 } 218 }
220 219
221 return [eventString characterAtIndex:0]; 220 return [eventString characterAtIndex:0];
222 } 221 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698