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

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

Issue 7721001: PrintPreview: Make ctrl-shift-p start the native print flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + merge conflicts fix 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/printing/print_view_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 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"
11 #include "base/logging.h" 11 #include "base/logging.h"
(...skipping 62 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},
Nico 2011/08/29 23:43:48 The way this would normally be done on mac is to e
kmadhusu 2011/08/30 00:27:03 Thakis: Thanks a lot for the info. I am not a mac
84 }; 85 };
85 86
86 *num_entries = arraysize(keyboard_shortcuts); 87 *num_entries = arraysize(keyboard_shortcuts);
87 88
88 return keyboard_shortcuts; 89 return keyboard_shortcuts;
89 } 90 }
90 91
91 static bool MatchesEventForKeyboardShortcut( 92 static bool MatchesEventForKeyboardShortcut(
92 const KeyboardShortcutData& shortcut, 93 const KeyboardShortcutData& shortcut,
93 bool command_key, bool shift_key, bool cntrl_key, bool opt_key, 94 bool command_key, bool shift_key, bool cntrl_key, bool opt_key,
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 return rawChar; 213 return rawChar;
213 } 214 }
214 215
215 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8). 216 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8).
216 if ([event modifierFlags] & NSAlternateKeyMask) 217 if ([event modifierFlags] & NSAlternateKeyMask)
217 return [characters characterAtIndex:0]; 218 return [characters characterAtIndex:0];
218 } 219 }
219 220
220 return [eventString characterAtIndex:0]; 221 return [eventString characterAtIndex:0];
221 } 222 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/printing/print_view_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698