OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var AutomationEvent = require('automationEvent').AutomationEvent; | 5 var AutomationEvent = require('automationEvent').AutomationEvent; |
6 var automationInternal = | 6 var automationInternal = |
7 require('binding').Binding.create('automationInternal').generate(); | 7 require('binding').Binding.create('automationInternal').generate(); |
8 var IsInteractPermitted = | 8 var IsInteractPermitted = |
9 requireNative('automationInternal').IsInteractPermitted; | 9 requireNative('automationInternal').IsInteractPermitted; |
10 | 10 |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 237 |
238 focus: function() { | 238 focus: function() { |
239 this.performAction_('focus'); | 239 this.performAction_('focus'); |
240 }, | 240 }, |
241 | 241 |
242 makeVisible: function() { | 242 makeVisible: function() { |
243 this.performAction_('makeVisible'); | 243 this.performAction_('makeVisible'); |
244 }, | 244 }, |
245 | 245 |
246 setSelection: function(startIndex, endIndex) { | 246 setSelection: function(startIndex, endIndex) { |
247 this.performAction_('setSelection', | 247 if (this.role == 'textField' || this.role == 'textBox') { |
248 { startIndex: startIndex, | 248 this.performAction_('setSelection', |
249 endIndex: endIndex }); | 249 { focusNodeID: this.id, |
| 250 anchorOffset: startIndex, |
| 251 focusOffset: endIndex }); |
| 252 } |
250 }, | 253 }, |
251 | 254 |
252 showContextMenu: function() { | 255 showContextMenu: function() { |
253 this.performAction_('showContextMenu'); | 256 this.performAction_('showContextMenu'); |
254 }, | 257 }, |
255 | 258 |
256 domQuerySelector: function(selector, callback) { | 259 domQuerySelector: function(selector, callback) { |
257 automationInternal.querySelector( | 260 automationInternal.querySelector( |
258 { treeID: this.rootImpl.treeID, | 261 { treeID: this.rootImpl.treeID, |
259 automationNodeID: this.id, | 262 automationNodeID: this.id, |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 AutomationRootNode.getOrCreate = function(treeID) { | 878 AutomationRootNode.getOrCreate = function(treeID) { |
876 return AutomationRootNodeImpl.getOrCreate(treeID); | 879 return AutomationRootNodeImpl.getOrCreate(treeID); |
877 } | 880 } |
878 | 881 |
879 AutomationRootNode.destroy = function(treeID) { | 882 AutomationRootNode.destroy = function(treeID) { |
880 AutomationRootNodeImpl.destroy(treeID); | 883 AutomationRootNodeImpl.destroy(treeID); |
881 } | 884 } |
882 | 885 |
883 exports.AutomationNode = AutomationNode; | 886 exports.AutomationNode = AutomationNode; |
884 exports.AutomationRootNode = AutomationRootNode; | 887 exports.AutomationRootNode = AutomationRootNode; |
OLD | NEW |