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

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

Issue 2061693003: MacViews: Suppress visibility changes during an asynchronous close. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Neater, but Linux, Windows disagree on WidgetTest.DesktopNativeWidgetVisibilityAfterCloseTest Created 4 years, 4 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/cocoa/bridged_native_widget.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.h
diff --git a/ui/views/cocoa/bridged_native_widget.h b/ui/views/cocoa/bridged_native_widget.h
index ba4c5847c735b1b578388f5291367c34e34896fc..eb723f1e76e79f9751491d713957c83722fa2ac9 100644
--- a/ui/views/cocoa/bridged_native_widget.h
+++ b/ui/views/cocoa/bridged_native_widget.h
@@ -95,6 +95,8 @@ class VIEWS_EXPORT BridgedNativeWidget
// descendant windows where necessary.
void SetVisibilityState(WindowVisibilityState new_state);
+ void CloseAsynchronously();
+
// Acquiring mouse capture first steals capture from any existing
// CocoaMouseCaptureDelegate, then captures all mouse events until released.
void AcquireCapture();
@@ -227,6 +229,11 @@ class VIEWS_EXPORT BridgedNativeWidget
// frame is ready, or a timeout occurs.
void MaybeWaitForFrame(const gfx::Size& size_in_dip);
+ // Return true if the Widget delegate's modal type is window-modal. These
+ // display as a native window "sheet", and have a different lifetime to
+ // regular windows.
+ bool IsWindowModalSheet() const;
+
// Show the window using -[NSApp beginSheet:..], modal for the parent window.
void ShowAsModalSheet();
@@ -311,6 +318,11 @@ class VIEWS_EXPORT BridgedNativeWidget
// shadow needs to be invalidated when a frame is received for the new shape.
bool invalidate_shadow_on_frame_swap_ = false;
+ // Set when an asynchronous close is pending. Visibility changes should be
+ // suppressed in this case. For a synchronous close (e.g. via -[NSWindow
+ // close]), the NSWindowDelegate is just set to nil.
+ bool close_pending_ = false;
+
AssociatedViews associated_views_;
DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidget);
« no previous file with comments | « no previous file | ui/views/cocoa/bridged_native_widget.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698