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

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

Issue 2873373005: Add custom action support (Closed)
Patch Set: Address comments. Created 3 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/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 95924e762c4510540b4d842bbc2383f0a481d5bb..88d657b7f771133b7c90a5b35b307d9a6c44a5ad 100644
--- a/chrome/renderer/resources/extensions/automation/automation_node.js
+++ b/chrome/renderer/resources/extensions/automation/automation_node.js
@@ -238,6 +238,14 @@ var GetHtmlAttribute = requireNative('automationInternal').GetHtmlAttribute;
*/
var GetNameFrom = requireNative('automationInternal').GetNameFrom;
+/**
+ * @param {number} axTreeID The id of the accessibility tree.
+ * @param {number} nodeID The id of a node.
+ * @return {?Array.<automation.CustomAction>} List of custom actions of the
+ * node.
+ */
+var GetCustomActions = requireNative('automationInternal').GetCustomActions;
+
var lastError = require('lastError');
var logging = requireNative('logging');
var utils = require('utils');
@@ -380,6 +388,10 @@ AutomationNodeImpl.prototype = {
return GetNameFrom(this.treeID, this.id);
},
+ get customActions() {
+ return GetCustomActions(this.treeID, this.id);
+ },
+
doDefault: function() {
this.performAction_('doDefault');
},
@@ -407,6 +419,10 @@ AutomationNodeImpl.prototype = {
this.performAction_('makeVisible');
},
+ performCustomAction: function(customActionId) {
+ this.performAction_('customAction', { customActionID: customActionId });
+ },
+
resumeMedia: function() {
this.performAction_('resumeMedia');
},
@@ -1107,6 +1123,7 @@ utils.expose(AutomationNode, AutomationNodeImpl, {
'hitTest',
'makeVisible',
'matches',
+ 'performCustomAction',
'resumeMedia',
'setSelection',
'setSequentialFocusNavigationStartingPoint',
@@ -1137,6 +1154,7 @@ utils.expose(AutomationNode, AutomationNodeImpl, {
'root',
'htmlAttributes',
'nameFrom',
+ 'customActions',
]),
});

Powered by Google App Engine
This is Rietveld 408576698