| 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 #include "chrome/browser/ui/aura/accessibility/ax_tree_source_aura.h" | 5 #include "chrome/browser/ui/aura/accessibility/ax_tree_source_aura.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 AXAuraObjWrapper* obj = AXAuraObjCache::GetInstance()->Get(id); | 56 AXAuraObjWrapper* obj = AXAuraObjCache::GetInstance()->Get(id); |
| 57 if (obj) | 57 if (obj) |
| 58 obj->ShowContextMenu(); | 58 obj->ShowContextMenu(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 ui::AXTreeData AXTreeSourceAura::GetTreeData() const { | 61 ui::AXTreeData AXTreeSourceAura::GetTreeData() const { |
| 62 ui::AXTreeData tree_data; | 62 ui::AXTreeData tree_data; |
| 63 tree_data.tree_id = 0; | 63 tree_data.tree_id = 0; |
| 64 tree_data.loaded = true; | 64 tree_data.loaded = true; |
| 65 tree_data.loading_progress = 1.0; | 65 tree_data.loading_progress = 1.0; |
| 66 AXAuraObjWrapper* focus = AXAuraObjCache::GetInstance()->GetFocus(); |
| 67 if (focus) |
| 68 tree_data.focus_id = focus->GetID(); |
| 66 return tree_data; | 69 return tree_data; |
| 67 } | 70 } |
| 68 | 71 |
| 69 AXAuraObjWrapper* AXTreeSourceAura::GetRoot() const { | 72 AXAuraObjWrapper* AXTreeSourceAura::GetRoot() const { |
| 70 return root_.get(); | 73 return root_.get(); |
| 71 } | 74 } |
| 72 | 75 |
| 73 AXAuraObjWrapper* AXTreeSourceAura::GetFromId(int32_t id) const { | 76 AXAuraObjWrapper* AXTreeSourceAura::GetFromId(int32_t id) const { |
| 74 if (id == root_->GetID()) | 77 if (id == root_->GetID()) |
| 75 return root_.get(); | 78 return root_.get(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 136 |
| 134 std::vector<AXAuraObjWrapper*> children; | 137 std::vector<AXAuraObjWrapper*> children; |
| 135 root->GetChildren(&children); | 138 root->GetChildren(&children); |
| 136 | 139 |
| 137 prefix += prefix[0]; | 140 prefix += prefix[0]; |
| 138 for (size_t i = 0; i < children.size(); ++i) | 141 for (size_t i = 0; i < children.size(); ++i) |
| 139 output += ToString(children[i], prefix); | 142 output += ToString(children[i], prefix); |
| 140 | 143 |
| 141 return output; | 144 return output; |
| 142 } | 145 } |
| OLD | NEW |