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

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

Issue 2092743002: Revert of Make ChromeVox Next a setting in options page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
index be3ffc717e0bbc8b173c64a5b6041c92cadcdb57..d5da5072a72ead8998c936abee769ddb2527936f 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
@@ -98,6 +98,13 @@
ChromeVoxState.instance.setCurrentRange(cursors.Range.fromNode(node));
+ // Check to see if we've crossed roots. Continue if we've crossed roots or
+ // are not within web content.
+ if (node.root.role == RoleType.desktop ||
+ !prevRange ||
+ prevRange.start.node.root != node.root)
+ ChromeVoxState.instance.refreshMode(node.root);
+
// Don't process nodes inside of web content if ChromeVox Next is inactive.
if (node.root.role != RoleType.desktop &&
ChromeVoxState.instance.mode === ChromeVoxMode.CLASSIC) {
@@ -131,7 +138,7 @@
onEventIfInRange: function(evt) {
// TODO(dtseng): Consider the end of the current range as well.
if (AutomationUtil.isDescendantOf(
- ChromeVoxState.instance.currentRange.start.node, evt.target) ||
+ global.backgroundObj.currentRange.start.node, evt.target) ||
evt.target.state.focused)
this.onEventDefault(evt);
},
@@ -225,6 +232,8 @@
* @param {!AutomationEvent} evt
*/
onLoadComplete: function(evt) {
+ ChromeVoxState.instance.refreshMode(evt.target);
+
// Don't process nodes inside of web content if ChromeVox Next is inactive.
if (evt.target.root.role != RoleType.desktop &&
ChromeVoxState.instance.mode === ChromeVoxMode.CLASSIC)
@@ -324,7 +333,7 @@
if (t.state.focused ||
t.root.role == RoleType.desktop ||
AutomationUtil.isDescendantOf(
- ChromeVoxState.instance.currentRange.start.node, t)) {
+ global.backgroundObj.currentRange.start.node, t)) {
if (new Date() - this.lastValueChanged_ <=
DesktopAutomationHandler.VMIN_VALUE_CHANGE_DELAY_MS)
return;
@@ -370,7 +379,7 @@
* @param {!AutomationEvent} evt
*/
onMenuStart: function(evt) {
- ChromeVoxState.instance.startExcursion();
+ global.backgroundObj.startExcursion();
this.onEventDefault(evt);
},
@@ -380,7 +389,7 @@
*/
onMenuEnd: function(evt) {
this.onEventDefault(evt);
- ChromeVoxState.instance.endExcursion();
+ global.backgroundObj.endExcursion();
},
/**
@@ -403,8 +412,7 @@
if (cvox.ChromeVox.isMac)
return;
chrome.automation.getDesktop(function(desktop) {
- ChromeVoxState.desktopAutomationHandler =
- new DesktopAutomationHandler(desktop);
+ global.desktopAutomationHandler = new DesktopAutomationHandler(desktop);
});
};

Powered by Google App Engine
This is Rietveld 408576698