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

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

Issue 2093753002: Reland: 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/automation_util.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js
index 4821a332f4833688fd7da90f6ac979a270a6d260..687128a094fe0660f376b9dd56251cb5ebb4e81f 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util.js
@@ -291,4 +291,23 @@ AutomationUtil.hitTest = function(node, point) {
return null;
};
+/**
+ * Gets a top level root.
+ * @param {!AutomationNode} node
+ * @return {AutomationNode}
+ */
+AutomationUtil.getTopLevelRoot = function(node) {
+ var root = node.root;
+ if (!root || root.role == RoleType.desktop)
+ return null;
+
+ while (root &&
+ root.parent &&
+ root.parent.root &&
+ root.parent.root.role != RoleType.desktop) {
+ root = root.parent.root;
+ }
+ return root;
+};
+
}); // goog.scope

Powered by Google App Engine
This is Rietveld 408576698