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

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

Issue 2873373005: Add custom action support (Closed)
Patch Set: Rebase. Created 3 years, 7 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 exceptionHandler = require('uncaught_exception_handler'); 8 var exceptionHandler = require('uncaught_exception_handler');
9 var IsInteractPermitted = 9 var IsInteractPermitted =
10 requireNative('automationInternal').IsInteractPermitted; 10 requireNative('automationInternal').IsInteractPermitted;
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 */ 231 */
232 var GetHtmlAttribute = requireNative('automationInternal').GetHtmlAttribute; 232 var GetHtmlAttribute = requireNative('automationInternal').GetHtmlAttribute;
233 233
234 /** 234 /**
235 * @param {number} axTreeID The id of the accessibility tree. 235 * @param {number} axTreeID The id of the accessibility tree.
236 * @param {number} nodeID The id of a node. 236 * @param {number} nodeID The id of a node.
237 * @return {automation.NameFromType} The source of the node's name. 237 * @return {automation.NameFromType} The source of the node's name.
238 */ 238 */
239 var GetNameFrom = requireNative('automationInternal').GetNameFrom; 239 var GetNameFrom = requireNative('automationInternal').GetNameFrom;
240 240
241 var GetCustomActions = requireNative('automationInternal').GetCustomActions;
242
241 var lastError = require('lastError'); 243 var lastError = require('lastError');
242 var logging = requireNative('logging'); 244 var logging = requireNative('logging');
243 var utils = require('utils'); 245 var utils = require('utils');
244 246
245 /** 247 /**
246 * A single node in the Automation tree. 248 * A single node in the Automation tree.
247 * @param {AutomationRootNodeImpl} root The root of the tree. 249 * @param {AutomationRootNodeImpl} root The root of the tree.
248 * @constructor 250 * @constructor
249 */ 251 */
250 function AutomationNodeImpl(root) { 252 function AutomationNodeImpl(root) {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 parent = privates(parent).impl; 375 parent = privates(parent).impl;
374 var indexInParent = GetIndexInParent(this.treeID, this.id); 376 var indexInParent = GetIndexInParent(this.treeID, this.id);
375 return this.rootImpl.get( 377 return this.rootImpl.get(
376 GetChildIDAtIndex(parent.treeID, parent.id, indexInParent + 1)); 378 GetChildIDAtIndex(parent.treeID, parent.id, indexInParent + 1));
377 }, 379 },
378 380
379 get nameFrom() { 381 get nameFrom() {
380 return GetNameFrom(this.treeID, this.id); 382 return GetNameFrom(this.treeID, this.id);
381 }, 383 },
382 384
385 get customActions() {
386 return GetCustomActions(this.treeID, this.id);
387 },
388
383 doDefault: function() { 389 doDefault: function() {
384 this.performAction_('doDefault'); 390 this.performAction_('doDefault');
385 }, 391 },
386 392
387 focus: function() { 393 focus: function() {
388 this.performAction_('focus'); 394 this.performAction_('focus');
389 }, 395 },
390 396
391 getImageData: function(maxWidth, maxHeight) { 397 getImageData: function(maxWidth, maxHeight) {
392 this.performAction_('getImageData', 398 this.performAction_('getImageData',
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 'isRootNode', 1135 'isRootNode',
1130 'role', 1136 'role',
1131 'checked', 1137 'checked',
1132 'state', 1138 'state',
1133 'location', 1139 'location',
1134 'indexInParent', 1140 'indexInParent',
1135 'lineStartOffsets', 1141 'lineStartOffsets',
1136 'root', 1142 'root',
1137 'htmlAttributes', 1143 'htmlAttributes',
1138 'nameFrom', 1144 'nameFrom',
1145 'customActions',
1139 ]), 1146 ]),
1140 }); 1147 });
1141 1148
1142 function AutomationRootNode() { 1149 function AutomationRootNode() {
1143 privates(AutomationRootNode).constructPrivate(this, arguments); 1150 privates(AutomationRootNode).constructPrivate(this, arguments);
1144 } 1151 }
1145 utils.expose(AutomationRootNode, AutomationRootNodeImpl, { 1152 utils.expose(AutomationRootNode, AutomationRootNodeImpl, {
1146 superclass: AutomationNode, 1153 superclass: AutomationNode,
1147 readonly: [ 1154 readonly: [
1148 'chromeChannel', 1155 'chromeChannel',
(...skipping 17 matching lines...) Expand all
1166 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { 1173 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) {
1167 return AutomationRootNodeImpl.getOrCreate(treeID); 1174 return AutomationRootNodeImpl.getOrCreate(treeID);
1168 }); 1175 });
1169 1176
1170 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { 1177 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) {
1171 AutomationRootNodeImpl.destroy(treeID); 1178 AutomationRootNodeImpl.destroy(treeID);
1172 }); 1179 });
1173 1180
1174 exports.$set('AutomationNode', AutomationNode); 1181 exports.$set('AutomationNode', AutomationNode);
1175 exports.$set('AutomationRootNode', AutomationRootNode); 1182 exports.$set('AutomationRootNode', AutomationRootNode);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698