From b618713c323f0a5e85fb53300719e8ff1cdb410b Mon Sep 17 00:00:00 2001 From: "tim@chromium.org" Date: Wed, 21 Jan 2009 23:20:48 +0000 Subject: 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 --- chrome/browser/alternate_nav_url_fetcher.cc | 9 --------- 1 file changed, 9 deletions(-) (limited to 'chrome/browser/alternate_nav_url_fetcher.cc') 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(controller_)); - registrar_.Add(this, NOTIFY_TAB_CLOSED, - Source(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(); } -- cgit v1.1