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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "ui/base/events/event_constants.h" | 9 #include "ui/base/events/event_constants.h" |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 { ui::VKEY_OEM_MINUS, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, | 85 { ui::VKEY_OEM_MINUS, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, |
86 IDC_ZOOM_MINUS }, | 86 IDC_ZOOM_MINUS }, |
87 { ui::VKEY_SUBTRACT, ui::EF_CONTROL_DOWN, IDC_ZOOM_MINUS }, | 87 { ui::VKEY_SUBTRACT, ui::EF_CONTROL_DOWN, IDC_ZOOM_MINUS }, |
88 { ui::VKEY_0, ui::EF_CONTROL_DOWN, IDC_ZOOM_NORMAL }, | 88 { ui::VKEY_0, ui::EF_CONTROL_DOWN, IDC_ZOOM_NORMAL }, |
89 { ui::VKEY_NUMPAD0, ui::EF_CONTROL_DOWN, IDC_ZOOM_NORMAL }, | 89 { ui::VKEY_NUMPAD0, ui::EF_CONTROL_DOWN, IDC_ZOOM_NORMAL }, |
90 { ui::VKEY_OEM_PLUS, ui::EF_CONTROL_DOWN, IDC_ZOOM_PLUS }, | 90 { ui::VKEY_OEM_PLUS, ui::EF_CONTROL_DOWN, IDC_ZOOM_PLUS }, |
91 { ui::VKEY_OEM_PLUS, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_ZOOM_PLUS }, | 91 { ui::VKEY_OEM_PLUS, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_ZOOM_PLUS }, |
92 { ui::VKEY_ADD, ui::EF_CONTROL_DOWN, IDC_ZOOM_PLUS }, | 92 { ui::VKEY_ADD, ui::EF_CONTROL_DOWN, IDC_ZOOM_PLUS }, |
93 { ui::VKEY_A, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, | 93 { ui::VKEY_A, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, |
94 IDC_TOGGLE_ASH_DESKTOP }, | 94 IDC_TOGGLE_ASH_DESKTOP }, |
| 95 { ui::VKEY_F1, ui::EF_NONE, IDC_HELP_PAGE_VIA_KEYBOARD }, |
| 96 { ui::VKEY_F3, ui::EF_NONE, IDC_FIND_NEXT }, |
| 97 { ui::VKEY_F3, ui::EF_SHIFT_DOWN, IDC_FIND_PREVIOUS }, |
| 98 { ui::VKEY_F4, ui::EF_CONTROL_DOWN, IDC_CLOSE_TAB }, |
| 99 { ui::VKEY_F4, ui::EF_ALT_DOWN, IDC_CLOSE_WINDOW }, |
| 100 { ui::VKEY_F5, ui::EF_NONE, IDC_RELOAD }, |
| 101 { ui::VKEY_F5, ui::EF_CONTROL_DOWN, IDC_RELOAD_IGNORING_CACHE }, |
| 102 { ui::VKEY_F5, ui::EF_SHIFT_DOWN, IDC_RELOAD_IGNORING_CACHE }, |
| 103 { ui::VKEY_F6, ui::EF_NONE, IDC_FOCUS_NEXT_PANE }, |
| 104 { ui::VKEY_F6, ui::EF_SHIFT_DOWN, IDC_FOCUS_PREVIOUS_PANE }, |
| 105 { ui::VKEY_F10, ui::EF_NONE, IDC_FOCUS_MENU_BAR }, |
| 106 { ui::VKEY_F11, ui::EF_NONE, IDC_FULLSCREEN }, |
95 | 107 |
96 // Platform-specific key maps. | 108 // Platform-specific key maps. |
97 #if defined(OS_CHROMEOS) | 109 #if defined(OS_CHROMEOS) |
98 // On Chrome OS, VKEY_BROWSER_SEARCH is handled in Ash. | 110 // On Chrome OS, VKEY_BROWSER_SEARCH is handled in Ash. |
99 { ui::VKEY_BROWSER_BACK, ui::EF_NONE, IDC_BACK }, | 111 { ui::VKEY_BROWSER_BACK, ui::EF_NONE, IDC_BACK }, |
100 { ui::VKEY_F1, ui::EF_NONE, IDC_BACK }, | |
101 { ui::VKEY_BACK, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, | 112 { ui::VKEY_BACK, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, |
102 IDC_CLEAR_BROWSING_DATA }, | 113 IDC_CLEAR_BROWSING_DATA }, |
103 { ui::VKEY_BROWSER_FORWARD, ui::EF_NONE, IDC_FORWARD }, | 114 { ui::VKEY_BROWSER_FORWARD, ui::EF_NONE, IDC_FORWARD }, |
104 { ui::VKEY_F2, ui::EF_NONE, IDC_FORWARD }, | |
105 { ui::VKEY_F4, ui::EF_SHIFT_DOWN, IDC_FULLSCREEN }, | |
106 { ui::VKEY_OEM_2, ui::EF_CONTROL_DOWN, IDC_HELP_PAGE_VIA_KEYBOARD }, | 115 { ui::VKEY_OEM_2, ui::EF_CONTROL_DOWN, IDC_HELP_PAGE_VIA_KEYBOARD }, |
107 { ui::VKEY_OEM_2, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, | 116 { ui::VKEY_OEM_2, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, |
108 IDC_HELP_PAGE_VIA_KEYBOARD }, | 117 IDC_HELP_PAGE_VIA_KEYBOARD }, |
109 { ui::VKEY_BROWSER_HOME, ui::EF_NONE, IDC_HOME }, | 118 { ui::VKEY_BROWSER_HOME, ui::EF_NONE, IDC_HOME }, |
110 { ui::VKEY_BROWSER_REFRESH, ui::EF_NONE, IDC_RELOAD }, | 119 { ui::VKEY_BROWSER_REFRESH, ui::EF_NONE, IDC_RELOAD }, |
111 { ui::VKEY_F3, ui::EF_NONE, IDC_RELOAD }, | 120 { ui::VKEY_BROWSER_REFRESH, ui::EF_CONTROL_DOWN, IDC_RELOAD_IGNORING_CACHE }, |
112 { ui::VKEY_F3, ui::EF_CONTROL_DOWN, IDC_RELOAD_IGNORING_CACHE }, | 121 { ui::VKEY_BROWSER_REFRESH, ui::EF_SHIFT_DOWN, IDC_RELOAD_IGNORING_CACHE }, |
113 { ui::VKEY_F3, ui::EF_SHIFT_DOWN, IDC_RELOAD_IGNORING_CACHE }, | |
114 { ui::VKEY_BROWSER_FAVORITES, ui::EF_NONE, IDC_SHOW_BOOKMARK_MANAGER }, | 122 { ui::VKEY_BROWSER_FAVORITES, ui::EF_NONE, IDC_SHOW_BOOKMARK_MANAGER }, |
115 { ui::VKEY_BROWSER_STOP, ui::EF_NONE, IDC_STOP }, | 123 { ui::VKEY_BROWSER_STOP, ui::EF_NONE, IDC_STOP }, |
116 #else // OS_CHROMEOS | 124 #else // OS_CHROMEOS |
117 { ui::VKEY_DELETE, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, | 125 { ui::VKEY_DELETE, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, |
118 IDC_CLEAR_BROWSING_DATA }, | 126 IDC_CLEAR_BROWSING_DATA }, |
119 { ui::VKEY_F4, ui::EF_CONTROL_DOWN, IDC_CLOSE_TAB }, | |
120 { ui::VKEY_F4, ui::EF_ALT_DOWN, IDC_CLOSE_WINDOW }, | |
121 { ui::VKEY_F3, ui::EF_NONE, IDC_FIND_NEXT }, | |
122 { ui::VKEY_F3, ui::EF_SHIFT_DOWN, IDC_FIND_PREVIOUS }, | |
123 { ui::VKEY_F10, ui::EF_NONE, IDC_FOCUS_MENU_BAR }, | |
124 { ui::VKEY_LMENU, ui::EF_NONE, IDC_FOCUS_MENU_BAR }, | 127 { ui::VKEY_LMENU, ui::EF_NONE, IDC_FOCUS_MENU_BAR }, |
125 { ui::VKEY_MENU, ui::EF_NONE, IDC_FOCUS_MENU_BAR }, | 128 { ui::VKEY_MENU, ui::EF_NONE, IDC_FOCUS_MENU_BAR }, |
126 { ui::VKEY_RMENU, ui::EF_NONE, IDC_FOCUS_MENU_BAR }, | 129 { ui::VKEY_RMENU, ui::EF_NONE, IDC_FOCUS_MENU_BAR }, |
127 { ui::VKEY_F6, ui::EF_NONE, IDC_FOCUS_NEXT_PANE }, | |
128 { ui::VKEY_F6, ui::EF_SHIFT_DOWN, IDC_FOCUS_PREVIOUS_PANE }, | |
129 // On Windows, all VKEY_BROWSER_* keys except VKEY_BROWSER_SEARCH are handled | 130 // On Windows, all VKEY_BROWSER_* keys except VKEY_BROWSER_SEARCH are handled |
130 // via WM_APPCOMMAND. | 131 // via WM_APPCOMMAND. |
131 { ui::VKEY_BROWSER_SEARCH, ui::EF_NONE, IDC_FOCUS_SEARCH }, | 132 { ui::VKEY_BROWSER_SEARCH, ui::EF_NONE, IDC_FOCUS_SEARCH }, |
132 { ui::VKEY_F11, ui::EF_NONE, IDC_FULLSCREEN }, | |
133 { ui::VKEY_F1, ui::EF_NONE, IDC_HELP_PAGE_VIA_KEYBOARD }, | |
134 { ui::VKEY_F5, ui::EF_NONE, IDC_RELOAD }, | |
135 { ui::VKEY_F5, ui::EF_CONTROL_DOWN, IDC_RELOAD_IGNORING_CACHE }, | |
136 { ui::VKEY_F5, ui::EF_SHIFT_DOWN, IDC_RELOAD_IGNORING_CACHE }, | |
137 { ui::VKEY_M, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_SHOW_AVATAR_MENU}, | 133 { ui::VKEY_M, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_SHOW_AVATAR_MENU}, |
138 #endif // OS_CHROMEOS | 134 #endif // OS_CHROMEOS |
139 #if !defined(OS_CHROMEOS) | 135 #if !defined(OS_CHROMEOS) |
140 { ui::VKEY_I, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, IDC_FEEDBACK }, | 136 { ui::VKEY_I, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, IDC_FEEDBACK }, |
141 { ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_EXIT }, | 137 { ui::VKEY_Q, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_EXIT }, |
142 { ui::VKEY_N, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, | 138 { ui::VKEY_N, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, |
143 IDC_NEW_INCOGNITO_WINDOW }, | 139 IDC_NEW_INCOGNITO_WINDOW }, |
144 { ui::VKEY_T, ui::EF_CONTROL_DOWN, IDC_NEW_TAB }, | 140 { ui::VKEY_T, ui::EF_CONTROL_DOWN, IDC_NEW_TAB }, |
145 { ui::VKEY_N, ui::EF_CONTROL_DOWN, IDC_NEW_WINDOW }, | 141 { ui::VKEY_N, ui::EF_CONTROL_DOWN, IDC_NEW_WINDOW }, |
146 { ui::VKEY_O, ui::EF_CONTROL_DOWN, IDC_OPEN_FILE }, | 142 { ui::VKEY_O, ui::EF_CONTROL_DOWN, IDC_OPEN_FILE }, |
147 { ui::VKEY_T, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_RESTORE_TAB }, | 143 { ui::VKEY_T, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_RESTORE_TAB }, |
148 { ui::VKEY_ESCAPE, ui::EF_SHIFT_DOWN, IDC_TASK_MANAGER }, | 144 { ui::VKEY_ESCAPE, ui::EF_SHIFT_DOWN, IDC_TASK_MANAGER }, |
149 #endif | 145 #endif |
150 }; | 146 }; |
151 | 147 |
152 const size_t kAcceleratorMapLength = arraysize(kAcceleratorMap); | 148 const size_t kAcceleratorMapLength = arraysize(kAcceleratorMap); |
153 | 149 |
154 } // namespace chrome | 150 } // namespace chrome |
OLD | NEW |