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

Unified Diff: ui/views/cocoa/bridged_native_widget.mm

Issue 2375903002: Emit OnNativeWidgetDestroying() before clearing the NSWindowDelegate. (Closed)
Patch Set: Add comment Created 4 years, 2 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.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_native_widget.mm
diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm
index b0ab01429cdce334feb89a25766c3dd61b38532a..1ddac6e27c2db91fec37f08e7134a3a64904b959 100644
--- a/ui/views/cocoa/bridged_native_widget.mm
+++ b/ui/views/cocoa/bridged_native_widget.mm
@@ -707,8 +707,10 @@ NSComparisonResult SubviewSorter(NSViewComparatorValue lhs,
parent_->RemoveChildWindow(this);
parent_ = nullptr;
}
- [window_ setDelegate:nil];
[[NSNotificationCenter defaultCenter] removeObserver:window_delegate_];
+ // Note this also clears the NSWindow delegate, after informing Widget
+ // delegates about the closure. NativeWidgetMac then deletes |this| before
+ // returning.
native_widget_mac_->OnWindowWillClose();
}
« no previous file with comments | « no previous file | ui/views/widget/native_widget_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698