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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "ui/accessibility/ax_node_data.h" | 8 #include "ui/accessibility/ax_node_data.h" |
9 #include "ui/views/accessibility/ax_aura_obj_cache.h" | 9 #include "ui/views/accessibility/ax_aura_obj_cache.h" |
10 #include "ui/views/accessibility/ax_aura_obj_wrapper.h" | 10 #include "ui/views/accessibility/ax_aura_obj_wrapper.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
27 } | 27 } |
28 | 28 |
29 AXAuraObjWrapper* AXWidgetObjWrapper::GetParent() { | 29 AXAuraObjWrapper* AXWidgetObjWrapper::GetParent() { |
30 return AXAuraObjCache::GetInstance()->GetOrCreate(widget_->GetNativeView()); | 30 return AXAuraObjCache::GetInstance()->GetOrCreate(widget_->GetNativeView()); |
31 } | 31 } |
32 | 32 |
33 void AXWidgetObjWrapper::GetChildren( | 33 void AXWidgetObjWrapper::GetChildren( |
34 std::vector<AXAuraObjWrapper*>* out_children) { | 34 std::vector<AXAuraObjWrapper*>* out_children) { |
35 if (!widget_->IsVisible() || !widget_->GetRootView()->visible()) | 35 if (!widget_->IsVisible() || !widget_->GetRootView()->visible()) |
36 return; | 36 return; |
37 | |
sadrul
2017/02/07 04:19:35
Restore?
yiyix
2017/02/08 19:47:40
Done.
| |
38 out_children->push_back( | 37 out_children->push_back( |
39 AXAuraObjCache::GetInstance()->GetOrCreate(widget_->GetRootView())); | 38 AXAuraObjCache::GetInstance()->GetOrCreate(widget_->GetRootView())); |
40 } | 39 } |
41 | 40 |
42 void AXWidgetObjWrapper::Serialize(ui::AXNodeData* out_node_data) { | 41 void AXWidgetObjWrapper::Serialize(ui::AXNodeData* out_node_data) { |
43 out_node_data->id = GetID(); | 42 out_node_data->id = GetID(); |
44 out_node_data->role = widget_->widget_delegate()->GetAccessibleWindowRole(); | 43 out_node_data->role = widget_->widget_delegate()->GetAccessibleWindowRole(); |
45 out_node_data->AddStringAttribute( | 44 out_node_data->AddStringAttribute( |
46 ui::AX_ATTR_NAME, | 45 ui::AX_ATTR_NAME, |
47 base::UTF16ToUTF8( | 46 base::UTF16ToUTF8( |
(...skipping 18 matching lines...) Expand all Loading... | |
66 // If a widget changes visibility it may affect what's focused, in particular | 65 // If a widget changes visibility it may affect what's focused, in particular |
67 // when a widget that contains the focused view gets hidden. | 66 // when a widget that contains the focused view gets hidden. |
68 AXAuraObjCache::GetInstance()->OnFocusedViewChanged(); | 67 AXAuraObjCache::GetInstance()->OnFocusedViewChanged(); |
69 } | 68 } |
70 | 69 |
71 void AXWidgetObjWrapper::OnWillRemoveView(Widget* widget, View* view) { | 70 void AXWidgetObjWrapper::OnWillRemoveView(Widget* widget, View* view) { |
72 AXAuraObjCache::GetInstance()->RemoveViewSubtree(view); | 71 AXAuraObjCache::GetInstance()->RemoveViewSubtree(view); |
73 } | 72 } |
74 | 73 |
75 } // namespace views | 74 } // namespace views |
OLD | NEW |