Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Unified Diff: chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc

Issue 1040863002: Revert "Enable chrome.automation.getDesktop on all aura platforms." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc
diff --git a/chrome/browser/ui/aura/accessibility/ax_root_obj_wrapper.cc b/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc
similarity index 75%
rename from chrome/browser/ui/aura/accessibility/ax_root_obj_wrapper.cc
rename to chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc
index b565bde99088d7a7f3fb4270cff2ed8dd3fd296b..366955d1a355431b1b4b6938a22822c83f22369b 100644
--- a/chrome/browser/ui/aura/accessibility/ax_root_obj_wrapper.cc
+++ b/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc
@@ -2,8 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/ui/aura/accessibility/ax_root_obj_wrapper.h"
+#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"
@@ -44,7 +45,19 @@ views::AXAuraObjWrapper* AXRootObjWrapper::GetParent() {
void AXRootObjWrapper::GetChildren(
std::vector<views::AXAuraObjWrapper*>* out_children) {
- views::AXAuraObjCache::GetInstance()->GetTopLevelWindows(out_children);
+ if (!ash::Shell::HasInstance())
+ return;
+
+ // Only on ash is there a notion of a root with children.
+ aura::Window::Windows children =
+ ash::Shell::GetInstance()->GetAllRootWindows();
+ for (size_t i = 0; i < children.size(); ++i) {
+ out_children->push_back(
+ views::AXAuraObjCache::GetInstance()->GetOrCreate(children[i]));
+ }
+
+ out_children->push_back(
+ views::AXAuraObjCache::GetInstance()->GetOrCreate(alert_window_));
}
void AXRootObjWrapper::Serialize(ui::AXNodeData* out_node_data) {
« no previous file with comments | « chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.h ('k') | chrome/browser/ui/ash/accessibility/ax_tree_source_ash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698