OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/accessibility/ax_widget_obj_wrapper.h" | 5 #include "ui/views/accessibility/ax_widget_obj_wrapper.h" |
6 | 6 |
7 #include "ui/accessibility/ax_node_data.h" | 7 #include "ui/accessibility/ax_node_data.h" |
8 #include "ui/views/accessibility/ax_aura_obj_cache.h" | 8 #include "ui/views/accessibility/ax_aura_obj_cache.h" |
9 #include "ui/views/accessibility/ax_aura_obj_wrapper.h" | 9 #include "ui/views/accessibility/ax_aura_obj_wrapper.h" |
10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 } | 23 } |
24 widget_ = NULL; | 24 widget_ = NULL; |
25 } | 25 } |
26 | 26 |
27 AXAuraObjWrapper* AXWidgetObjWrapper::GetParent() { | 27 AXAuraObjWrapper* AXWidgetObjWrapper::GetParent() { |
28 return AXAuraObjCache::GetInstance()->GetOrCreate(widget_->GetNativeView()); | 28 return AXAuraObjCache::GetInstance()->GetOrCreate(widget_->GetNativeView()); |
29 } | 29 } |
30 | 30 |
31 void AXWidgetObjWrapper::GetChildren( | 31 void AXWidgetObjWrapper::GetChildren( |
32 std::vector<AXAuraObjWrapper*>* out_children) { | 32 std::vector<AXAuraObjWrapper*>* out_children) { |
| 33 if (!widget_->IsVisible() || !widget_->GetRootView()->visible()) |
| 34 return; |
| 35 |
33 out_children->push_back( | 36 out_children->push_back( |
34 AXAuraObjCache::GetInstance()->GetOrCreate(widget_->GetRootView())); | 37 AXAuraObjCache::GetInstance()->GetOrCreate(widget_->GetRootView())); |
35 } | 38 } |
36 | 39 |
37 void AXWidgetObjWrapper::Serialize(ui::AXNodeData* out_node_data) { | 40 void AXWidgetObjWrapper::Serialize(ui::AXNodeData* out_node_data) { |
38 out_node_data->id = GetID(); | 41 out_node_data->id = GetID(); |
39 out_node_data->role = ui::AX_ROLE_CLIENT; | 42 out_node_data->role = ui::AX_ROLE_CLIENT; |
40 out_node_data->location = widget_->GetWindowBoundsInScreen(); | 43 out_node_data->location = widget_->GetWindowBoundsInScreen(); |
41 // TODO(dtseng): Set better states. | 44 // TODO(dtseng): Set better states. |
42 out_node_data->state = 0; | 45 out_node_data->state = 0; |
43 } | 46 } |
44 | 47 |
45 int32_t AXWidgetObjWrapper::GetID() { | 48 int32_t AXWidgetObjWrapper::GetID() { |
46 return AXAuraObjCache::GetInstance()->GetID(widget_); | 49 return AXAuraObjCache::GetInstance()->GetID(widget_); |
47 } | 50 } |
48 | 51 |
49 void AXWidgetObjWrapper::OnWidgetDestroying(Widget* widget) { | 52 void AXWidgetObjWrapper::OnWidgetDestroying(Widget* widget) { |
50 AXAuraObjCache::GetInstance()->Remove(widget); | 53 AXAuraObjCache::GetInstance()->Remove(widget); |
51 } | 54 } |
52 | 55 |
53 void AXWidgetObjWrapper::OnWillRemoveView(Widget* widget, View* view) { | 56 void AXWidgetObjWrapper::OnWillRemoveView(Widget* widget, View* view) { |
54 AXAuraObjCache::GetInstance()->RemoveViewSubtree(view); | 57 AXAuraObjCache::GetInstance()->RemoveViewSubtree(view); |
55 } | 58 } |
56 | 59 |
57 } // namespace views | 60 } // namespace views |
OLD | NEW |