| 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.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 "ui/events/event_utils.h" | 8 #include "ui/events/event_utils.h" |
| 9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 10 #include "ui/views/controls/native/native_view_host.h" | 10 #include "ui/views/controls/native/native_view_host.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 } | 248 } |
| 249 | 249 |
| 250 void NativeViewAccessibility::PopulateChildWidgetVector( | 250 void NativeViewAccessibility::PopulateChildWidgetVector( |
| 251 std::vector<Widget*>* result_child_widgets) { | 251 std::vector<Widget*>* result_child_widgets) { |
| 252 // Only attach child widgets to the root view. | 252 // Only attach child widgets to the root view. |
| 253 Widget* widget = view_->GetWidget(); | 253 Widget* widget = view_->GetWidget(); |
| 254 if (!widget || widget->GetRootView() != view_) | 254 if (!widget || widget->GetRootView() != view_) |
| 255 return; | 255 return; |
| 256 | 256 |
| 257 std::set<Widget*> child_widgets; | 257 std::set<Widget*> child_widgets; |
| 258 Widget::GetAllOwnedWidgets(widget->GetNativeView(), &child_widgets); | 258 Widget::GetAllOwnedWidgets(widget->GetNativeView(), &child_widgets, false); |
| 259 for (auto iter = child_widgets.begin(); iter != child_widgets.end(); ++iter) { | 259 for (auto iter = child_widgets.begin(); iter != child_widgets.end(); ++iter) { |
| 260 Widget* child_widget = *iter; | 260 Widget* child_widget = *iter; |
| 261 DCHECK_NE(widget, child_widget); | 261 DCHECK_NE(widget, child_widget); |
| 262 | 262 |
| 263 if (!child_widget->IsVisible()) | 263 if (!child_widget->IsVisible()) |
| 264 continue; | 264 continue; |
| 265 | 265 |
| 266 if (widget->GetNativeWindowProperty(kWidgetNativeViewHostKey)) | 266 if (widget->GetNativeWindowProperty(kWidgetNativeViewHostKey)) |
| 267 continue; | 267 continue; |
| 268 | 268 |
| 269 gfx::NativeViewAccessible child_widget_accessible = | 269 gfx::NativeViewAccessible child_widget_accessible = |
| 270 child_widget->GetRootView()->GetNativeViewAccessible(); | 270 child_widget->GetRootView()->GetNativeViewAccessible(); |
| 271 ui::AXPlatformNode* child_widget_platform_node = | 271 ui::AXPlatformNode* child_widget_platform_node = |
| 272 ui::AXPlatformNode::FromNativeViewAccessible(child_widget_accessible); | 272 ui::AXPlatformNode::FromNativeViewAccessible(child_widget_accessible); |
| 273 if (child_widget_platform_node) { | 273 if (child_widget_platform_node) { |
| 274 NativeViewAccessibility* child_widget_view_accessibility = | 274 NativeViewAccessibility* child_widget_view_accessibility = |
| 275 static_cast<NativeViewAccessibility*>( | 275 static_cast<NativeViewAccessibility*>( |
| 276 child_widget_platform_node->GetDelegate()); | 276 child_widget_platform_node->GetDelegate()); |
| 277 if (child_widget_view_accessibility->parent_widget() != widget) | 277 if (child_widget_view_accessibility->parent_widget() != widget) |
| 278 child_widget_view_accessibility->SetParentWidget(widget); | 278 child_widget_view_accessibility->SetParentWidget(widget); |
| 279 } | 279 } |
| 280 | 280 |
| 281 result_child_widgets->push_back(child_widget); | 281 result_child_widgets->push_back(child_widget); |
| 282 } | 282 } |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace views | 285 } // namespace views |
| OLD | NEW |