Index: chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc |
diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc |
index c8d87ea66c5d58d1d937f336aed500df8c7cf3f1..9e49df0d9902af42519eb53bab25b59cef60813e 100644 |
--- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc |
+++ b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc |
@@ -36,8 +36,7 @@ TabModalConfirmDialogDelegate::~TabModalConfirmDialogDelegate() { |
void TabModalConfirmDialogDelegate::Cancel() { |
if (closing_) |
return; |
- // Make sure we won't do anything when |Cancel()| or |Accept()| is called |
- // again. |
+ // Make sure we won't do anything when another action occurs. |
closing_ = true; |
OnCanceled(); |
CloseDialog(); |
@@ -46,8 +45,7 @@ void TabModalConfirmDialogDelegate::Cancel() { |
void TabModalConfirmDialogDelegate::Accept() { |
if (closing_) |
return; |
- // Make sure we won't do anything when |Cancel()| or |Accept()| is called |
- // again. |
+ // Make sure we won't do anything when another action occurs. |
closing_ = true; |
OnAccepted(); |
CloseDialog(); |
@@ -71,12 +69,21 @@ void TabModalConfirmDialogDelegate::Observe( |
// the same page anymore) or if the tab is closed. |
if (type == content::NOTIFICATION_LOAD_START || |
type == chrome::NOTIFICATION_TAB_CLOSING) { |
- Cancel(); |
+ Close(); |
} else { |
NOTREACHED(); |
} |
} |
+void TabModalConfirmDialogDelegate::Close() { |
+ if (closing_) |
+ return; |
+ // Make sure we won't do anything when another action occurs. |
+ closing_ = true; |
+ OnClosed(); |
+ CloseDialog(); |
+} |
+ |
gfx::Image* TabModalConfirmDialogDelegate::GetIcon() { |
return NULL; |
} |
@@ -111,6 +118,9 @@ void TabModalConfirmDialogDelegate::OnLinkClicked( |
WindowOpenDisposition disposition) { |
} |
+void TabModalConfirmDialogDelegate::OnClosed() { |
+} |
+ |
void TabModalConfirmDialogDelegate::CloseDialog() { |
if (close_delegate_) |
close_delegate_->CloseDialog(); |