| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 /** |
| 242 * @param {number} axTreeID The id of the accessibility tree. |
| 243 * @param {number} nodeID The id of a node. |
| 244 * @return {boolean} |
| 245 */ |
| 246 var GetBold = requireNative('automationInternal').GetBold; |
| 247 |
| 248 /** |
| 249 * @param {number} axTreeID The id of the accessibility tree. |
| 250 * @param {number} nodeID The id of a node. |
| 251 * @return {boolean} |
| 252 */ |
| 253 var GetItalic = requireNative('automationInternal').GetItalic; |
| 254 |
| 255 /** |
| 256 * @param {number} axTreeID The id of the accessibility tree. |
| 257 * @param {number} nodeID The id of a node. |
| 258 * @return {boolean} |
| 259 */ |
| 260 var GetUnderline = requireNative('automationInternal').GetUnderline; |
| 261 |
| 262 /** |
| 263 * @param {number} axTreeID The id of the accessibility tree. |
| 264 * @param {number} nodeID The id of a node. |
| 265 * @return {boolean} |
| 266 */ |
| 267 var GetLineThrough = requireNative('automationInternal').GetLineThrough; |
| 268 |
| 241 var lastError = require('lastError'); | 269 var lastError = require('lastError'); |
| 242 var logging = requireNative('logging'); | 270 var logging = requireNative('logging'); |
| 243 var utils = require('utils'); | 271 var utils = require('utils'); |
| 244 | 272 |
| 245 /** | 273 /** |
| 246 * A single node in the Automation tree. | 274 * A single node in the Automation tree. |
| 247 * @param {AutomationRootNodeImpl} root The root of the tree. | 275 * @param {AutomationRootNodeImpl} root The root of the tree. |
| 248 * @constructor | 276 * @constructor |
| 249 */ | 277 */ |
| 250 function AutomationNodeImpl(root) { | 278 function AutomationNodeImpl(root) { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 parent = privates(parent).impl; | 401 parent = privates(parent).impl; |
| 374 var indexInParent = GetIndexInParent(this.treeID, this.id); | 402 var indexInParent = GetIndexInParent(this.treeID, this.id); |
| 375 return this.rootImpl.get( | 403 return this.rootImpl.get( |
| 376 GetChildIDAtIndex(parent.treeID, parent.id, indexInParent + 1)); | 404 GetChildIDAtIndex(parent.treeID, parent.id, indexInParent + 1)); |
| 377 }, | 405 }, |
| 378 | 406 |
| 379 get nameFrom() { | 407 get nameFrom() { |
| 380 return GetNameFrom(this.treeID, this.id); | 408 return GetNameFrom(this.treeID, this.id); |
| 381 }, | 409 }, |
| 382 | 410 |
| 411 get bold() { |
| 412 return GetBold(this.treeID, this.id); |
| 413 }, |
| 414 |
| 415 get italic() { |
| 416 return GetItalic(this.treeID, this.id); |
| 417 }, |
| 418 |
| 419 get underline() { |
| 420 return GetUnderline(this.treeID, this.id); |
| 421 }, |
| 422 |
| 423 get lineThrough() { |
| 424 return GetLineThrough(this.treeID, this.id); |
| 425 }, |
| 426 |
| 383 doDefault: function() { | 427 doDefault: function() { |
| 384 this.performAction_('doDefault'); | 428 this.performAction_('doDefault'); |
| 385 }, | 429 }, |
| 386 | 430 |
| 387 focus: function() { | 431 focus: function() { |
| 388 this.performAction_('focus'); | 432 this.performAction_('focus'); |
| 389 }, | 433 }, |
| 390 | 434 |
| 391 getImageData: function(maxWidth, maxHeight) { | 435 getImageData: function(maxWidth, maxHeight) { |
| 392 this.performAction_('getImageData', | 436 this.performAction_('getImageData', |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 'isRootNode', | 1174 'isRootNode', |
| 1131 'role', | 1175 'role', |
| 1132 'checked', | 1176 'checked', |
| 1133 'state', | 1177 'state', |
| 1134 'location', | 1178 'location', |
| 1135 'indexInParent', | 1179 'indexInParent', |
| 1136 'lineStartOffsets', | 1180 'lineStartOffsets', |
| 1137 'root', | 1181 'root', |
| 1138 'htmlAttributes', | 1182 'htmlAttributes', |
| 1139 'nameFrom', | 1183 'nameFrom', |
| 1184 'bold', |
| 1185 'italic', |
| 1186 'underline', |
| 1187 'lineThrough', |
| 1140 ]), | 1188 ]), |
| 1141 }); | 1189 }); |
| 1142 | 1190 |
| 1143 function AutomationRootNode() { | 1191 function AutomationRootNode() { |
| 1144 privates(AutomationRootNode).constructPrivate(this, arguments); | 1192 privates(AutomationRootNode).constructPrivate(this, arguments); |
| 1145 } | 1193 } |
| 1146 utils.expose(AutomationRootNode, AutomationRootNodeImpl, { | 1194 utils.expose(AutomationRootNode, AutomationRootNodeImpl, { |
| 1147 superclass: AutomationNode, | 1195 superclass: AutomationNode, |
| 1148 readonly: [ | 1196 readonly: [ |
| 1149 'chromeChannel', | 1197 'chromeChannel', |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1167 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { | 1215 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { |
| 1168 return AutomationRootNodeImpl.getOrCreate(treeID); | 1216 return AutomationRootNodeImpl.getOrCreate(treeID); |
| 1169 }); | 1217 }); |
| 1170 | 1218 |
| 1171 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { | 1219 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { |
| 1172 AutomationRootNodeImpl.destroy(treeID); | 1220 AutomationRootNodeImpl.destroy(treeID); |
| 1173 }); | 1221 }); |
| 1174 | 1222 |
| 1175 exports.$set('AutomationNode', AutomationNode); | 1223 exports.$set('AutomationNode', AutomationNode); |
| 1176 exports.$set('AutomationRootNode', AutomationRootNode); | 1224 exports.$set('AutomationRootNode', AutomationRootNode); |
| OLD | NEW |