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

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

Issue 2506483002: Views/a11y: Only tag Views AX_STATE_FOCUSABLE if IsAccessibilityFocusable(). (Closed)
Patch Set: Add expectation. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | ui/views/accessibility/native_view_accessibility_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.h" 5 #include "ui/views/accessibility/native_view_accessibility.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "ui/accessibility/ax_action_data.h" 9 #include "ui/accessibility/ax_action_data.h"
10 #include "ui/accessibility/ax_node_data.h" 10 #include "ui/accessibility/ax_node_data.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return data_; 64 return data_;
65 } 65 }
66 66
67 view_->GetAccessibleNodeData(&data_); 67 view_->GetAccessibleNodeData(&data_);
68 data_.location = gfx::RectF(view_->GetBoundsInScreen()); 68 data_.location = gfx::RectF(view_->GetBoundsInScreen());
69 base::string16 description; 69 base::string16 description;
70 view_->GetTooltipText(gfx::Point(), &description); 70 view_->GetTooltipText(gfx::Point(), &description);
71 data_.AddStringAttribute(ui::AX_ATTR_DESCRIPTION, 71 data_.AddStringAttribute(ui::AX_ATTR_DESCRIPTION,
72 base::UTF16ToUTF8(description)); 72 base::UTF16ToUTF8(description));
73 73
74 data_.state |= (1 << ui::AX_STATE_FOCUSABLE); 74 if (view_->IsAccessibilityFocusable())
75 data_.state |= (1 << ui::AX_STATE_FOCUSABLE);
75 76
76 if (!view_->enabled()) 77 if (!view_->enabled())
77 data_.state |= (1 << ui::AX_STATE_DISABLED); 78 data_.state |= (1 << ui::AX_STATE_DISABLED);
78 79
79 if (!view_->visible()) 80 if (!view_->visible())
80 data_.state |= (1 << ui::AX_STATE_INVISIBLE); 81 data_.state |= (1 << ui::AX_STATE_INVISIBLE);
81 82
82 return data_; 83 return data_;
83 } 84 }
84 85
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 child_widget_platform_node->GetDelegate()); 272 child_widget_platform_node->GetDelegate());
272 if (child_widget_view_accessibility->parent_widget() != widget) 273 if (child_widget_view_accessibility->parent_widget() != widget)
273 child_widget_view_accessibility->SetParentWidget(widget); 274 child_widget_view_accessibility->SetParentWidget(widget);
274 } 275 }
275 276
276 result_child_widgets->push_back(child_widget); 277 result_child_widgets->push_back(child_widget);
277 } 278 }
278 } 279 }
279 280
280 } // namespace views 281 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/accessibility/native_view_accessibility_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698