Chromium Code Reviews| 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..0ff15df5a4e5ea923a52e3ad9164026eead43a5b 100644 |
| --- a/chrome/renderer/resources/extensions/automation/automation_node.js |
| +++ b/chrome/renderer/resources/extensions/automation/automation_node.js |
| @@ -238,6 +238,8 @@ var GetHtmlAttribute = requireNative('automationInternal').GetHtmlAttribute; |
| */ |
| var GetNameFrom = requireNative('automationInternal').GetNameFrom; |
| +var GetCustomActions = requireNative('automationInternal').GetCustomActions; |
| + |
| var lastError = require('lastError'); |
| var logging = requireNative('logging'); |
| var utils = require('utils'); |
| @@ -380,6 +382,10 @@ AutomationNodeImpl.prototype = { |
| return GetNameFrom(this.treeID, this.id); |
| }, |
| + get customActions() { |
| + return GetCustomActions(this.treeID, this.id); |
| + }, |
| + |
| doDefault: function() { |
| this.performAction_('doDefault'); |
| }, |
| @@ -407,6 +413,13 @@ AutomationNodeImpl.prototype = { |
| this.performAction_('makeVisible'); |
| }, |
| + performCustomAction: function(customAction) { |
| + if (!customAction.id) |
| + return; |
| + |
| + this.performAction_('customAction', { customActionID: customAction.id }); |
|
David Tseng
2017/06/08 17:21:59
customAction.description unused here.
|
| + }, |
| + |
| resumeMedia: function() { |
| this.performAction_('resumeMedia'); |
| }, |
| @@ -1107,6 +1120,7 @@ utils.expose(AutomationNode, AutomationNodeImpl, { |
| 'hitTest', |
| 'makeVisible', |
| 'matches', |
| + 'performCustomAction', |
| 'resumeMedia', |
| 'setSelection', |
| 'setSequentialFocusNavigationStartingPoint', |
| @@ -1137,6 +1151,7 @@ utils.expose(AutomationNode, AutomationNodeImpl, { |
| 'root', |
| 'htmlAttributes', |
| 'nameFrom', |
| + 'customActions', |
| ]), |
| }); |