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 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 * @param {number} axTreeID The id of the accessibility tree. | 128 * @param {number} axTreeID The id of the accessibility tree. |
129 * @param {number} nodeID The id of a node. | 129 * @param {number} nodeID The id of a node. |
130 * @return {?Object} An object with a string key for every state flag set, | 130 * @return {?Object} An object with a string key for every state flag set, |
131 * or undefined if the tree or node or node parent wasn't found. | 131 * or undefined if the tree or node or node parent wasn't found. |
132 */ | 132 */ |
133 var GetState = requireNative('automationInternal').GetState; | 133 var GetState = requireNative('automationInternal').GetState; |
134 | 134 |
135 /** | 135 /** |
136 * @param {number} axTreeID The id of the accessibility tree. | 136 * @param {number} axTreeID The id of the accessibility tree. |
137 * @param {number} nodeID The id of a node. | 137 * @param {number} nodeID The id of a node. |
| 138 * @return {string} The checked state, as undefined, "true", "false" or "mixed". |
| 139 */ |
| 140 var GetChecked = requireNative('automationInternal').GetChecked; |
| 141 |
| 142 /** |
| 143 * @param {number} axTreeID The id of the accessibility tree. |
| 144 * @param {number} nodeID The id of a node. |
138 * @return {string} The role of the node, or undefined if the tree or | 145 * @return {string} The role of the node, or undefined if the tree or |
139 * node wasn't found. | 146 * node wasn't found. |
140 */ | 147 */ |
141 var GetRole = requireNative('automationInternal').GetRole; | 148 var GetRole = requireNative('automationInternal').GetRole; |
142 | 149 |
143 /** | 150 /** |
144 * @param {number} axTreeID The id of the accessibility tree. | 151 * @param {number} axTreeID The id of the accessibility tree. |
145 * @param {number} nodeID The id of a node. | 152 * @param {number} nodeID The id of a node. |
146 * @return {?automation.Rect} The location of the node, or undefined if | 153 * @return {?automation.Rect} The location of the node, or undefined if |
147 * the tree or node wasn't found. | 154 * the tree or node wasn't found. |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 }, | 283 }, |
277 | 284 |
278 get state() { | 285 get state() { |
279 return GetState(this.treeID, this.id) || {}; | 286 return GetState(this.treeID, this.id) || {}; |
280 }, | 287 }, |
281 | 288 |
282 get role() { | 289 get role() { |
283 return GetRole(this.treeID, this.id); | 290 return GetRole(this.treeID, this.id); |
284 }, | 291 }, |
285 | 292 |
| 293 get checked() { |
| 294 return GetChecked(this.treeID, this.id); |
| 295 }, |
| 296 |
286 get location() { | 297 get location() { |
287 return GetLocation(this.treeID, this.id); | 298 return GetLocation(this.treeID, this.id); |
288 }, | 299 }, |
289 | 300 |
290 boundsForRange: function(startIndex, endIndex) { | 301 boundsForRange: function(startIndex, endIndex) { |
291 return GetBoundsForRange(this.treeID, this.id, startIndex, endIndex); | 302 return GetBoundsForRange(this.treeID, this.id, startIndex, endIndex); |
292 }, | 303 }, |
293 | 304 |
294 get indexInParent() { | 305 get indexInParent() { |
295 return GetIndexInParent(this.treeID, this.id); | 306 return GetIndexInParent(this.treeID, this.id); |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 'liveRelevant', | 700 'liveRelevant', |
690 'liveStatus', | 701 'liveStatus', |
691 'name', | 702 'name', |
692 'placeholder', | 703 'placeholder', |
693 'textInputType', | 704 'textInputType', |
694 'url', | 705 'url', |
695 'value']; | 706 'value']; |
696 | 707 |
697 var boolAttributes = [ | 708 var boolAttributes = [ |
698 'ariaReadonly', | 709 'ariaReadonly', |
699 'buttonMixed', | |
700 'containerLiveAtomic', | 710 'containerLiveAtomic', |
701 'containerLiveBusy', | 711 'containerLiveBusy', |
702 'liveAtomic', | 712 'liveAtomic', |
703 'liveBusy']; | 713 'liveBusy']; |
704 | 714 |
705 var intAttributes = [ | 715 var intAttributes = [ |
706 'backgroundColor', | 716 'backgroundColor', |
707 'color', | 717 'color', |
708 'colorValue', | 718 'colorValue', |
709 'hierarchicalLevel', | 719 'hierarchicalLevel', |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 ], | 1105 ], |
1096 readonly: $Array.concat(publicAttributes, [ | 1106 readonly: $Array.concat(publicAttributes, [ |
1097 'parent', | 1107 'parent', |
1098 'firstChild', | 1108 'firstChild', |
1099 'lastChild', | 1109 'lastChild', |
1100 'children', | 1110 'children', |
1101 'previousSibling', | 1111 'previousSibling', |
1102 'nextSibling', | 1112 'nextSibling', |
1103 'isRootNode', | 1113 'isRootNode', |
1104 'role', | 1114 'role', |
| 1115 'checked', |
1105 'state', | 1116 'state', |
1106 'location', | 1117 'location', |
1107 'indexInParent', | 1118 'indexInParent', |
1108 'lineStartOffsets', | 1119 'lineStartOffsets', |
1109 'root', | 1120 'root', |
1110 'htmlAttributes', | 1121 'htmlAttributes', |
1111 'nameFrom', | 1122 'nameFrom', |
1112 ]), | 1123 ]), |
1113 }); | 1124 }); |
1114 | 1125 |
(...skipping 24 matching lines...) Expand all Loading... |
1139 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { | 1150 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { |
1140 return AutomationRootNodeImpl.getOrCreate(treeID); | 1151 return AutomationRootNodeImpl.getOrCreate(treeID); |
1141 }); | 1152 }); |
1142 | 1153 |
1143 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { | 1154 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { |
1144 AutomationRootNodeImpl.destroy(treeID); | 1155 AutomationRootNodeImpl.destroy(treeID); |
1145 }); | 1156 }); |
1146 | 1157 |
1147 exports.$set('AutomationNode', AutomationNode); | 1158 exports.$set('AutomationNode', AutomationNode); |
1148 exports.$set('AutomationRootNode', AutomationRootNode); | 1159 exports.$set('AutomationRootNode', AutomationRootNode); |
OLD | NEW |