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

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

Issue 779103002: Revert of Various changes required to support ChromeVox Next to read Views and Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
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 55267e68967b519680d92ef3cfbde67d85e73f0a..27b173d0fe216eaed357c6d1c6b25a307dd96f7f 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
@@ -86,13 +86,10 @@
this.listeners_ = {
alert: this.onEventDefault,
focus: this.onEventDefault,
- hover: this.onEventDefault,
menuStart: this.onEventDefault,
menuEnd: this.onEventDefault,
loadComplete: this.onLoadComplete,
- textChanged: this.onTextOrTextSelectionChanged,
- textSelectionChanged: this.onTextOrTextSelectionChanged,
- valueChanged: this.onEventDefault
+ textSelectionChanged: this.onTextSelectionChanged
};
// Register listeners for ...
@@ -101,6 +98,9 @@
// Tabs.
chrome.tabs.onUpdated.addListener(this.onTabUpdated);
+
+ // Commands.
+ chrome.commands.onCommand.addListener(this.onGotCommand);
};
Background.prototype = {
@@ -117,11 +117,6 @@
return;
var next = this.isWhitelisted_(tab.url);
-
- // Only care about Next for now.
- if (!next)
- return;
-
this.toggleChromeVoxVersion({next: next, classic: !next});
}.bind(this));
},
@@ -244,17 +239,11 @@
*/
onEventDefault: function(evt) {
var node = evt.target;
-
if (!node)
return;
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.desktop && !this.active_)
- return;
-
new Output(this.currentRange_, prevRange, evt.type);
},
@@ -277,14 +266,9 @@
* Provides all feedback once a text selection change event fires.
* @param {Object} evt
*/
- onTextOrTextSelectionChanged: function(evt) {
- if (!this.currentRange_) {
- if (!evt.target.state.focused)
- return;
-
- this.onEventDefault(evt);
+ onTextSelectionChanged: function(evt) {
+ if (!this.currentRange_)
this.currentRange_ = cursors.Range.fromNode(evt.target);
- }
var textChangeEvent = new cvox.TextChangeEvent(
evt.target.attributes.value,
@@ -303,7 +287,6 @@
}
this.editableTextHandler.changed(textChangeEvent);
- new Output(this.currentRange_, null, evt.type, {braille: true});
},
/**
@@ -340,16 +323,9 @@
}
if (opt_options.next) {
- if (!chrome.commands.onCommand.hasListener(this.onGotCommand))
- chrome.commands.onCommand.addListener(this.onGotCommand);
-
- if (!this.active_)
- chrome.automation.getTree(this.onGotTree);
+ 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(

Powered by Google App Engine
This is Rietveld 408576698