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

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

Issue 2645253002: DesktopAura: Track windows "owned" via the DesktopWindowTreeHost (Closed)
Patch Set: Rejig so we can use kDesktopNativeWidgetAuraKey Created 3 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 "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
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);
tapted 2017/01/25 11:23:03 I don't think the concept of "ownership" here exte
sky 2017/01/25 16:41:24 It's my understanding GetAllOwnedWidget is only ca
tapted 2017/01/27 05:34:55 Yes - it forms part of http://crbug.com/654151 (ad
tapted 2017/01/30 10:33:04 /* snip */ In case this pops in your queue first,
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
OLDNEW
« no previous file with comments | « no previous file | ui/views/mus/desktop_window_tree_host_mus.h » ('j') | ui/views/mus/desktop_window_tree_host_mus.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698