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

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

Issue 346703002: Small cleanups in automation_node.js. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nuke todo Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/api/automation.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 utils = require('utils'); 8 var utils = require('utils');
9 var IsInteractPermitted = 9 var IsInteractPermitted =
10 requireNative('automationInternal').IsInteractPermitted; 10 requireNative('automationInternal').IsInteractPermitted;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 var parent = this.parent(); 65 var parent = this.parent();
66 if (parent && this.indexInParent < parent.children().length) 66 if (parent && this.indexInParent < parent.children().length)
67 return parent.children()[this.indexInParent + 1]; 67 return parent.children()[this.indexInParent + 1];
68 return undefined; 68 return undefined;
69 }, 69 },
70 70
71 doDefault: function() { 71 doDefault: function() {
72 this.performAction_('doDefault'); 72 this.performAction_('doDefault');
73 }, 73 },
74 74
75 focus: function(opt_callback) { 75 focus: function() {
76 this.performAction_('focus'); 76 this.performAction_('focus');
77 }, 77 },
78 78
79 makeVisible: function(opt_callback) { 79 makeVisible: function() {
80 this.performAction_('makeVisible'); 80 this.performAction_('makeVisible');
81 }, 81 },
82 82
83 setSelection: function(startIndex, endIndex, opt_callback) { 83 setSelection: function(startIndex, endIndex) {
84 this.performAction_('setSelection', 84 this.performAction_('setSelection',
85 { startIndex: startIndex, 85 { startIndex: startIndex,
86 endIndex: endIndex }); 86 endIndex: endIndex });
87 }, 87 },
88 88
89 addEventListener: function(eventType, callback, capture) { 89 addEventListener: function(eventType, callback, capture) {
90 this.removeEventListener(eventType, callback); 90 this.removeEventListener(eventType, callback);
91 if (!this.listeners[eventType]) 91 if (!this.listeners[eventType])
92 this.listeners[eventType] = []; 92 this.listeners[eventType] = [];
93 this.listeners[eventType].push({callback: callback, capture: !!capture}); 93 this.listeners[eventType].push({callback: callback, capture: !!capture});
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 this.processID = processID; 246 this.processID = processID;
247 this.routingID = routingID; 247 this.routingID = routingID;
248 this.axNodeDataCache_ = {}; 248 this.axNodeDataCache_ = {};
249 } 249 }
250 250
251 AutomationRootNodeImpl.prototype = { 251 AutomationRootNodeImpl.prototype = {
252 __proto__: AutomationNodeImpl.prototype, 252 __proto__: AutomationNodeImpl.prototype,
253 253
254 isRootNode: true, 254 isRootNode: true,
255 255
256 load: function() {
257 throw new Error('Load is currently not supported.');
aboxhall 2014/06/30 21:57:54 I don't know if we want to throw an Error here - c
David Tseng 2014/06/30 23:02:24 I don't know if we want to fail/no-op silently; th
aboxhall 2014/06/30 23:03:36 I don't know if we want to train people not to cal
aboxhall 2014/06/30 23:04:25 If we don't want people to call it, we should prob
not at google - send to devlin 2014/06/30 23:05:01 Who implements a non-crashing version of load()?
David Tseng 2014/07/01 18:48:48 Ok...made this a no-op. The idea of having it in
aboxhall 2014/07/01 19:55:11 Right, I was just nervous that we might flip the f
258 },
259
256 get: function(id) { 260 get: function(id) {
257 return this.axNodeDataCache_[id]; 261 return this.axNodeDataCache_[id];
258 }, 262 },
259 263
260 invalidate: function(node) { 264 invalidate: function(node) {
261 if (!node) 265 if (!node)
262 return; 266 return;
263 267
264 var children = node.children(); 268 var children = node.children();
265 269
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 'attributes'] }); 395 'attributes'] });
392 396
393 var AutomationRootNode = utils.expose('AutomationRootNode', 397 var AutomationRootNode = utils.expose('AutomationRootNode',
394 AutomationRootNodeImpl, 398 AutomationRootNodeImpl,
395 { superclass: AutomationNode, 399 { superclass: AutomationNode,
396 functions: ['load'], 400 functions: ['load'],
397 readonly: ['loaded'] }); 401 readonly: ['loaded'] });
398 402
399 exports.AutomationNode = AutomationNode; 403 exports.AutomationNode = AutomationNode;
400 exports.AutomationRootNode = AutomationRootNode; 404 exports.AutomationRootNode = AutomationRootNode;
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/automation.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698