Chromium Code Reviews| Index: chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc |
| diff --git a/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc b/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc |
| index 366955d1a355431b1b4b6938a22822c83f22369b..df98f32da1538725bd0118acc3425312688d9fd6 100644 |
| --- a/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc |
| +++ b/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc |
| @@ -4,14 +4,18 @@ |
| #include "chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.h" |
| -#include "ash/shell.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "ui/accessibility/ax_node_data.h" |
| #include "ui/accessibility/ax_view_state.h" |
| #include "ui/aura/window.h" |
| +#include "ui/aura/window_tree_host.h" |
| #include "ui/views/accessibility/ax_aura_obj_cache.h" |
| #include "ui/views/accessibility/ax_window_obj_wrapper.h" |
| +#if defined(OS_CHROMEOS) |
| +#include "ash/shell.h" |
| +#endif |
| + |
| AXRootObjWrapper::AXRootObjWrapper(int32 id) |
| : id_(id), alert_window_(new aura::Window(NULL)) { |
| } |
| @@ -45,10 +49,7 @@ views::AXAuraObjWrapper* AXRootObjWrapper::GetParent() { |
| void AXRootObjWrapper::GetChildren( |
| std::vector<views::AXAuraObjWrapper*>* out_children) { |
| - if (!ash::Shell::HasInstance()) |
| - return; |
| - |
| - // Only on ash is there a notion of a root with children. |
| +#if defined(OS_CHROMEOS) |
|
oshima
2015/03/20 22:31:42
I still don't quite understand why you need this.
|
| aura::Window::Windows children = |
| ash::Shell::GetInstance()->GetAllRootWindows(); |
| for (size_t i = 0; i < children.size(); ++i) { |
| @@ -58,6 +59,9 @@ void AXRootObjWrapper::GetChildren( |
| out_children->push_back( |
| views::AXAuraObjCache::GetInstance()->GetOrCreate(alert_window_)); |
| +#else |
| + views::AXAuraObjCache::GetInstance()->GetTopLevelWindows(out_children); |
| +#endif |
| } |
| void AXRootObjWrapper::Serialize(ui::AXNodeData* out_node_data) { |