| 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 903fed1aa9912ae2f370b0a7e7d5952244148b8b..c823d42b95405807cde9be6f7b0bfcadea51d0b7 100644
|
| --- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
|
| +++ b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
|
| @@ -33,34 +33,45 @@ TabModalConfirmDialogDelegate::~TabModalConfirmDialogDelegate() {
|
| Cancel();
|
| }
|
|
|
| -void TabModalConfirmDialogDelegate::Cancel() {
|
| +bool TabModalConfirmDialogDelegate::Cancel() {
|
| if (closing_)
|
| - return;
|
| - // Make sure we won't do anything when |Cancel()| or |Accept()| is called
|
| - // again.
|
| + return false;
|
| + // Make sure we won't do anything when another action occurs.
|
| closing_ = true;
|
| OnCanceled();
|
| CloseDialog();
|
| + return true;
|
| }
|
|
|
| -void TabModalConfirmDialogDelegate::Accept() {
|
| +bool TabModalConfirmDialogDelegate::Accept() {
|
| if (closing_)
|
| - return;
|
| - // Make sure we won't do anything when |Cancel()| or |Accept()| is called
|
| - // again.
|
| + return false;
|
| + // Make sure we won't do anything when another action occurs.
|
| closing_ = true;
|
| OnAccepted();
|
| CloseDialog();
|
| + return true;
|
| }
|
|
|
| -void TabModalConfirmDialogDelegate::LinkClicked(
|
| +bool TabModalConfirmDialogDelegate::LinkClicked(
|
| WindowOpenDisposition disposition) {
|
| if (closing_)
|
| - return;
|
| + return false;
|
| // Make sure we won't do anything when another action occurs.
|
| closing_ = true;
|
| OnLinkClicked(disposition);
|
| CloseDialog();
|
| + return true;
|
| +}
|
| +
|
| +bool TabModalConfirmDialogDelegate::Dismissed() {
|
| + if (closing_)
|
| + return false;
|
| + // Make sure we won't do anything when another action occurs.
|
| + closing_ = true;
|
| + OnDismissed();
|
| + CloseDialog();
|
| + return true;
|
| }
|
|
|
| void TabModalConfirmDialogDelegate::Observe(
|
| @@ -71,7 +82,7 @@ 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();
|
| + Dismissed();
|
| } else {
|
| NOTREACHED();
|
| }
|
| @@ -111,6 +122,9 @@ void TabModalConfirmDialogDelegate::OnLinkClicked(
|
| WindowOpenDisposition disposition) {
|
| }
|
|
|
| +void TabModalConfirmDialogDelegate::OnDismissed() {
|
| +}
|
| +
|
| void TabModalConfirmDialogDelegate::CloseDialog() {
|
| if (close_delegate_)
|
| close_delegate_->CloseDialog();
|
|
|