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

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

Issue 2628373002: MacViews: Support MODAL_TYPE_WINDOW in dialog tests. (Closed)
Patch Set: rebase Created 3 years, 11 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 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 7da431fc0337d2b79b46c88c11906434db84fcd6..eb23991cb9e43a69703bc5f29026dbe52852302f 100644
--- a/ui/views/widget/native_widget_mac.mm
+++ b/ui/views/widget/native_widget_mac.mm
@@ -691,8 +691,16 @@ void NativeWidgetPrivate::GetAllChildWidgets(gfx::NativeView native_view,
if ([[native_view window] contentView] != native_view)
return;
- for (NSWindow* native_child in [[native_view window] childWindows])
+ // Collect -sheets and -childWindows. A window should never appear in both,
+ // since that causes AppKit to glitch.
+ NSArray* sheet_children = [[native_view window] sheets];
+ for (NSWindow* native_child in sheet_children)
GetAllChildWidgets([native_child contentView], children);
+
+ for (NSWindow* native_child in [[native_view window] childWindows]) {
+ DCHECK(![sheet_children containsObject:native_child]);
+ GetAllChildWidgets([native_child contentView], children);
+ }
return;
}
@@ -720,7 +728,16 @@ void NativeWidgetPrivate::GetAllChildWidgets(gfx::NativeView native_view,
// static
void NativeWidgetPrivate::GetAllOwnedWidgets(gfx::NativeView native_view,
Widget::Widgets* owned) {
- NOTIMPLEMENTED();
+ BridgedNativeWidget* bridge =
+ NativeWidgetMac::GetBridgeForNativeWindow([native_view window]);
+ if (!bridge) {
+ GetAllChildWidgets(native_view, owned);
+ return;
+ }
+ if (bridge->ns_view() != native_view)
+ return;
+ for (BridgedNativeWidget* child : bridge->child_windows())
+ GetAllChildWidgets(child->ns_view(), owned);
}
// static
« 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