diff options
Diffstat (limited to 'chrome/browser/tab_contents.cc')
-rw-r--r-- | chrome/browser/tab_contents.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/tab_contents.cc b/chrome/browser/tab_contents.cc index 9cdcabe..8e93672 100644 --- a/chrome/browser/tab_contents.cc +++ b/chrome/browser/tab_contents.cc @@ -66,6 +66,7 @@ void TabContents::RegisterUserPrefs(PrefService* prefs) { prefs->RegisterBooleanPref(prefs::kBlockPopups, false); } + void TabContents::CloseContents() { // Destroy our NavigationController, which will Destroy all tabs it owns. controller_->Destroy(); @@ -409,9 +410,9 @@ void TabContents::AddInfoBar(InfoBarDelegate* delegate) { // added. We use this notification to expire InfoBars that need to expire on // page transitions. if (infobar_delegates_.size() == 1) { - DCHECK(controller()); - registrar_.Add(this, NOTIFY_NAV_ENTRY_COMMITTED, - Source<NavigationController>(controller())); + NotificationService::current()->AddObserver( + this, NOTIFY_NAV_ENTRY_COMMITTED, + Source<NavigationController>(controller())); } } @@ -428,8 +429,9 @@ void TabContents::RemoveInfoBar(InfoBarDelegate* delegate) { // Remove ourselves as an observer if we are tracking no more InfoBars. if (infobar_delegates_.empty()) { - registrar_.Remove(this, NOTIFY_NAV_ENTRY_COMMITTED, - Source<NavigationController>(controller())); + NotificationService::current()->RemoveObserver( + this, NOTIFY_NAV_ENTRY_COMMITTED, + Source<NavigationController>(controller())); } } |