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

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

Issue 1003283002: 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
« no previous file with comments | « chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4025d4edb85a475904683e213ef7c7e85d2760cf 100644
--- a/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc
+++ b/chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc
@@ -8,12 +8,15 @@
#include "base/strings/utf_string_conversions.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/ax_view_state.h"
+#include "ui/aura/env.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"
AXRootObjWrapper::AXRootObjWrapper(int32 id)
- : id_(id), alert_window_(new aura::Window(NULL)) {
+ : id_(id), alert_window_(new aura::Window(NULL)), host_(NULL) {
+ aura::Env::GetInstance()->AddObserver(this);
}
AXRootObjWrapper::~AXRootObjWrapper() {
@@ -45,10 +48,14 @@ views::AXAuraObjWrapper* AXRootObjWrapper::GetParent() {
void AXRootObjWrapper::GetChildren(
std::vector<views::AXAuraObjWrapper*>* out_children) {
- if (!ash::Shell::HasInstance())
+ if (!ash::Shell::HasInstance()) {
+ if (host_) {
+ out_children->push_back(
+ views::AXAuraObjCache::GetInstance()->GetOrCreate(host_->window()));
+ }
return;
sadrul 2015/03/13 20:07:01 This essentially means a WindowTreeHost was create
oshima 2015/03/13 20:40:03 Yeah, this shouldn't happen (or you shouldn't try
David Tseng 2015/03/13 21:33:53 This code is meant to handle the linux/win case wh
oshima 2015/03/13 21:58:47 If that's the case, what you check screen type to
David Tseng 2015/03/16 17:28:48 To be clear, I need to know if shell exists in ord
+ }
- // 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) {
@@ -70,3 +77,10 @@ void AXRootObjWrapper::Serialize(ui::AXNodeData* out_node_data) {
int32 AXRootObjWrapper::GetID() {
return id_;
}
+
+void AXRootObjWrapper::OnWindowInitialized(aura::Window* window) {
+}
+
+void AXRootObjWrapper::OnHostActivated(aura::WindowTreeHost* host) {
+ host_ = host;
dmazzoni 2015/03/13 20:01:43 Can't there be more than one WindowTreeHost, like
oshima 2015/03/13 20:40:03 yes, that's correct.
David Tseng 2015/03/13 21:33:53 EnvObserver is how I'm keeping track of things. I
oshima 2015/03/13 21:58:47 Can you explain how these wrapper objects are desi
David Tseng 2015/03/16 17:00:52 These wrappers adapt various objects in Aura for u
+}
« no previous file with comments | « chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698