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

Side by Side Diff: chrome/browser/resources/chromeos/keyboard_overlay.js

Issue 17095007: Clean up keyboard overlay code for shortcut keys with Search modifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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
OLDNEW
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 src="keyboard_overlay_data.js"/> 5 <include src="keyboard_overlay_data.js"/>
6 <include src="keyboard_overlay_accessibility_helper.js"/> 6 <include src="keyboard_overlay_accessibility_helper.js"/>
7 7
8 var BASE_KEYBOARD = { 8 var BASE_KEYBOARD = {
9 top: 0, 9 top: 0,
10 left: 0, 10 left: 0,
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 if (!isDisplayUIScalingEnabled()) { 135 if (!isDisplayUIScalingEnabled()) {
136 // Zoom screen in 136 // Zoom screen in
137 delete shortcutDataCache['+<>CTRL<>SHIFT']; 137 delete shortcutDataCache['+<>CTRL<>SHIFT'];
138 // Zoom screen out 138 // Zoom screen out
139 delete shortcutDataCache['-<>CTRL<>SHIFT']; 139 delete shortcutDataCache['-<>CTRL<>SHIFT'];
140 // Reset screen zoom 140 // Reset screen zoom
141 delete shortcutDataCache['0<>CTRL<>SHIFT']; 141 delete shortcutDataCache['0<>CTRL<>SHIFT'];
142 } 142 }
143 143
144 // TODO(mazda): Clean this up and move these out to the data js.
145 var searchModifierAddShortcuts = {
146 '1<>SEARCH': 'keyboardOverlayF1',
147 '2<>SEARCH': 'keyboardOverlayF2',
148 '3<>SEARCH': 'keyboardOverlayF3',
149 '4<>SEARCH': 'keyboardOverlayF4',
150 '5<>SEARCH': 'keyboardOverlayF5',
151 '6<>SEARCH': 'keyboardOverlayF6',
152 '7<>SEARCH': 'keyboardOverlayF7',
153 '8<>SEARCH': 'keyboardOverlayF8',
154 '9<>SEARCH': 'keyboardOverlayF9',
155 '0<>SEARCH': 'keyboardOverlayF10',
156 '-<>SEARCH': 'keyboardOverlayF11',
157 '=<>SEARCH': 'keyboardOverlayF12',
158 'F1<>SEARCH': 'keyboardOverlayF1',
159 'F2<>SEARCH': 'keyboardOverlayF2',
160 'F3<>SEARCH': 'keyboardOverlayF3',
161 'F4<>SEARCH': 'keyboardOverlayF4',
162 'F5<>SEARCH': 'keyboardOverlayF5',
163 'F6<>SEARCH': 'keyboardOverlayF6',
164 'F7<>SEARCH': 'keyboardOverlayF7',
165 'F8<>SEARCH': 'keyboardOverlayF8',
166 'F9<>SEARCH': 'keyboardOverlayF9',
167 'F10<>SEARCH': 'keyboardOverlayF10',
168 'F11<>SEARCH': 'keyboardOverlayF11',
169 'F12<>SEARCH': 'keyboardOverlayF12',
170 'back<>SEARCH': 'keyboardOverlayF1',
171 'forward<>SEARCH': 'keyboardOverlayF2',
172 'reload<>SEARCH': 'keyboardOverlayF3',
173 'full screen<>SEARCH': 'keyboardOverlayF4',
174 'switch window<>SEARCH': 'keyboardOverlayF5',
175 'bright down<>SEARCH': 'keyboardOverlayF6',
176 'bright up<>SEARCH': 'keyboardOverlayF7',
177 'mute<>SEARCH': 'keyboardOverlayF8',
178 'vol. down<>SEARCH': 'keyboardOverlayF9',
179 'vol. up<>SEARCH': 'keyboardOverlayF10',
180 'backspace<>SEARCH': 'keyboardOverlayDelete',
181 'down<>SEARCH': 'keyboardOverlayPageDown',
182 'right<>SEARCH': 'keyboardOverlayEnd',
183 'up<>SEARCH': 'keyboardOverlayPageUp',
184 'left<>SEARCH': 'keyboardOverlayHome',
185 '.<>SEARCH': 'keyboardOverlayInsert'
186 };
187 for (var key in searchModifierAddShortcuts)
188 shortcutDataCache[key] = searchModifierAddShortcuts[key];
189 return shortcutDataCache; 144 return shortcutDataCache;
190 } 145 }
191 146
192 /** 147 /**
193 * Returns the keyboard overlay ID. 148 * Returns the keyboard overlay ID.
194 * @return {string} Keyboard overlay ID. 149 * @return {string} Keyboard overlay ID.
195 */ 150 */
196 function getKeyboardOverlayId() { 151 function getKeyboardOverlayId() {
197 return keyboardOverlayId; 152 return keyboardOverlayId;
198 } 153 }
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 * Handles click events of the learn more link. 698 * Handles click events of the learn more link.
744 * @param {Event} e Mouse click event. 699 * @param {Event} e Mouse click event.
745 */ 700 */
746 function learnMoreClicked(e) { 701 function learnMoreClicked(e) {
747 chrome.send('openLearnMorePage'); 702 chrome.send('openLearnMorePage');
748 chrome.send('DialogClose'); 703 chrome.send('DialogClose');
749 e.preventDefault(); 704 e.preventDefault();
750 } 705 }
751 706
752 document.addEventListener('DOMContentLoaded', init); 707 document.addEventListener('DOMContentLoaded', init);
OLDNEW
« no previous file with comments | « chrome/app/chromeos_strings.grdp ('k') | chrome/browser/resources/chromeos/keyboard_overlay_data.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698