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 19e4cb815f870e475db45e672f9f85481b2944dc..e1d44b9f8402bdbb699c8232dc35a247fee12bbc 100644 |
--- a/chrome/renderer/resources/extensions/automation/automation_node.js |
+++ b/chrome/renderer/resources/extensions/automation/automation_node.js |
@@ -2,6 +2,10 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+// TODO(dtseng): Figure out if there's any other way to get access to |
+// AutomationInternal. |
+var automationInternal = |
+ require('binding').Binding.create('automationInternal').generate(); |
var utils = require('utils'); |
/** |
@@ -52,8 +56,27 @@ AutomationNodeImpl.prototype = { |
return parent.children()[this.index_in_parent + 1]; |
return undefined; |
}, |
-}; |
+ doDefault: function() { |
+ AutomationInternal.performAction( |
+ 'doDefault', this.owner.process_id, this.id) |
+ }, |
+ |
+ focus: function() { |
+ AutomationInternal.performAction( |
+ 'focus', this.owner.process_id, this.id) |
+ }, |
+ |
+ makeVisible: function() { |
+ AutomationInternal.performAction( |
+ 'makeVisible', this.owner.process_id, this.id) |
+ }, |
+ |
+ setSelection: function(startIndex, endIndex) { |
+ AutomationInternal.performAction( |
+ 'setSelection', this.owner.process_id, this.id, [startIndex, endIndex]); |
+ }, |
+}; |
var AutomationNode = utils.expose('AutomationNode', |
AutomationNodeImpl, |
@@ -62,5 +85,9 @@ var AutomationNode = utils.expose('AutomationNode', |
'lastChild', |
'children', |
'previousSibling', |
- 'nextSibling']); |
+ 'nextSibling', |
+ 'doDefault', |
+ 'focus', |
+ 'makeVisible', |
+ 'setSelection']); |
exports.AutomationNode = AutomationNode; |