Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 "ui/views/accessibility/ax_window_obj_wrapper.h" | |
| 6 | |
| 7 #include "ui/accessibility/ax_node_data.h" | |
| 8 #include "ui/aura/window.h" | |
| 9 #include "ui/views/accessibility/ax_obj_cache.h" | |
| 10 #include "ui/views/widget/widget.h" | |
| 11 | |
| 12 namespace views { | |
| 13 | |
| 14 AXNodeSourceObjWrapper* AXWindowObjWrapper::GetParent() { | |
| 15 if (!window_->parent()) | |
| 16 return NULL; | |
| 17 | |
| 18 return AXObjCache::GetInstance()->GetOrCreate(window_->parent()); | |
| 19 } | |
| 20 | |
| 21 void AXWindowObjWrapper::GetChildren( | |
| 22 std::vector<AXNodeSourceObjWrapper*>* out_children) { | |
| 23 aura::Window::Windows children = window_->children(); | |
| 24 for (size_t i = 0; i < children.size(); ++i) { | |
| 25 out_children->push_back( | |
| 26 AXObjCache::GetInstance()->GetOrCreate(children[i])); | |
| 27 } | |
| 28 | |
| 29 // Also consider any associated widgets as children. | |
| 30 Widget* widget = Widget::GetWidgetForNativeView(window_); | |
| 31 if (widget) | |
| 32 out_children->push_back(AXObjCache::GetInstance()->GetOrCreate(widget)); | |
| 33 } | |
| 34 | |
| 35 void AXWindowObjWrapper::Serialize(ui::AXNodeData* out_node_data) { | |
| 36 out_node_data->id = AXObjCache::GetInstance()->GetID(window_); | |
| 37 out_node_data->role = ui::AX_ROLE_WINDOW; | |
| 38 out_node_data->location = window_->bounds(); | |
| 39 | |
| 40 // TODO(dtseng): Window also has title. | |
|
dmazzoni
2014/04/23 05:06:44
Hmmm, I think one of the two is just an internal n
David Tseng
2014/04/23 18:20:01
Done.
| |
| 41 out_node_data->AddStringAttribute( | |
| 42 ui::AX_ATTR_NAME, window_->name()); | |
| 43 } | |
| 44 | |
| 45 } // namespace views | |
| OLD | NEW |