Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: ui/views/accessibility/native_view_accessibility_base.cc

Issue 2944083004: MacViews a11y: Support the "Show menu" action in Textfield and Combobox. (Closed)
Patch Set: more interesting test Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_mac.mm ('k') | ui/views/controls/combobox/combobox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698