| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 if (obj) | 54 if (obj) |
| 55 obj->SetSelection(start, end); | 55 obj->SetSelection(start, end); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void AXTreeSourceAura::ShowContextMenu(int32_t id) { | 58 void AXTreeSourceAura::ShowContextMenu(int32_t id) { |
| 59 AXAuraObjWrapper* obj = AXAuraObjCache::GetInstance()->Get(id); | 59 AXAuraObjWrapper* obj = AXAuraObjCache::GetInstance()->Get(id); |
| 60 if (obj) | 60 if (obj) |
| 61 obj->ShowContextMenu(); | 61 obj->ShowContextMenu(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool AXTreeSourceAura::HandleAccessibleAction(const ui::AXActionData& action) { |
| 65 AXAuraObjWrapper* obj = |
| 66 AXAuraObjCache::GetInstance()->Get(action.target_node_id); |
| 67 if (obj) |
| 68 return obj->HandleAccessibleAction(action); |
| 69 return false; |
| 70 } |
| 71 |
| 64 bool AXTreeSourceAura::GetTreeData(ui::AXTreeData* tree_data) const { | 72 bool AXTreeSourceAura::GetTreeData(ui::AXTreeData* tree_data) const { |
| 65 tree_data->tree_id = 0; | 73 tree_data->tree_id = 0; |
| 66 tree_data->loaded = true; | 74 tree_data->loaded = true; |
| 67 tree_data->loading_progress = 1.0; | 75 tree_data->loading_progress = 1.0; |
| 68 AXAuraObjWrapper* focus = AXAuraObjCache::GetInstance()->GetFocus(); | 76 AXAuraObjWrapper* focus = AXAuraObjCache::GetInstance()->GetFocus(); |
| 69 if (focus) | 77 if (focus) |
| 70 tree_data->focus_id = focus->GetID(); | 78 tree_data->focus_id = focus->GetID(); |
| 71 return true; | 79 return true; |
| 72 } | 80 } |
| 73 | 81 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 146 |
| 139 std::vector<AXAuraObjWrapper*> children; | 147 std::vector<AXAuraObjWrapper*> children; |
| 140 root->GetChildren(&children); | 148 root->GetChildren(&children); |
| 141 | 149 |
| 142 prefix += prefix[0]; | 150 prefix += prefix[0]; |
| 143 for (size_t i = 0; i < children.size(); ++i) | 151 for (size_t i = 0; i < children.size(); ++i) |
| 144 output += ToString(children[i], prefix); | 152 output += ToString(children[i], prefix); |
| 145 | 153 |
| 146 return output; | 154 return output; |
| 147 } | 155 } |
| OLD | NEW |