| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "ui/accessibility/ax_tree.h" | 5 #include "ui/accessibility/ax_tree.h" |
| 6 #include "ui/accessibility/ax_tree_combiner.h" | 6 #include "ui/accessibility/ax_tree_combiner.h" |
| 7 #include "ui/gfx/geometry/rect_f.h" | 7 #include "ui/gfx/geometry/rect_f.h" |
| 8 | 8 |
| 9 namespace ui { | 9 namespace ui { |
| 10 namespace { | 10 namespace { |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 AXNodeData node = tree->nodes[i]; | 178 AXNodeData node = tree->nodes[i]; |
| 179 int32_t child_tree_id = node.GetIntAttribute(AX_ATTR_CHILD_TREE_ID); | 179 int32_t child_tree_id = node.GetIntAttribute(AX_ATTR_CHILD_TREE_ID); |
| 180 | 180 |
| 181 // Map the node's ID. | 181 // Map the node's ID. |
| 182 node.id = MapId(tree_id, node.id); | 182 node.id = MapId(tree_id, node.id); |
| 183 | 183 |
| 184 // Map the node's child IDs. | 184 // Map the node's child IDs. |
| 185 for (size_t j = 0; j < node.child_ids.size(); ++j) | 185 for (size_t j = 0; j < node.child_ids.size(); ++j) |
| 186 node.child_ids[j] = MapId(tree_id, node.child_ids[j]); | 186 node.child_ids[j] = MapId(tree_id, node.child_ids[j]); |
| 187 | 187 |
| 188 // Reset the offset container ID because we make all bounding boxes |
| 189 // absolute. |
| 190 node.offset_container_id = -1; |
| 191 |
| 188 // Map other int attributes that refer to node IDs, and remove the | 192 // Map other int attributes that refer to node IDs, and remove the |
| 189 // AX_ATTR_CHILD_TREE_ID attribute. | 193 // AX_ATTR_CHILD_TREE_ID attribute. |
| 190 for (size_t j = 0; j < node.int_attributes.size(); ++j) { | 194 for (size_t j = 0; j < node.int_attributes.size(); ++j) { |
| 191 auto& attr = node.int_attributes[j]; | 195 auto& attr = node.int_attributes[j]; |
| 192 if (IsNodeIdIntAttribute(attr.first)) | 196 if (IsNodeIdIntAttribute(attr.first)) |
| 193 attr.second = MapId(tree_id, attr.second); | 197 attr.second = MapId(tree_id, attr.second); |
| 194 if (attr.first == AX_ATTR_CHILD_TREE_ID) { | 198 if (attr.first == AX_ATTR_CHILD_TREE_ID) { |
| 195 attr.first = AX_INT_ATTRIBUTE_NONE; | 199 attr.first = AX_INT_ATTRIBUTE_NONE; |
| 196 attr.second = 0; | 200 attr.second = 0; |
| 197 } | 201 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // Recurse into the child tree now, if any. | 235 // Recurse into the child tree now, if any. |
| 232 if (child_tree) | 236 if (child_tree) |
| 233 ProcessTree(child_tree); | 237 ProcessTree(child_tree); |
| 234 } | 238 } |
| 235 | 239 |
| 236 // Reset the transform. | 240 // Reset the transform. |
| 237 transform_ = old_transform; | 241 transform_ = old_transform; |
| 238 } | 242 } |
| 239 | 243 |
| 240 } // namespace ui | 244 } // namespace ui |
| OLD | NEW |