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

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

Issue 2331253002: Use category flush for focus events. (Closed)
Patch Set: fix test Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 ChromeVox keyboard handler. 6 * @fileoverview ChromeVox keyboard handler.
7 */ 7 */
8 8
9 goog.provide('BackgroundKeyboardHandler'); 9 goog.provide('BackgroundKeyboardHandler');
10 10
(...skipping 20 matching lines...) Expand all
31 onKeyDown: function(evt) { 31 onKeyDown: function(evt) {
32 evt.stickyMode = cvox.ChromeVox.isStickyModeOn() && cvox.ChromeVox.isActive; 32 evt.stickyMode = cvox.ChromeVox.isStickyModeOn() && cvox.ChromeVox.isActive;
33 if (cvox.ChromeVox.passThroughMode) 33 if (cvox.ChromeVox.passThroughMode)
34 return false; 34 return false;
35 35
36 if (ChromeVoxState.instance.mode != ChromeVoxMode.CLASSIC && 36 if (ChromeVoxState.instance.mode != ChromeVoxMode.CLASSIC &&
37 !cvox.ChromeVoxKbHandler.basicKeyDownActionsListener(evt)) { 37 !cvox.ChromeVoxKbHandler.basicKeyDownActionsListener(evt)) {
38 evt.preventDefault(); 38 evt.preventDefault();
39 evt.stopPropagation(); 39 evt.stopPropagation();
40 } 40 }
41 Output.flushNextSpeechUtterance(); 41 Output.forceModeForNextSpeechUtterance(cvox.QueueMode.FLUSH);
42 return false; 42 return false;
43 }, 43 },
44 44
45 /** 45 /**
46 * Handles key up events. 46 * Handles key up events.
47 * @param {Event} evt The key down event to process. 47 * @param {Event} evt The key down event to process.
48 * @return {boolean} True if the default action should be performed. 48 * @return {boolean} True if the default action should be performed.
49 */ 49 */
50 onKeyUp: function(evt) { 50 onKeyUp: function(evt) {
51 // Reset pass through mode once a keyup (not involving the pass through key) 51 // Reset pass through mode once a keyup (not involving the pass through key)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (oldMode && 85 if (oldMode &&
86 oldMode != ChromeVoxMode.CLASSIC && 86 oldMode != ChromeVoxMode.CLASSIC &&
87 oldMode != ChromeVoxMode.COMPAT) { 87 oldMode != ChromeVoxMode.COMPAT) {
88 // The user's configured key map gets wiped here; this is consistent 88 // The user's configured key map gets wiped here; this is consistent
89 // with previous behavior when switching keymaps. 89 // with previous behavior when switching keymaps.
90 window['prefs'].switchToKeyMap('keymap_next'); 90 window['prefs'].switchToKeyMap('keymap_next');
91 } 91 }
92 } 92 }
93 } 93 }
94 }; 94 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698