| 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 Event = require('event_bindings').Event; | 5 var Event = require('event_bindings').Event; |
| 6 var AutomationNode = require('automationNode').AutomationNode; | 6 var AutomationNode = require('automationNode').AutomationNode; |
| 7 var utils = require('utils'); | 7 var utils = require('utils'); |
| 8 | 8 |
| 9 // Maps an attribute to its default value in an invalidated node. | 9 // Maps an attribute to its default value in an invalidated node. |
| 10 // These attributes are taken directly from the Automation idl. | 10 // These attributes are taken directly from the Automation idl. |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 129 } |
| 130 | 130 |
| 131 for (var k = 0, oldId; oldId = oldChildIDs[k]; k++) { | 131 for (var k = 0, oldId; oldId = oldChildIDs[k]; k++) { |
| 132 // However, we must invalidate all old child ids that are no longer | 132 // However, we must invalidate all old child ids that are no longer |
| 133 // children. | 133 // children. |
| 134 if (!newChildIDsHash[oldId]) { | 134 if (!newChildIDsHash[oldId]) { |
| 135 this.invalidate(this.get(oldId)); | 135 this.invalidate(this.get(oldId)); |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 | 138 |
| 139 if (nodeData.role == 'root_web_area' || nodeData.role == 'desktop') { | 139 if (nodeData.role == 'rootWebArea' || nodeData.role == 'desktop') { |
| 140 this.root = node; | 140 this.root = node; |
| 141 didUpdateRoot = true; | 141 didUpdateRoot = true; |
| 142 } | 142 } |
| 143 for (var key in AutomationAttributeDefaults) { | 143 for (var key in AutomationAttributeDefaults) { |
| 144 if (key in nodeData) | 144 if (key in nodeData) |
| 145 privates(node).impl[key] = nodeData[key]; | 145 privates(node).impl[key] = nodeData[key]; |
| 146 else | 146 else |
| 147 privates(node).impl[key] = AutomationAttributeDefaults[key]; | 147 privates(node).impl[key] = AutomationAttributeDefaults[key]; |
| 148 } | 148 } |
| 149 for (var attributeTypeIndex = 0; | 149 for (var attributeTypeIndex = 0; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 178 } | 178 } |
| 179 return toStringInternal(this.root, 0); | 179 return toStringInternal(this.root, 0); |
| 180 } | 180 } |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 exports.AutomationTree = utils.expose('AutomationTree', | 183 exports.AutomationTree = utils.expose('AutomationTree', |
| 184 AutomationTreeImpl, | 184 AutomationTreeImpl, |
| 185 { functions: ['addEventListener', | 185 { functions: ['addEventListener', |
| 186 'removeEventListener'], | 186 'removeEventListener'], |
| 187 readonly: ['root'] }); | 187 readonly: ['root'] }); |
| OLD | NEW |