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

Side by Side Diff: chrome/renderer/resources/extensions/automation/automation_node.js

Issue 1365433002: Add setSelection function to automation API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nobrailleautostartintests
Patch Set: Change setDocumentSelection to take named arguments. 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 unified diff | Download patch
OLDNEW
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
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
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;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698