summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/dom_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/views/dom_view.cc')
-rw-r--r--chrome/browser/views/dom_view.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/views/dom_view.cc b/chrome/browser/views/dom_view.cc
index ffa9c1d..3e1c777 100644
--- a/chrome/browser/views/dom_view.cc
+++ b/chrome/browser/views/dom_view.cc
@@ -11,8 +11,11 @@ DOMView::DOMView() : initialized_(false), web_contents_(NULL) {
}
DOMView::~DOMView() {
- if (web_contents_.get())
+ if (web_contents_) {
Detach();
+ web_contents_->Destroy();
+ web_contents_ = NULL;
+ }
}
bool DOMView::Init(Profile* profile, SiteInstance* instance) {
@@ -20,13 +23,13 @@ bool DOMView::Init(Profile* profile, SiteInstance* instance) {
return true;
initialized_ = true;
- web_contents_.reset(new WebContents(profile, instance,
- MSG_ROUTING_NONE, NULL));
+ web_contents_ = new WebContents(profile, instance, MSG_ROUTING_NONE, NULL);
views::HWNDView::Attach(web_contents_->GetNativeView());
+ web_contents_->SetupController(profile);
return true;
}
void DOMView::LoadURL(const GURL& url) {
DCHECK(initialized_);
- web_contents_->controller().LoadURL(url, GURL(), PageTransition::START_PAGE);
+ web_contents_->controller()->LoadURL(url, GURL(), PageTransition::START_PAGE);
}