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

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

Issue 1456693002: Make ChromeVox Next swallow key events that correspond to commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra line Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
index 05b2009312576a97e48bd8d84413efacd2c26fbd..4c04953b4c4de4423ef5c1fad28d83138dc4043f 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
@@ -119,8 +119,7 @@ Background = function() {
cvox.ExtensionBridge.addMessageListener(this.onMessage_);
- document.addEventListener(
- 'keydown', cvox.ChromeVoxKbHandler.basicKeyDownActionsListener, true);
+ document.addEventListener('keydown', this.onKeyDown.bind(this), true);
cvox.ChromeVoxKbHandler.commandHandler = this.onGotCommand.bind(this);
// Classic keymap.
@@ -413,6 +412,18 @@ Background.prototype = {
},
/**
+ * Handles key down events.
+ * @param {Event} evt The key down event to process.
+ * @return {boolean} True if the default action should be performed.
+ */
+ onKeyDown: function(evt) {
+ if (!cvox.ChromeVoxKbHandler.basicKeyDownActionsListener(evt)) {
David Tseng 2015/11/19 01:11:50 Sorry missed something here. This needs to be mode
+ evt.preventDefault();
+ evt.stopPropagation();
+ }
+ },
+
+ /**
* Open the options page in a new tab.
*/
showOptionsPage: function() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698