Chromium Code Reviews| Index: ui/views/accessibility/ax_widget_obj_wrapper.cc |
| diff --git a/ui/views/accessibility/ax_widget_obj_wrapper.cc b/ui/views/accessibility/ax_widget_obj_wrapper.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8bb1048f1e373a7fc56a39539924cd6561f5d7fa |
| --- /dev/null |
| +++ b/ui/views/accessibility/ax_widget_obj_wrapper.cc |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "ui/views/accessibility/ax_widget_obj_wrapper.h" |
| + |
| +#include "ui/accessibility/ax_node_data.h" |
| +#include "ui/views/accessibility/ax_node_source_obj_wrapper.h" |
| +#include "ui/views/accessibility/ax_obj_cache.h" |
| +#include "ui/views/widget/widget.h" |
| + |
| +namespace views { |
| + |
| +AXNodeSourceObjWrapper* AXWidgetObjWrapper::GetParent() { |
| + // TODO(dtseng): This could possibly hook up to other platforms. |
| +#ifdef USE_AURA |
|
dmazzoni
2014/04/23 05:06:44
Do we even want to compile this code on any non-Au
David Tseng
2014/04/23 18:20:01
sgtm; removed.
|
| + return AXObjCache::GetInstance()->GetOrCreate(widget_->GetNativeView()); |
| +#endif |
| + return NULL; |
| +} |
| + |
| +void AXWidgetObjWrapper::GetChildren( |
| + std::vector<AXNodeSourceObjWrapper*>* out_children) { |
| + out_children->push_back( |
| + AXObjCache::GetInstance()->GetOrCreate(widget_->GetRootView())); |
| +} |
| + |
| +void AXWidgetObjWrapper::Serialize(ui::AXNodeData* out_node_data) { |
| + out_node_data->id = AXObjCache::GetInstance()->GetID(widget_); |
| + out_node_data->role = ui::AX_ROLE_CLIENT; |
| + out_node_data->location = widget_->GetWindowBoundsInScreen(); |
| +} |
| + |
| +} // namespace views |