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

Unified Diff: ui/views/window/dialog_client_view.h

Issue 2825243002: DialogClientView: Handle nested close requests gracefully.
Patch Set: Self review Created 3 years, 8 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/window/dialog_client_view.h
diff --git a/ui/views/window/dialog_client_view.h b/ui/views/window/dialog_client_view.h
index 01faf827be2b50b149051f8db97573ab99c766d3..86ed922f81d42f793a75d7cfb458e4fbd3ed7644 100644
--- a/ui/views/window/dialog_client_view.h
+++ b/ui/views/window/dialog_client_view.h
@@ -104,6 +104,10 @@ class VIEWS_EXPORT DialogClientView : public ClientView,
// After calling this, no button row Views will be in the view hierarchy.
void SetupViews();
+ // Updates |delegate_allowed_close_| using the provided |method|. If |close|
+ // is true, invokes Widget::Close() the first time the delegate allows it.
+ void CloseWithDelegateMethod(bool (DialogDelegate::*method)(), bool close);
+
// How much to inset the button row.
gfx::Insets button_row_insets_;
@@ -127,6 +131,11 @@ class VIEWS_EXPORT DialogClientView : public ClientView,
// twice, which can have bad consequences.
bool delegate_allowed_close_ = false;
+ // True while asking the delegate whether a close should occur. The delegate
+ // may perform actions that trigger a nested close query. DialogClientView
+ // ignores these nested requests, and only acts on the first on the stack.
+ bool asking_delegate_whether_to_close_ = false;
+
// Used to prevent unnecessary or potentially harmful changes during
// SetupLayout(). Everything will be manually updated afterwards.
bool adding_or_removing_views_ = false;
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_message_bubble_view_browsertest.cc ('k') | ui/views/window/dialog_client_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698