Index: chrome/browser/ui/tab_modal_confirm_dialog_delegate.h |
diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h |
index 29413a1242378804f462ef336493701086b90dc0..d5bcd5ac14538c859c3079a4c883ae387d96f232 100644 |
--- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h |
+++ b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h |
@@ -44,20 +44,35 @@ class TabModalConfirmDialogDelegate { |
operations_delegate_ = operations_delegate; |
} |
- // Accepts the confirmation prompt and calls |OnAccepted|. |
+ // Accepts the confirmation prompt and calls |OnAccepted| if no other call |
+ // to |Accept|, |Cancel|, |LinkClicked| or |Close| has been made before. |
// This method is safe to call even from an |OnAccepted| or |OnCanceled| |
// callback. |
- void Accept(); |
+ // Returns true if |OnAccepted| has been called, false otherwise. |
+ bool Accept(); |
- // Cancels the confirmation prompt and calls |OnCanceled|. |
+ // Cancels the confirmation prompt and calls |OnCanceled| if no other call |
+ // to |Accept|, |Cancel|, |LinkClicked| or |Close| has been made before. |
// This method is safe to call even from an |OnAccepted| or |OnCanceled| |
// callback. |
- void Cancel(); |
+ // Returns true if |OnCanceled| has been called, false otherwise. |
+ bool Cancel(); |
// Called when the link (if any) is clicked. Calls |OnLinkClicked| and closes |
- // the dialog. The |disposition| specifies how the resulting document should |
- // be loaded (based on the event flags present when the link was clicked). |
- void LinkClicked(WindowOpenDisposition disposition); |
+ // the dialog if no other call to |Accept|, |Cancel|, |LinkClicked| or |
+ // |Close| has been made before. The |disposition| specifies how the |
+ // resulting document should be loaded (based on the event flags present when |
+ // the link was clicked). |
+ // Returns true if |OnLinkClicked| has been called, false otherwise. |
+ bool LinkClicked(WindowOpenDisposition disposition); |
+ |
+ // Called when the dialog is closed without selecting an option, e.g. by |
+ // pressing the close button on the dialog, using a window manager gesture, |
+ // closing the parent tab or navigating in the parent tab. |
+ // Calls |OnClosed| and closes the dialog if no other call to |Accept|, |
+ // |Cancel|, |LinkClicked| or |Close| has been made before. |
+ // Returns true if |OnClosed| has been called, false otherwise. |
+ bool Close(); |
// The title of the dialog. Note that the title is not shown on all platforms. |
virtual string16 GetTitle() = 0; |
@@ -88,10 +103,9 @@ class TabModalConfirmDialogDelegate { |
} |
private: |
- // It is guaranteed that exactly one of |OnAccepted|, |OnCanceled| or |
- // |OnLinkClicked| is eventually called. These method are private to |
- // enforce this guarantee. Access to them is controlled by |Accept|, |
- // |Cancel| and |LinkClicked|. |
+ // It is guaranteed that exactly one of the |On...| methods is eventually |
+ // called. These method are private to enforce this guarantee. Access to them |
+ // is controlled by |Accept|, |Cancel|, |LinkClicked| and |Close|. |
// Called when the user accepts or cancels the dialog, respectively. |
virtual void OnAccepted(); |
@@ -100,6 +114,9 @@ class TabModalConfirmDialogDelegate { |
// Called when the user clicks on the link (if any). |
virtual void OnLinkClicked(WindowOpenDisposition disposition); |
+ // Called when the dialog is closed. |
+ virtual void OnClosed(); |
+ |
// Close the dialog. |
void CloseDialog(); |