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

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

Issue 2375903002: Emit OnNativeWidgetDestroying() before clearing the NSWindowDelegate. (Closed)
Patch Set: Created 4 years, 3 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
Index: ui/views/cocoa/bridged_native_widget.h
diff --git a/ui/views/cocoa/bridged_native_widget.h b/ui/views/cocoa/bridged_native_widget.h
index d1e2d08a516abbee267e4934cf6a2e15aee7b874..373580d956356b1cda8fc783fb011c3d722d08a7 100644
--- a/ui/views/cocoa/bridged_native_widget.h
+++ b/ui/views/cocoa/bridged_native_widget.h
@@ -321,6 +321,14 @@ class VIEWS_EXPORT BridgedNativeWidget
AssociatedViews associated_views_;
+ // We will set this flag to false inside OnWindowWillClose().
+ // For teardown flows (e.g. Widget::WIDGET_OWNS_NATIVE_WIDGET or
+ // Widget::CloseNow()) we needs to be invoked manually OnWindowWillClose()
+ // in destructor.
+ // But [NSWindow close] would synchronously call OnWindowWillClose() so to
+ // prevent second call in destructor we use this flag.
+ bool close_window_ = true;
+
DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget);
};

Powered by Google App Engine
This is Rietveld 408576698