OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/accelerator_table.h" | 5 #include "chrome/browser/ui/views/accelerator_table.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #else | 28 #else |
29 const ui::EventFlags kPlatformModifier = ui::EF_CONTROL_DOWN; | 29 const ui::EventFlags kPlatformModifier = ui::EF_CONTROL_DOWN; |
30 #endif | 30 #endif |
31 | 31 |
32 // NOTE: Keep this list in the same (mostly-alphabetical) order as | 32 // NOTE: Keep this list in the same (mostly-alphabetical) order as |
33 // the Windows accelerators in ../../app/chrome_dll.rc. | 33 // the Windows accelerators in ../../app/chrome_dll.rc. |
34 // Do not use Ctrl-Alt as a shortcut modifier, as it is used by i18n keyboards: | 34 // Do not use Ctrl-Alt as a shortcut modifier, as it is used by i18n keyboards: |
35 // http://blogs.msdn.com/b/oldnewthing/archive/2004/03/29/101121.aspx | 35 // http://blogs.msdn.com/b/oldnewthing/archive/2004/03/29/101121.aspx |
36 const AcceleratorMapping kAcceleratorMap[] = { | 36 const AcceleratorMapping kAcceleratorMap[] = { |
37 { ui::VKEY_LEFT, ui::EF_ALT_DOWN, IDC_BACK }, | 37 { ui::VKEY_LEFT, ui::EF_ALT_DOWN, IDC_BACK }, |
38 { ui::VKEY_BACK, ui::EF_NONE, IDC_BACK }, | |
39 { ui::VKEY_D, ui::EF_CONTROL_DOWN, IDC_BOOKMARK_PAGE }, | 38 { ui::VKEY_D, ui::EF_CONTROL_DOWN, IDC_BOOKMARK_PAGE }, |
40 { ui::VKEY_D, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, | 39 { ui::VKEY_D, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, |
41 IDC_BOOKMARK_ALL_TABS }, | 40 IDC_BOOKMARK_ALL_TABS }, |
42 { ui::VKEY_W, ui::EF_CONTROL_DOWN, IDC_CLOSE_TAB }, | 41 { ui::VKEY_W, ui::EF_CONTROL_DOWN, IDC_CLOSE_TAB }, |
43 { ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_CLOSE_WINDOW }, | 42 { ui::VKEY_W, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_CLOSE_WINDOW }, |
44 { ui::VKEY_F, ui::EF_CONTROL_DOWN, IDC_FIND }, | 43 { ui::VKEY_F, ui::EF_CONTROL_DOWN, IDC_FIND }, |
45 { ui::VKEY_G, ui::EF_CONTROL_DOWN, IDC_FIND_NEXT }, | 44 { ui::VKEY_G, ui::EF_CONTROL_DOWN, IDC_FIND_NEXT }, |
46 { ui::VKEY_G, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_FIND_PREVIOUS }, | 45 { ui::VKEY_G, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_FIND_PREVIOUS }, |
47 { ui::VKEY_D, ui::EF_ALT_DOWN, IDC_FOCUS_LOCATION }, | 46 { ui::VKEY_D, ui::EF_ALT_DOWN, IDC_FOCUS_LOCATION }, |
48 { ui::VKEY_L, ui::EF_CONTROL_DOWN, IDC_FOCUS_LOCATION }, | 47 { ui::VKEY_L, ui::EF_CONTROL_DOWN, IDC_FOCUS_LOCATION }, |
49 { ui::VKEY_K, ui::EF_CONTROL_DOWN, IDC_FOCUS_SEARCH }, | 48 { ui::VKEY_K, ui::EF_CONTROL_DOWN, IDC_FOCUS_SEARCH }, |
50 { ui::VKEY_E, ui::EF_CONTROL_DOWN, IDC_FOCUS_SEARCH }, | 49 { ui::VKEY_E, ui::EF_CONTROL_DOWN, IDC_FOCUS_SEARCH }, |
51 { ui::VKEY_T, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, IDC_FOCUS_TOOLBAR }, | 50 { ui::VKEY_T, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, IDC_FOCUS_TOOLBAR }, |
52 { ui::VKEY_B, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, IDC_FOCUS_BOOKMARKS }, | 51 { ui::VKEY_B, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, IDC_FOCUS_BOOKMARKS }, |
53 { ui::VKEY_A, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, IDC_FOCUS_INFOBARS }, | 52 { ui::VKEY_A, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, IDC_FOCUS_INFOBARS }, |
54 { ui::VKEY_RIGHT, ui::EF_ALT_DOWN, IDC_FORWARD }, | 53 { ui::VKEY_RIGHT, ui::EF_ALT_DOWN, IDC_FORWARD }, |
55 { ui::VKEY_BACK, ui::EF_SHIFT_DOWN, IDC_FORWARD }, | |
56 { ui::VKEY_I, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_DEV_TOOLS }, | 54 { ui::VKEY_I, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_DEV_TOOLS }, |
57 { ui::VKEY_F12, ui::EF_NONE, IDC_DEV_TOOLS_TOGGLE }, | 55 { ui::VKEY_F12, ui::EF_NONE, IDC_DEV_TOOLS_TOGGLE }, |
58 { ui::VKEY_J, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, | 56 { ui::VKEY_J, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, |
59 IDC_DEV_TOOLS_CONSOLE }, | 57 IDC_DEV_TOOLS_CONSOLE }, |
60 { ui::VKEY_C, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, | 58 { ui::VKEY_C, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, |
61 IDC_DEV_TOOLS_INSPECT }, | 59 IDC_DEV_TOOLS_INSPECT }, |
62 { ui::VKEY_O, ui::EF_CONTROL_DOWN, IDC_OPEN_FILE }, | 60 { ui::VKEY_O, ui::EF_CONTROL_DOWN, IDC_OPEN_FILE }, |
63 { ui::VKEY_P, ui::EF_CONTROL_DOWN, IDC_PRINT}, | 61 { ui::VKEY_P, ui::EF_CONTROL_DOWN, IDC_PRINT}, |
64 #if defined(ENABLE_BASIC_PRINTING) | 62 #if defined(ENABLE_BASIC_PRINTING) |
65 { ui::VKEY_P, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_BASIC_PRINT}, | 63 { ui::VKEY_P, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_BASIC_PRINT}, |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 *accelerator = ui::Accelerator(ui::VKEY_C, ui::EF_CONTROL_DOWN); | 260 *accelerator = ui::Accelerator(ui::VKEY_C, ui::EF_CONTROL_DOWN); |
263 return true; | 261 return true; |
264 case IDC_PASTE: | 262 case IDC_PASTE: |
265 *accelerator = ui::Accelerator(ui::VKEY_V, ui::EF_CONTROL_DOWN); | 263 *accelerator = ui::Accelerator(ui::VKEY_V, ui::EF_CONTROL_DOWN); |
266 return true; | 264 return true; |
267 } | 265 } |
268 return false; | 266 return false; |
269 } | 267 } |
270 | 268 |
271 } // namespace chrome | 269 } // namespace chrome |
OLD | NEW |