summaryrefslogtreecommitdiffstats
path: root/chrome/browser/alternate_nav_url_fetcher.cc
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-21 23:20:48 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-21 23:20:48 +0000
commitb618713c323f0a5e85fb53300719e8ff1cdb410b (patch)
tree6782542670381c37d6b64667268f092470c57efc /chrome/browser/alternate_nav_url_fetcher.cc
parent930eefad81129f1c8db7621f8a02e02b855adf90 (diff)
downloadchromium_src-b618713c323f0a5e85fb53300719e8ff1cdb410b.zip
chromium_src-b618713c323f0a5e85fb53300719e8ff1cdb410b.tar.gz
chromium_src-b618713c323f0a5e85fb53300719e8ff1cdb410b.tar.bz2
Fix issue 6520 by ensuring that InfoBarClosed is called whenever a tab is closed or a navigation to a URL that is not supported by the current TabContentsType takes place by invoking it on all InfoBarDelegates from TabContents::Destroy(), which is the best least-common-denominator I've found for doing this work. Alternatively I could have made InfoBarDelegate listen for TAB_CONTENTS_DESTROYED and self-invoke InfoBarClosed but that seemed unorthodox (relatively speaking).
This prevents InfoBarDelegates from leaking in these cases. BUG=6520 Review URL: http://codereview.chromium.org/18381 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8406 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/alternate_nav_url_fetcher.cc')
-rw-r--r--chrome/browser/alternate_nav_url_fetcher.cc9
1 files changed, 0 insertions, 9 deletions
diff --git a/chrome/browser/alternate_nav_url_fetcher.cc b/chrome/browser/alternate_nav_url_fetcher.cc
index 24e6a4b..d7642b6 100644
--- a/chrome/browser/alternate_nav_url_fetcher.cc
+++ b/chrome/browser/alternate_nav_url_fetcher.cc
@@ -39,8 +39,6 @@ void AlternateNavURLFetcher::Observe(NotificationType type,
NotificationService::AllSources());
registrar_.Add(this, NOTIFY_NAV_ENTRY_COMMITTED,
Source<NavigationController>(controller_));
- registrar_.Add(this, NOTIFY_TAB_CLOSED,
- Source<NavigationController>(controller_));
DCHECK_EQ(NOT_STARTED, state_);
state_ = IN_PROGRESS;
@@ -58,13 +56,6 @@ void AlternateNavURLFetcher::Observe(NotificationType type,
ShowInfobarIfPossible();
break;
- case NOTIFY_TAB_CLOSED:
- // We listen either for tab closed or navigation committed to know when to
- // delete ourselves. Here, the tab closed, so we can just give up with
- // all our waiting for notifications and delete ourselves.
- delete this;
- break;
-
default:
NOTREACHED();
}