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

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

Issue 1705853002: NOT FOR REVIEW. ax tree focus with debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed crash Created 4 years, 10 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.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_view_state.h" 9 #include "ui/accessibility/ax_view_state.h"
10 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 data_.AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, state.selection_end); 67 data_.AddIntAttribute(ui::AX_ATTR_TEXT_SEL_END, state.selection_end);
68 68
69 data_.state |= (1 << ui::AX_STATE_FOCUSABLE); 69 data_.state |= (1 << ui::AX_STATE_FOCUSABLE);
70 70
71 if (!view_->enabled()) 71 if (!view_->enabled())
72 data_.state |= (1 << ui::AX_STATE_DISABLED); 72 data_.state |= (1 << ui::AX_STATE_DISABLED);
73 73
74 if (!view_->visible()) 74 if (!view_->visible())
75 data_.state |= (1 << ui::AX_STATE_INVISIBLE); 75 data_.state |= (1 << ui::AX_STATE_INVISIBLE);
76 76
77 if (view_->HasFocus())
78 data_.state |= (1 << ui::AX_STATE_FOCUSED);
79
80 return data_; 77 return data_;
81 } 78 }
82 79
83 int NativeViewAccessibility::GetChildCount() { 80 int NativeViewAccessibility::GetChildCount() {
84 int child_count = view_->child_count(); 81 int child_count = view_->child_count();
85 82
86 std::vector<Widget*> child_widgets; 83 std::vector<Widget*> child_widgets;
87 PopulateChildWidgetVector(&child_widgets); 84 PopulateChildWidgetVector(&child_widgets);
88 child_count += child_widgets.size(); 85 child_count += child_widgets.size();
89 86
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 child_widget_platform_node->GetDelegate()); 243 child_widget_platform_node->GetDelegate());
247 if (child_widget_view_accessibility->parent_widget() != widget) 244 if (child_widget_view_accessibility->parent_widget() != widget)
248 child_widget_view_accessibility->SetParentWidget(widget); 245 child_widget_view_accessibility->SetParentWidget(widget);
249 } 246 }
250 247
251 result_child_widgets->push_back(child_widget); 248 result_child_widgets->push_back(child_widget);
252 } 249 }
253 } 250 }
254 251
255 } // namespace views 252 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/accessibility/ax_view_obj_wrapper.cc ('k') | ui/views/controls/menu/menu_scroll_view_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698