OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/native_view_accessibility_base.h" | 5 #include "ui/views/accessibility/native_view_accessibility_base.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "ui/events/event_utils.h" | 9 #include "ui/events/event_utils.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 data_.AddState(ui::AX_STATE_INVISIBLE); | 90 data_.AddState(ui::AX_STATE_INVISIBLE); |
91 | 91 |
92 // Make sure this element is excluded from the a11y tree if there's a | 92 // Make sure this element is excluded from the a11y tree if there's a |
93 // focusable parent. All keyboard focusable elements should be leaf nodes. | 93 // focusable parent. All keyboard focusable elements should be leaf nodes. |
94 // Exceptions to this rule will themselves be accessibility focusable. | 94 // Exceptions to this rule will themselves be accessibility focusable. |
95 if (IsViewUnfocusableChildOfFocusableAncestor(view_)) | 95 if (IsViewUnfocusableChildOfFocusableAncestor(view_)) |
96 data_.role = ui::AX_ROLE_IGNORED; | 96 data_.role = ui::AX_ROLE_IGNORED; |
97 return data_; | 97 return data_; |
98 } | 98 } |
99 | 99 |
| 100 const ui::AXTreeData& NativeViewAccessibilityBase::GetTreeData() const { |
| 101 CR_DEFINE_STATIC_LOCAL(ui::AXTreeData, empty_data, ()); |
| 102 return empty_data; |
| 103 } |
| 104 |
100 int NativeViewAccessibilityBase::GetChildCount() { | 105 int NativeViewAccessibilityBase::GetChildCount() { |
101 int child_count = view_->child_count(); | 106 int child_count = view_->child_count(); |
102 | 107 |
103 std::vector<Widget*> child_widgets; | 108 std::vector<Widget*> child_widgets; |
104 PopulateChildWidgetVector(&child_widgets); | 109 PopulateChildWidgetVector(&child_widgets); |
105 child_count += child_widgets.size(); | 110 child_count += child_widgets.size(); |
106 | 111 |
107 return child_count; | 112 return child_count; |
108 } | 113 } |
109 | 114 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 child_widget_platform_node->GetDelegate()); | 253 child_widget_platform_node->GetDelegate()); |
249 if (child_widget_view_accessibility->parent_widget() != widget) | 254 if (child_widget_view_accessibility->parent_widget() != widget) |
250 child_widget_view_accessibility->SetParentWidget(widget); | 255 child_widget_view_accessibility->SetParentWidget(widget); |
251 } | 256 } |
252 | 257 |
253 result_child_widgets->push_back(child_widget); | 258 result_child_widgets->push_back(child_widget); |
254 } | 259 } |
255 } | 260 } |
256 | 261 |
257 } // namespace views | 262 } // namespace views |
OLD | NEW |