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

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

Issue 2550593003: Expose media controls to accessibility (Closed)
Patch Set: Expose ducking controls to accessibility Created 4 years 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 getImageData: function(maxWidth, maxHeight) { 370 getImageData: function(maxWidth, maxHeight) {
371 this.performAction_('getImageData', 371 this.performAction_('getImageData',
372 { maxWidth: maxWidth, 372 { maxWidth: maxWidth,
373 maxHeight: maxHeight }); 373 maxHeight: maxHeight });
374 }, 374 },
375 375
376 makeVisible: function() { 376 makeVisible: function() {
377 this.performAction_('makeVisible'); 377 this.performAction_('makeVisible');
378 }, 378 },
379 379
380 resumeMedia: function() {
381 this.performAction_('resumeMedia');
382 },
383
380 setSelection: function(startIndex, endIndex) { 384 setSelection: function(startIndex, endIndex) {
381 if (this.role == 'textField' || this.role == 'textBox') { 385 if (this.role == 'textField' || this.role == 'textBox') {
382 this.performAction_('setSelection', 386 this.performAction_('setSelection',
383 { focusNodeID: this.id, 387 { focusNodeID: this.id,
384 anchorOffset: startIndex, 388 anchorOffset: startIndex,
385 focusOffset: endIndex }); 389 focusOffset: endIndex });
386 } 390 }
387 }, 391 },
388 392
389 setSequentialFocusNavigationStartingPoint: function() { 393 setSequentialFocusNavigationStartingPoint: function() {
390 this.performAction_('setSequentialFocusNavigationStartingPoint'); 394 this.performAction_('setSequentialFocusNavigationStartingPoint');
391 }, 395 },
392 396
393 showContextMenu: function() { 397 showContextMenu: function() {
394 this.performAction_('showContextMenu'); 398 this.performAction_('showContextMenu');
395 }, 399 },
396 400
401 startDuckingMedia: function() {
402 this.performAction_('startDuckingMedia');
403 },
404
405 stopDuckingMedia: function() {
406 this.performAction_('stopDuckingMedia');
407 },
408
409 suspendMedia: function() {
410 this.performAction_('suspendMedia');
411 },
412
397 domQuerySelector: function(selector, callback) { 413 domQuerySelector: function(selector, callback) {
398 if (!this.rootImpl) 414 if (!this.rootImpl)
399 callback(); 415 callback();
400 automationInternal.querySelector( 416 automationInternal.querySelector(
401 { treeID: this.rootImpl.treeID, 417 { treeID: this.rootImpl.treeID,
402 automationNodeID: this.id, 418 automationNodeID: this.id,
403 selector: selector }, 419 selector: selector },
404 $Function.bind(this.domQuerySelectorCallback_, this, callback)); 420 $Function.bind(this.domQuerySelectorCallback_, this, callback));
405 }, 421 },
406 422
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 } 1081 }
1066 utils.expose(AutomationNode, AutomationNodeImpl, { 1082 utils.expose(AutomationNode, AutomationNodeImpl, {
1067 functions: [ 1083 functions: [
1068 'doDefault', 1084 'doDefault',
1069 'find', 1085 'find',
1070 'findAll', 1086 'findAll',
1071 'focus', 1087 'focus',
1072 'getImageData', 1088 'getImageData',
1073 'makeVisible', 1089 'makeVisible',
1074 'matches', 1090 'matches',
1091 'resumeMedia',
1075 'setSelection', 1092 'setSelection',
1076 'setSequentialFocusNavigationStartingPoint', 1093 'setSequentialFocusNavigationStartingPoint',
1077 'showContextMenu', 1094 'showContextMenu',
1095 'startDuckingMedia',
1096 'stopDuckingMedia',
1097 'suspendMedia',
1078 'addEventListener', 1098 'addEventListener',
1079 'removeEventListener', 1099 'removeEventListener',
1080 'domQuerySelector', 1100 'domQuerySelector',
1081 'toString', 1101 'toString',
1082 'boundsForRange', 1102 'boundsForRange',
1083 ], 1103 ],
1084 readonly: $Array.concat(publicAttributes, [ 1104 readonly: $Array.concat(publicAttributes, [
1085 'parent', 1105 'parent',
1086 'firstChild', 1106 'firstChild',
1087 'lastChild', 1107 'lastChild',
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { 1145 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) {
1126 return AutomationRootNodeImpl.getOrCreate(treeID); 1146 return AutomationRootNodeImpl.getOrCreate(treeID);
1127 }); 1147 });
1128 1148
1129 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { 1149 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) {
1130 AutomationRootNodeImpl.destroy(treeID); 1150 AutomationRootNodeImpl.destroy(treeID);
1131 }); 1151 });
1132 1152
1133 exports.$set('AutomationNode', AutomationNode); 1153 exports.$set('AutomationNode', AutomationNode);
1134 exports.$set('AutomationRootNode', AutomationRootNode); 1154 exports.$set('AutomationRootNode', AutomationRootNode);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698