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

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: Fix test for Mac Created 7 years, 5 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 | « ui/views/window/dialog_client_view.cc ('k') | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/window/dialog_delegate.h
diff --git a/ui/views/window/dialog_delegate.h b/ui/views/window/dialog_delegate.h
index bd59960e913aa4e8d2161356b8e8205070b702bf..ed4e797f734e296e336de825744fed3c947681b3 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 close action if |Close| 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 close action if |Close|
+ // 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();
+ // Called when the user closes the window without selecting an option,
+ // e.g. by pressing the close button on the window or using a window manager
+ // gesture. By default, this calls Accept() if the only button in the dialog
+ // is Accept, Cancel() otherwise. This function should return true if the
+ // window can be closed after it returns, or false if it must remain open.
+ virtual bool Close();
+
// Overridden from ui::DialogModel:
virtual base::string16 GetDialogLabel() const OVERRIDE;
virtual base::string16 GetDialogTitle() const OVERRIDE;
@@ -101,7 +108,7 @@ class VIEWS_EXPORT DialogDelegate : public ui::DialogModel,
virtual bool UseNewStyleForThisDialog() const;
// Called when the window has been closed.
- virtual void OnClose() {}
+ virtual void OnClosed() {}
// A helper for accessing the DialogClientView object contained by this
// delegate's Window.
« no previous file with comments | « ui/views/window/dialog_client_view.cc ('k') | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698