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

Unified Diff: chrome/renderer/resources/extensions/automation/automation_node.js

Issue 1413423003: Move some AX attrs from AXNodeData to AXTreeData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/renderer/resources/extensions/automation/automation_node.js
diff --git a/chrome/renderer/resources/extensions/automation/automation_node.js b/chrome/renderer/resources/extensions/automation/automation_node.js
index ed76dcd596d4d67355ae9627c5913ee2f257a48e..4ab10436acc14ec7aba635e218c20aa2140ecce4 100644
--- a/chrome/renderer/resources/extensions/automation/automation_node.js
+++ b/chrome/renderer/resources/extensions/automation/automation_node.js
@@ -16,6 +16,55 @@ var GetRootID = requireNative('automationInternal').GetRootID;
/**
* @param {number} axTreeID The id of the accessibility tree.
+ * @return {?string} The title of the document.
+ */
+var GetDocTitle = requireNative('automationInternal').GetDocTitle;
+
+/**
+ * @param {number} axTreeID The id of the accessibility tree.
+ * @return {?string} The url of the document.
+ */
+var GetDocURL = requireNative('automationInternal').GetDocURL;
+
+/**
+ * @param {number} axTreeID The id of the accessibility tree.
+ * @return {?boolean} True if the document has finished loading.
+ */
+var GetDocLoaded = requireNative('automationInternal').GetDocLoaded;
+
+/**
+ * @param {number} axTreeID The id of the accessibility tree.
+ * @return {?number} The loading progress, from 0.0 to 1.0 (fully loaded).
+ */
+var GetDocLoadingProgress =
+ requireNative('automationInternal').GetDocLoadingProgress;
+
+/**
+ * @param {number} axTreeID The id of the accessibility tree.
+ * @return {?number} The ID of the selection anchor object.
+ */
+var GetAnchorObjectID = requireNative('automationInternal').GetAnchorObjectID;
+
+/**
+ * @param {number} axTreeID The id of the accessibility tree.
+ * @return {?number} The selection anchor offset.
+ */
+var GetAnchorOffset = requireNative('automationInternal').GetAnchorOffset;
+
+/**
+ * @param {number} axTreeID The id of the accessibility tree.
+ * @return {?number} The ID of the selection focus object.
+ */
+var GetFocusObjectID = requireNative('automationInternal').GetFocusObjectID;
+
+/**
+ * @param {number} axTreeID The id of the accessibility tree.
+ * @return {?number} The selection focus offset.
+ */
+var GetFocusOffset = requireNative('automationInternal').GetFocusOffset;
+
+/**
+ * @param {number} axTreeID The id of the accessibility tree.
* @param {number} nodeID The id of a node.
* @return {?number} The id of the node's parent, or undefined if it's the
* root of its tree or if the tree or node wasn't found.
@@ -509,10 +558,6 @@ var stringAttributes = [
'containerLiveStatus',
'description',
'display',
- 'docDoctype',
- 'docMimetype',
- 'docTitle',
- 'docUrl',
'dropeffect',
'help',
'htmlTag',
@@ -532,7 +577,6 @@ var boolAttributes = [
'canvasHasFallback',
'containerLiveAtomic',
'containerLiveBusy',
- 'docLoaded',
'grabbed',
'isAxTreeHost',
'liveAtomic',
@@ -540,11 +584,9 @@ var boolAttributes = [
'updateLocationOnly'];
var intAttributes = [
- 'anchorOffset',
'backgroundColor',
'color',
'colorValue',
- 'focusOffset',
'hierarchicalLevel',
'invalidState',
'posInSet',
@@ -571,8 +613,6 @@ var intAttributes = [
var nodeRefAttributes = [
['activedescendantId', 'activedescendant'],
- ['anchorObjectId', 'anchorObject'],
- ['focusObjectId', 'focusObject'],
['tableColumnHeaderId', 'tableColumnHeader'],
['tableHeaderId', 'tableHeader'],
['tableRowHeaderId', 'tableRowHeader'],
@@ -593,7 +633,6 @@ var nodeRefListAttributes = [
['uniqueCellIds', 'uniqueCells']];
var floatAttributes = [
- 'docLoadingProgress',
'valueForRange',
'minValueForRange',
'maxValueForRange',
@@ -775,6 +814,50 @@ AutomationRootNodeImpl.prototype = {
return result;
},
+ get docUrl() {
+ return GetDocURL(this.treeID);
+ },
+
+ get docTitle() {
+ return GetDocTitle(this.treeID);
+ },
+
+ get docLoaded() {
+ return GetDocLoaded(this.treeID);
+ },
+
+ get docLoadingProgress() {
+ return GetDocLoadingProgress(this.treeID);
+ },
+
+ get anchorObject() {
+ var id = GetAnchorObjectID(this.treeID);
+ if (id && id != -1)
+ return this.get(id);
+ else
+ return undefined;
+ },
+
+ get anchorOffset() {
+ var id = GetAnchorObjectID(this.treeID);
+ if (id && id != -1)
+ return GetAnchorOffset(this.treeID);
+ },
+
+ get focusObject() {
+ var id = GetFocusObjectID(this.treeID);
+ if (id && id != -1)
+ return this.get(id);
+ else
+ return undefined;
+ },
+
+ get focusOffset() {
+ var id = GetFocusObjectID(this.treeID);
+ if (id && id != -1)
+ return GetFocusOffset(this.treeID);
+ },
+
get: function(id) {
if (id == undefined)
return undefined;
@@ -869,7 +952,15 @@ var AutomationNode = utils.expose('AutomationNode',
var AutomationRootNode = utils.expose('AutomationRootNode',
AutomationRootNodeImpl,
- { superclass: AutomationNode });
+ { superclass: AutomationNode,
+ readonly: ['docTitle',
+ 'docUrl',
+ 'docLoaded',
+ 'docLoadingProgress',
+ 'anchorObject',
+ 'anchorOffset',
+ 'focusObject',
+ 'focusOffset'] });
AutomationRootNode.get = function(treeID) {
return AutomationRootNodeImpl.get(treeID);

Powered by Google App Engine
This is Rietveld 408576698