Index: chrome/browser/ui/views/accessibility/ax_root_obj_wrapper.cc |
diff --git a/chrome/browser/ui/views/accessibility/ax_root_obj_wrapper.cc b/chrome/browser/ui/views/accessibility/ax_root_obj_wrapper.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c5d3eaca46af63e4fce95000cab3898ff775087b |
--- /dev/null |
+++ b/chrome/browser/ui/views/accessibility/ax_root_obj_wrapper.cc |
@@ -0,0 +1,45 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/ui/views/accessibility/ax_root_obj_wrapper.h" |
+ |
+#include "ash/shell.h" |
+#include "ui/accessibility/ax_node_data.h" |
+#include "ui/accessibility/ax_view_state.h" |
+#include "ui/aura/window.h" |
+#include "ui/views/accessibility/ax_aura_obj_cache.h" |
+ |
+namespace views { |
+ |
+bool AXRootObjWrapper::HasChild(AXAuraObjWrapper* child) { |
+ std::vector<AXAuraObjWrapper*> out_children; |
+ GetChildren(&out_children); |
+ return std::find(out_children.begin(), out_children.end(), child) != |
+ out_children.end(); |
+} |
+ |
+AXAuraObjWrapper* AXRootObjWrapper::GetParent() { |
+ return NULL; |
+} |
+ |
+void AXRootObjWrapper::GetChildren( |
+ std::vector<AXAuraObjWrapper*>* out_children) { |
+ aura::Window::Windows children = |
+ ash::Shell::GetInstance()->GetAllRootWindows(); |
+ for (size_t i = 0; i < children.size(); ++i) { |
+ out_children->push_back( |
+ AXAuraObjCache::GetInstance()->GetOrCreate(children[i])); |
+ } |
+} |
+ |
+void AXRootObjWrapper::Serialize(ui::AXNodeData* out_node_data) { |
+ out_node_data->id = id_; |
+ out_node_data->state = 0; |
+} |
+ |
+int32 AXRootObjWrapper::GetID() { |
+ return id_; |
+} |
+ |
+} // namespace views |