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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js

Issue 1773003002: Set keymap in prefs when switching modes in Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_warnings
Patch Set: Created 4 years, 9 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
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/chromevox/background/prefs.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 /** 5 /**
6 * @fileoverview The entry point for all ChromeVox2 related code for the 6 * @fileoverview The entry point for all ChromeVox2 related code for the
7 * background page. 7 * background page.
8 */ 8 */
9 9
10 goog.provide('Background'); 10 goog.provide('Background');
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 /** 163 /**
164 * @override 164 * @override
165 */ 165 */
166 setMode: function(mode, opt_injectClassic) { 166 setMode: function(mode, opt_injectClassic) {
167 // Switching key maps potentially affects the key codes that involve 167 // Switching key maps potentially affects the key codes that involve
168 // sequencing. Without resetting this list, potentially stale key codes 168 // sequencing. Without resetting this list, potentially stale key codes
169 // remain. The key codes themselves get pushed in 169 // remain. The key codes themselves get pushed in
170 // cvox.KeySequence.deserialize which gets called by cvox.KeyMap. 170 // cvox.KeySequence.deserialize which gets called by cvox.KeyMap.
171 cvox.ChromeVox.sequenceSwitchKeyCodes = []; 171 cvox.ChromeVox.sequenceSwitchKeyCodes = [];
172 if (mode === ChromeVoxMode.CLASSIC || mode === ChromeVoxMode.COMPAT) 172 if (mode === ChromeVoxMode.CLASSIC || mode === ChromeVoxMode.COMPAT)
173 cvox.ChromeVoxKbHandler.handlerKeyMap = cvox.KeyMap.fromDefaults(); 173 window['prefs'].switchToKeyMap('keymap_classic');
174 else 174 else
175 cvox.ChromeVoxKbHandler.handlerKeyMap = cvox.KeyMap.fromNext(); 175 window['prefs'].switchToKeyMap('keymap_next');
176 176
177 if (mode == ChromeVoxMode.CLASSIC) { 177 if (mode == ChromeVoxMode.CLASSIC) {
178 if (chrome.commands && 178 if (chrome.commands &&
179 chrome.commands.onCommand.hasListener(this.onGotCommand)) 179 chrome.commands.onCommand.hasListener(this.onGotCommand))
180 chrome.commands.onCommand.removeListener(this.onGotCommand); 180 chrome.commands.onCommand.removeListener(this.onGotCommand);
181 chrome.accessibilityPrivate.setKeyboardListener(false, false); 181 chrome.accessibilityPrivate.setKeyboardListener(false, false);
182 } else { 182 } else {
183 if (chrome.commands && 183 if (chrome.commands &&
184 !chrome.commands.onCommand.hasListener(this.onGotCommand)) 184 !chrome.commands.onCommand.hasListener(this.onGotCommand))
185 chrome.commands.onCommand.addListener(this.onGotCommand); 185 chrome.commands.onCommand.addListener(this.onGotCommand);
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') 989 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&')
990 .replace(/\*/g, '.*') 990 .replace(/\*/g, '.*')
991 .replace(/\?/g, '.'); 991 .replace(/\?/g, '.');
992 }).join('|') + ')$'); 992 }).join('|') + ')$');
993 }; 993 };
994 994
995 /** @type {Background} */ 995 /** @type {Background} */
996 global.backgroundObj = new Background(); 996 global.backgroundObj = new Background();
997 997
998 }); // goog.scope 998 }); // goog.scope
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/chromevox/background/prefs.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698