| 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 27b173d0fe216eaed357c6d1c6b25a307dd96f7f..65d50b534af82e8506453239fb51244b62b86c7a 100644
|
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
|
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
|
| @@ -89,7 +89,9 @@ Background = function() {
|
| menuStart: this.onEventDefault,
|
| menuEnd: this.onEventDefault,
|
| loadComplete: this.onLoadComplete,
|
| - textSelectionChanged: this.onTextSelectionChanged
|
| + textChanged: this.onTextOrTextSelectionChanged,
|
| + textSelectionChanged: this.onTextOrTextSelectionChanged,
|
| + valueChanged: this.onEventDefault
|
| };
|
|
|
| // Register listeners for ...
|
| @@ -98,9 +100,6 @@ Background = function() {
|
|
|
| // Tabs.
|
| chrome.tabs.onUpdated.addListener(this.onTabUpdated);
|
| -
|
| - // Commands.
|
| - chrome.commands.onCommand.addListener(this.onGotCommand);
|
| };
|
|
|
| Background.prototype = {
|
| @@ -244,6 +243,12 @@ Background.prototype = {
|
|
|
| var prevRange = this.currentRange_;
|
| this.currentRange_ = cursors.Range.fromNode(node);
|
| +
|
| + // Don't process nodes inside of web content if ChromeVox Next is inactive.
|
| + if (node.root.role == chrome.automation.RoleType.rootWebArea &&
|
| + !this.active_)
|
| + return;
|
| +
|
| new Output(this.currentRange_, prevRange, evt.type);
|
| },
|
|
|
| @@ -266,7 +271,7 @@ Background.prototype = {
|
| * Provides all feedback once a text selection change event fires.
|
| * @param {Object} evt
|
| */
|
| - onTextSelectionChanged: function(evt) {
|
| + onTextOrTextSelectionChanged: function(evt) {
|
| if (!this.currentRange_)
|
| this.currentRange_ = cursors.Range.fromNode(evt.target);
|
|
|
| @@ -287,6 +292,7 @@ Background.prototype = {
|
| }
|
|
|
| this.editableTextHandler.changed(textChangeEvent);
|
| + new Output(this.currentRange_, null, evt.type, {braille: true});
|
| },
|
|
|
| /**
|
| @@ -323,9 +329,15 @@ Background.prototype = {
|
| }
|
|
|
| if (opt_options.next) {
|
| + if (!chrome.commands.onCommand.hasListener(this.onGotCommand))
|
| + chrome.commands.onCommand.addListener(this.onGotCommand);
|
| +
|
| chrome.automation.getTree(this.onGotTree);
|
| this.active_ = true;
|
| } else {
|
| + if (chrome.commands.onCommand.hasListener(this.onGotCommand))
|
| + chrome.commands.onCommand.removeListener(this.onGotCommand);
|
| +
|
| if (this.active_) {
|
| for (var eventType in this.listeners_) {
|
| this.currentRange_.getStart().getNode().root.removeEventListener(
|
|
|