summaryrefslogtreecommitdiffstats
path: root/chrome/browser/external_tab_container.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-18 19:52:40 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-18 19:52:40 +0000
commit1ef5ad42064c8ef0d1503b68a7fbac01887ca093 (patch)
tree34a32b11a9db6f69fef27e7e81863d82a29bcd2d /chrome/browser/external_tab_container.cc
parent59b49a66c3cd959fcf9d7b4bd9c6d88c70b39919 (diff)
downloadchromium_src-1ef5ad42064c8ef0d1503b68a7fbac01887ca093.zip
chromium_src-1ef5ad42064c8ef0d1503b68a7fbac01887ca093.tar.gz
chromium_src-1ef5ad42064c8ef0d1503b68a7fbac01887ca093.tar.bz2
Reverting 14005.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14006 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/external_tab_container.cc')
-rw-r--r--chrome/browser/external_tab_container.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc
index 230c670..d9d375c 100644
--- a/chrome/browser/external_tab_container.cc
+++ b/chrome/browser/external_tab_container.cc
@@ -68,6 +68,7 @@ bool ExternalTabContainer::Init(Profile* profile, HWND parent,
focus_manager->AddKeystrokeListener(this);
tab_contents_ = new WebContents(profile, NULL, MSG_ROUTING_NONE, NULL);
+ tab_contents_->SetupController(profile);
tab_contents_->set_delegate(this);
tab_contents_->render_view_host()->AllowExternalHostBindings();
@@ -90,7 +91,8 @@ bool ExternalTabContainer::Init(Profile* profile, HWND parent,
DCHECK(dummy->IsFocusable());
root_view_.AddChildView(dummy);
- NavigationController* controller = &tab_contents_->controller();
+ NavigationController* controller = tab_contents_->controller();
+ DCHECK(controller);
registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED,
Source<NavigationController>(controller));
registrar_.Add(this, NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR,
@@ -129,12 +131,18 @@ bool ExternalTabContainer::Uninitialize(HWND window) {
root_view_.RemoveAllChildViews(true);
if (tab_contents_) {
+ NavigationController* controller = tab_contents_->controller();
+ DCHECK(controller);
+
NotificationService::current()->Notify(
NotificationType::EXTERNAL_TAB_CLOSED,
- Source<NavigationController>(&tab_contents_->controller()),
+ Source<NavigationController>(controller),
Details<ExternalTabContainer>(this));
- delete tab_contents_;
+ tab_contents_->set_delegate(NULL);
+ tab_contents_->CloseContents();
+ // WARNING: tab_contents_ has likely been deleted.
+ tab_contents_ = NULL;
}
return true;
@@ -301,7 +309,7 @@ void ExternalTabContainer::Observe(NotificationType type,
automation_->Send(new AutomationMsg_DidNavigate(
0, commit->type,
commit->previous_entry_index -
- tab_contents_->controller().last_committed_entry_index(),
+ tab_contents_->controller()->last_committed_entry_index(),
commit->entry->url()));
}
break;