| OLD | NEW |
| 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 "chrome/browser/global_keyboard_shortcuts_mac.h" | 5 #include "chrome/browser/global_keyboard_shortcuts_mac.h" |
| 6 | 6 |
| 7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 return keyboard_shortcuts; | 96 return keyboard_shortcuts; |
| 97 } | 97 } |
| 98 | 98 |
| 99 const KeyboardShortcutData* GetBrowserKeyboardShortcutTable( | 99 const KeyboardShortcutData* GetBrowserKeyboardShortcutTable( |
| 100 size_t* num_entries) { | 100 size_t* num_entries) { |
| 101 static const KeyboardShortcutData keyboard_shortcuts[] = { | 101 static const KeyboardShortcutData keyboard_shortcuts[] = { |
| 102 //cmd shift cntrl option | 102 //cmd shift cntrl option |
| 103 //--- ----- ----- ------ | 103 //--- ----- ----- ------ |
| 104 {true, false, false, false, kVK_LeftArrow, 0, IDC_BACK}, | 104 {true, false, false, false, kVK_LeftArrow, 0, IDC_BACK}, |
| 105 {true, false, false, false, kVK_RightArrow, 0, IDC_FORWARD}, | 105 {true, false, false, false, kVK_RightArrow, 0, IDC_FORWARD}, |
| 106 {false, false, false, false, kVK_Delete, 0, IDC_BACK}, | |
| 107 {false, true, false, false, kVK_Delete, 0, IDC_FORWARD}, | |
| 108 {true, true, false, false, 0, 'c', IDC_DEV_TOOLS_INSPECT}, | 106 {true, true, false, false, 0, 'c', IDC_DEV_TOOLS_INSPECT}, |
| 109 }; | 107 }; |
| 110 | 108 |
| 111 *num_entries = arraysize(keyboard_shortcuts); | 109 *num_entries = arraysize(keyboard_shortcuts); |
| 112 | 110 |
| 113 return keyboard_shortcuts; | 111 return keyboard_shortcuts; |
| 114 } | 112 } |
| 115 | 113 |
| 116 static bool MatchesEventForKeyboardShortcut( | 114 static bool MatchesEventForKeyboardShortcut( |
| 117 const KeyboardShortcutData& shortcut, | 115 const KeyboardShortcutData& shortcut, |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 } | 288 } |
| 291 } | 289 } |
| 292 | 290 |
| 293 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8). | 291 // opt/alt modifier is set (e.g. on german layout we want '{' for opt-8). |
| 294 if ([event modifierFlags] & NSAlternateKeyMask) | 292 if ([event modifierFlags] & NSAlternateKeyMask) |
| 295 return rawChar; | 293 return rawChar; |
| 296 } | 294 } |
| 297 | 295 |
| 298 return noModifiersChar; | 296 return noModifiersChar; |
| 299 } | 297 } |
| OLD | NEW |