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

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

Issue 18179004: Dismiss action in tab modal dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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_delegate.h
diff --git a/ui/views/window/dialog_delegate.h b/ui/views/window/dialog_delegate.h
index 7781064ba91245493b287ef170430bb4bd6de763..10bd79d65ca0d92724ca75db018912f1e265d95e 100644
--- a/ui/views/window/dialog_delegate.h
+++ b/ui/views/window/dialog_delegate.h
@@ -54,22 +54,29 @@ class VIEWS_EXPORT DialogDelegate : public ui::DialogModel,
virtual View* CreateFootnoteView();
// For Dialog boxes, if there is a "Cancel" button or no dialog button at all,
- // this is called when the user presses the "Cancel" button or the Close
- // button on the window or in the system menu, or presses the Esc key.
- // This function should return true if the window can be closed after it
- // returns, or false if it must remain open.
+ // this is called when the user presses the "Cancel" button or the Esc key.
+ // It can also be called on a dismiss action if |Dismiss| has not been
+ // overridden. This function should return true if the window can be closed
+ // after it returns, or false if it must remain open.
virtual bool Cancel();
// For Dialog boxes, this is called when the user presses the "OK" button,
- // or the Enter key. Can also be called on Esc key or close button
- // presses if there is no "Cancel" button. This function should return
- // true if the window can be closed after it returns, or false if it must
- // remain open. If |window_closing| is true, it means that this handler is
+ // or the Enter key. It can also be called on a dismiss action if |Dismiss|
+ // has not been overridden. This function should return true if the window
+ // can be closed after it returns, or false if it must remain open.
+ // If |window_closing| is true, it means that this handler is
// being called because the window is being closed (e.g. by Window::Close)
// and there is no Cancel handler, so Accept is being called instead.
virtual bool Accept(bool window_closing);
virtual bool Accept();
+ // For Dialog boxes, this is called when the user presses the Close button
+ // on the window or in the system menu. The default behavior is to call
+ // |Cancel| if the dialog has a "Cancel" button or no button at all, or
+ // |Accept| otherwise. This function should return true if the window can be
+ // closed after it returns, or false if it must remain open.
+ virtual bool Dismiss();
+
// Overridden from ui::DialogModel:
virtual base::string16 GetDialogLabel() const OVERRIDE;
virtual base::string16 GetDialogTitle() const OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698