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..acc665d5faa6501bf0fa746c7b5047d31823d4f0 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,19 @@ Background.prototype = { |
}, |
/** |
+ * Handles key down events. |
+ * |
David Tseng
2015/11/17 20:42:00
nit: extra line
dmazzoni
2015/11/18 16:59:16
Done.
|
+ * @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)) { |
+ evt.preventDefault(); |
+ evt.stopPropagation(); |
+ } |
+ }, |
+ |
+ /** |
* Open the options page in a new tab. |
*/ |
showOptionsPage: function() { |