| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 * @param {number} axTreeID The id of the accessibility tree. | 219 * @param {number} axTreeID The id of the accessibility tree. |
| 220 * @param {number} nodeID The id of a node. | 220 * @param {number} nodeID The id of a node. |
| 221 * @param {string} attr The name of an HTML attribute. | 221 * @param {string} attr The name of an HTML attribute. |
| 222 * @return {?string} The value of this attribute, or undefined if the tree, | 222 * @return {?string} The value of this attribute, or undefined if the tree, |
| 223 * node, or attribute wasn't found. | 223 * node, or attribute wasn't found. |
| 224 */ | 224 */ |
| 225 var GetHtmlAttribute = requireNative('automationInternal').GetHtmlAttribute; | 225 var GetHtmlAttribute = requireNative('automationInternal').GetHtmlAttribute; |
| 226 | 226 |
| 227 var lastError = require('lastError'); | 227 var lastError = require('lastError'); |
| 228 var logging = requireNative('logging'); | 228 var logging = requireNative('logging'); |
| 229 var schema = requireNative('automationInternal').GetSchemaAdditions(); | |
| 230 var utils = require('utils'); | 229 var utils = require('utils'); |
| 231 | 230 |
| 232 /** | 231 /** |
| 233 * A single node in the Automation tree. | 232 * A single node in the Automation tree. |
| 234 * @param {AutomationRootNodeImpl} root The root of the tree. | 233 * @param {AutomationRootNodeImpl} root The root of the tree. |
| 235 * @constructor | 234 * @constructor |
| 236 */ | 235 */ |
| 237 function AutomationNodeImpl(root) { | 236 function AutomationNodeImpl(root) { |
| 238 this.rootImpl = root; | 237 this.rootImpl = root; |
| 239 this.hostNode_ = null; | 238 this.hostNode_ = null; |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 return obj; | 1024 return obj; |
| 1026 }, | 1025 }, |
| 1027 | 1026 |
| 1028 remove: function(id) { | 1027 remove: function(id) { |
| 1029 if (this.axNodeDataCache_[id]) | 1028 if (this.axNodeDataCache_[id]) |
| 1030 privates(this.axNodeDataCache_[id]).impl.detach(); | 1029 privates(this.axNodeDataCache_[id]).impl.detach(); |
| 1031 delete this.axNodeDataCache_[id]; | 1030 delete this.axNodeDataCache_[id]; |
| 1032 }, | 1031 }, |
| 1033 | 1032 |
| 1034 destroy: function() { | 1033 destroy: function() { |
| 1035 this.dispatchEvent(schema.EventType.destroyed, 'none'); | 1034 this.dispatchEvent('destroyed', 'none'); |
| 1036 for (var id in this.axNodeDataCache_) | 1035 for (var id in this.axNodeDataCache_) |
| 1037 this.remove(id); | 1036 this.remove(id); |
| 1038 this.detach(); | 1037 this.detach(); |
| 1039 }, | 1038 }, |
| 1040 | 1039 |
| 1041 setHostNode(hostNode) { | 1040 setHostNode(hostNode) { |
| 1042 this.hostNode_ = hostNode; | 1041 this.hostNode_ = hostNode; |
| 1043 }, | 1042 }, |
| 1044 | 1043 |
| 1045 onAccessibilityEvent: function(eventParams) { | 1044 onAccessibilityEvent: function(eventParams) { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { | 1144 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { |
| 1146 return AutomationRootNodeImpl.getOrCreate(treeID); | 1145 return AutomationRootNodeImpl.getOrCreate(treeID); |
| 1147 }); | 1146 }); |
| 1148 | 1147 |
| 1149 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { | 1148 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { |
| 1150 AutomationRootNodeImpl.destroy(treeID); | 1149 AutomationRootNodeImpl.destroy(treeID); |
| 1151 }); | 1150 }); |
| 1152 | 1151 |
| 1153 exports.$set('AutomationNode', AutomationNode); | 1152 exports.$set('AutomationNode', AutomationNode); |
| 1154 exports.$set('AutomationRootNode', AutomationRootNode); | 1153 exports.$set('AutomationRootNode', AutomationRootNode); |
| OLD | NEW |