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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 if (view_->IsAccessibilityFocusable()) | 83 if (view_->IsAccessibilityFocusable()) |
84 data_.AddState(ui::AX_STATE_FOCUSABLE); | 84 data_.AddState(ui::AX_STATE_FOCUSABLE); |
85 | 85 |
86 if (!view_->enabled()) | 86 if (!view_->enabled()) |
87 data_.AddState(ui::AX_STATE_DISABLED); | 87 data_.AddState(ui::AX_STATE_DISABLED); |
88 | 88 |
89 if (!view_->IsDrawn()) | 89 if (!view_->IsDrawn()) |
90 data_.AddState(ui::AX_STATE_INVISIBLE); | 90 data_.AddState(ui::AX_STATE_INVISIBLE); |
91 | 91 |
| 92 if (view_->context_menu_controller()) |
| 93 data_.AddAction(ui::AX_ACTION_SHOW_CONTEXT_MENU); |
| 94 |
92 // Make sure this element is excluded from the a11y tree if there's a | 95 // 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. | 96 // focusable parent. All keyboard focusable elements should be leaf nodes. |
94 // Exceptions to this rule will themselves be accessibility focusable. | 97 // Exceptions to this rule will themselves be accessibility focusable. |
95 if (IsViewUnfocusableChildOfFocusableAncestor(view_)) | 98 if (IsViewUnfocusableChildOfFocusableAncestor(view_)) |
96 data_.role = ui::AX_ROLE_IGNORED; | 99 data_.role = ui::AX_ROLE_IGNORED; |
97 return data_; | 100 return data_; |
98 } | 101 } |
99 | 102 |
100 const ui::AXTreeData& NativeViewAccessibilityBase::GetTreeData() const { | 103 const ui::AXTreeData& NativeViewAccessibilityBase::GetTreeData() const { |
101 CR_DEFINE_STATIC_LOCAL(ui::AXTreeData, empty_data, ()); | 104 CR_DEFINE_STATIC_LOCAL(ui::AXTreeData, empty_data, ()); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 child_widget_platform_node->GetDelegate()); | 256 child_widget_platform_node->GetDelegate()); |
254 if (child_widget_view_accessibility->parent_widget() != widget) | 257 if (child_widget_view_accessibility->parent_widget() != widget) |
255 child_widget_view_accessibility->SetParentWidget(widget); | 258 child_widget_view_accessibility->SetParentWidget(widget); |
256 } | 259 } |
257 | 260 |
258 result_child_widgets->push_back(child_widget); | 261 result_child_widgets->push_back(child_widget); |
259 } | 262 } |
260 } | 263 } |
261 | 264 |
262 } // namespace views | 265 } // namespace views |
OLD | NEW |