| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/accessibility/browser_accessibility_manager.h" | 5 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "content/browser/accessibility/browser_accessibility.h" | 12 #include "content/browser/accessibility/browser_accessibility.h" |
| 13 #include "content/common/accessibility_messages.h" | 13 #include "content/common/accessibility_messages.h" |
| 14 #include "ui/accessibility/ax_tree_data.h" |
| 14 #include "ui/accessibility/ax_tree_serializer.h" | 15 #include "ui/accessibility/ax_tree_serializer.h" |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 // Search the tree recursively from |node| and return any node that has | 21 // Search the tree recursively from |node| and return any node that has |
| 21 // a child tree ID of |ax_tree_id|. | 22 // a child tree ID of |ax_tree_id|. |
| 22 BrowserAccessibility* FindNodeWithChildTreeId(BrowserAccessibility* node, | 23 BrowserAccessibility* FindNodeWithChildTreeId(BrowserAccessibility* node, |
| 23 int ax_tree_id) { | 24 int ax_tree_id) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 const ui::AXNodeData& node7 /* = ui::AXNodeData() */, | 60 const ui::AXNodeData& node7 /* = ui::AXNodeData() */, |
| 60 const ui::AXNodeData& node8 /* = ui::AXNodeData() */, | 61 const ui::AXNodeData& node8 /* = ui::AXNodeData() */, |
| 61 const ui::AXNodeData& node9 /* = ui::AXNodeData() */, | 62 const ui::AXNodeData& node9 /* = ui::AXNodeData() */, |
| 62 const ui::AXNodeData& node10 /* = ui::AXNodeData() */, | 63 const ui::AXNodeData& node10 /* = ui::AXNodeData() */, |
| 63 const ui::AXNodeData& node11 /* = ui::AXNodeData() */, | 64 const ui::AXNodeData& node11 /* = ui::AXNodeData() */, |
| 64 const ui::AXNodeData& node12 /* = ui::AXNodeData() */) { | 65 const ui::AXNodeData& node12 /* = ui::AXNodeData() */) { |
| 65 CR_DEFINE_STATIC_LOCAL(ui::AXNodeData, empty_data, ()); | 66 CR_DEFINE_STATIC_LOCAL(ui::AXNodeData, empty_data, ()); |
| 66 int32_t no_id = empty_data.id; | 67 int32_t no_id = empty_data.id; |
| 67 | 68 |
| 68 ui::AXTreeUpdate update; | 69 ui::AXTreeUpdate update; |
| 70 ui::AXTreeData tree_data; |
| 71 tree_data.tree_id = 1; |
| 72 tree_data.focused_tree_id = 1; |
| 73 update.tree_data = tree_data; |
| 74 update.has_tree_data = true; |
| 69 update.root_id = node1.id; | 75 update.root_id = node1.id; |
| 70 update.nodes.push_back(node1); | 76 update.nodes.push_back(node1); |
| 71 if (node2.id != no_id) | 77 if (node2.id != no_id) |
| 72 update.nodes.push_back(node2); | 78 update.nodes.push_back(node2); |
| 73 if (node3.id != no_id) | 79 if (node3.id != no_id) |
| 74 update.nodes.push_back(node3); | 80 update.nodes.push_back(node3); |
| 75 if (node4.id != no_id) | 81 if (node4.id != no_id) |
| 76 update.nodes.push_back(node4); | 82 update.nodes.push_back(node4); |
| 77 if (node5.id != no_id) | 83 if (node5.id != no_id) |
| 78 update.nodes.push_back(node5); | 84 update.nodes.push_back(node5); |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 hit_test_result = parent; | 1267 hit_test_result = parent; |
| 1262 parent = parent->PlatformGetParent(); | 1268 parent = parent->PlatformGetParent(); |
| 1263 } | 1269 } |
| 1264 | 1270 |
| 1265 last_hover_ax_tree_id_ = hit_test_result->manager()->ax_tree_id(); | 1271 last_hover_ax_tree_id_ = hit_test_result->manager()->ax_tree_id(); |
| 1266 last_hover_node_id_ = hit_test_result->GetId(); | 1272 last_hover_node_id_ = hit_test_result->GetId(); |
| 1267 last_hover_bounds_ = hit_test_result->GetScreenBoundsRect(); | 1273 last_hover_bounds_ = hit_test_result->GetScreenBoundsRect(); |
| 1268 } | 1274 } |
| 1269 | 1275 |
| 1270 } // namespace content | 1276 } // namespace content |
| OLD | NEW |