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

Side by Side Diff: chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.cc

Issue 246433012: Extend AXTreeSourceViews to handle aura::Window and views::Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move files from c/b/u/views/accessibility to c/b/u/ash/accessibility Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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/ash/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 AXRootObjWrapper::AXRootObjWrapper(int32 id) : id_(id) {
14 }
15
16 AXRootObjWrapper::~AXRootObjWrapper() {}
17
18 bool AXRootObjWrapper::HasChild(views::AXAuraObjWrapper* child) {
19 std::vector<views::AXAuraObjWrapper*> children;
20 GetChildren(&children);
21 return std::find(children.begin(), children.end(), child) != children.end();
22 }
23
24 views::AXAuraObjWrapper* AXRootObjWrapper::GetParent() {
25 return NULL;
26 }
27
28 void AXRootObjWrapper::GetChildren(
29 std::vector<views::AXAuraObjWrapper*>* out_children) {
30 // Only on ash is there a notion of a root with children.
31 aura::Window::Windows children =
32 ash::Shell::GetInstance()->GetAllRootWindows();
33 for (size_t i = 0; i < children.size(); ++i) {
34 out_children->push_back(
35 views::AXAuraObjCache::GetInstance()->GetOrCreate(children[i]));
36 }
37 }
38
39 void AXRootObjWrapper::Serialize(ui::AXNodeData* out_node_data) {
40 out_node_data->id = id_;
41 out_node_data->role = ui::AX_ROLE_DESKTOP;
42 // TODO(dtseng): Apply a richer set of states.
43 out_node_data->state = 0;
44 }
45
46 int32 AXRootObjWrapper::GetID() {
47 return id_;
48 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/accessibility/ax_root_obj_wrapper.h ('k') | chrome/browser/ui/ash/accessibility/ax_tree_source_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698