| 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..c8e1a588267fdb65c9dd7c1a5024eb1edd53c050 100644
|
| --- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
|
| +++ b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
|
| @@ -16,11 +16,9 @@ using content::WebContents;
|
|
|
| TabModalConfirmDialogDelegate::TabModalConfirmDialogDelegate(
|
| WebContents* web_contents)
|
| - : close_delegate_(NULL),
|
| + : operations_delegate_(NULL),
|
| closing_(false) {
|
| NavigationController* controller = &web_contents->GetController();
|
| - registrar_.Add(this, content::NOTIFICATION_LOAD_START,
|
| - content::Source<NavigationController>(controller));
|
| registrar_.Add(this, chrome::NOTIFICATION_TAB_CLOSING,
|
| content::Source<NavigationController>(controller));
|
| }
|
| @@ -28,7 +26,7 @@ TabModalConfirmDialogDelegate::TabModalConfirmDialogDelegate(
|
| TabModalConfirmDialogDelegate::~TabModalConfirmDialogDelegate() {
|
| // If we end up here, the window has been closed, so make sure we don't close
|
| // it again.
|
| - close_delegate_ = NULL;
|
| + operations_delegate_ = NULL;
|
| // Make sure everything is cleaned up.
|
| Cancel();
|
| }
|
| @@ -67,10 +65,8 @@ void TabModalConfirmDialogDelegate::Observe(
|
| int type,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) {
|
| - // Close the dialog if we load a page (because the action might not apply to
|
| - // the same page anymore) or if the tab is closed.
|
| - if (type == content::NOTIFICATION_LOAD_START ||
|
| - type == chrome::NOTIFICATION_TAB_CLOSING) {
|
| + // Close the dialog if the tab is closed.
|
| + if (type == chrome::NOTIFICATION_TAB_CLOSING) {
|
| Cancel();
|
| } else {
|
| NOTREACHED();
|
| @@ -112,6 +108,6 @@ void TabModalConfirmDialogDelegate::OnLinkClicked(
|
| }
|
|
|
| void TabModalConfirmDialogDelegate::CloseDialog() {
|
| - if (close_delegate_)
|
| - close_delegate_->CloseDialog();
|
| + if (operations_delegate_)
|
| + operations_delegate_->CloseDialog();
|
| }
|
|
|