Chromium Code Reviews| 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(); |
|
Ben Goodger (Google)
2013/07/23 17:52:09
Can we call this "Close()"? That is more in keepin
fdoray
2013/07/24 15:09:16
Yes... but there is a |OnClose| method in DialogDe
Ben Goodger (Google)
2013/07/24 17:56:21
I'd change the notification below to OnClosed() (p
fdoray
2013/07/24 20:21:07
Done.
Little concern about using a verb: as I sai
|
| + |
| // Overridden from ui::DialogModel: |
| virtual base::string16 GetDialogLabel() const OVERRIDE; |
| virtual base::string16 GetDialogTitle() const OVERRIDE; |