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

Unified Diff: ui/views/widget/native_widget_mac.mm

Issue 2535163002: MacViews: Fix Widget::GetAllChildWidgets(gfx::NativeView) for non-Widgets. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/widget/native_widget_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_mac.mm
diff --git a/ui/views/widget/native_widget_mac.mm b/ui/views/widget/native_widget_mac.mm
index 28bc1da2d126c3014da169c90542c73a5ee476d9..34655c80fbb1813257fd550f76fe59328f003ff8 100644
--- a/ui/views/widget/native_widget_mac.mm
+++ b/ui/views/widget/native_widget_mac.mm
@@ -689,8 +689,14 @@ void NativeWidgetPrivate::GetAllChildWidgets(gfx::NativeView native_view,
Widget::Widgets* children) {
BridgedNativeWidget* bridge =
NativeWidgetMac::GetBridgeForNativeWindow([native_view window]);
- if (!bridge)
+ if (!bridge) {
+ // The NSWindow is not itself a views::Widget, but it may have children that
+ // are. Note we assume we don't care about children of Widgets that are not
+ // themselves a Widget (those are skipped by this logic).
karandeepb 2016/11/29 05:28:42 It's not clear to me what this comment means- "Not
tapted 2016/11/29 05:51:42 Moved it down to the other for loop and reworded.
karandeepb 2016/11/29 06:00:20 Acknowledged.
+ for (NSWindow* native_child in [[native_view window] childWindows])
+ GetAllChildWidgets([native_child contentView], children);
return;
+ }
// If |native_view| is a subview of the contentView, it will share an
// NSWindow, but will itself be a native child of the Widget. That is, adding
« no previous file with comments | « no previous file | ui/views/widget/native_widget_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698