OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/views/accessibility/ax_root_obj_wrapper.h" |
| 6 |
| 7 #include "ash/shell.h" |
| 8 #include "ui/accessibility/ax_node_data.h" |
| 9 #include "ui/accessibility/ax_view_state.h" |
| 10 #include "ui/aura/window.h" |
| 11 #include "ui/views/accessibility/ax_aura_obj_cache.h" |
| 12 |
| 13 namespace views { |
| 14 |
| 15 bool AXRootObjWrapper::HasChild(AXAuraObjWrapper* child) { |
| 16 std::vector<AXAuraObjWrapper*> out_children; |
| 17 GetChildren(&out_children); |
| 18 return std::find(out_children.begin(), out_children.end(), child) != |
| 19 out_children.end(); |
| 20 } |
| 21 |
| 22 AXAuraObjWrapper* AXRootObjWrapper::GetParent() { |
| 23 return NULL; |
| 24 } |
| 25 |
| 26 void AXRootObjWrapper::GetChildren( |
| 27 std::vector<AXAuraObjWrapper*>* out_children) { |
| 28 aura::Window::Windows children = |
| 29 ash::Shell::GetInstance()->GetAllRootWindows(); |
| 30 for (size_t i = 0; i < children.size(); ++i) { |
| 31 out_children->push_back( |
| 32 AXAuraObjCache::GetInstance()->GetOrCreate(children[i])); |
| 33 } |
| 34 } |
| 35 |
| 36 void AXRootObjWrapper::Serialize(ui::AXNodeData* out_node_data) { |
| 37 out_node_data->id = id_; |
| 38 out_node_data->state = 0; |
| 39 } |
| 40 |
| 41 int32 AXRootObjWrapper::GetID() { |
| 42 return id_; |
| 43 } |
| 44 |
| 45 } // namespace views |
OLD | NEW |