diff options
-rw-r--r-- | chrome/browser/views/dom_view.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/dom_view.h | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/chrome/browser/views/dom_view.cc b/chrome/browser/views/dom_view.cc index 16a1278..4725cf9 100644 --- a/chrome/browser/views/dom_view.cc +++ b/chrome/browser/views/dom_view.cc @@ -22,12 +22,16 @@ bool DOMView::Init(Profile* profile, SiteInstance* instance) { return true; initialized_ = true; - tab_contents_.reset( - new TabContents(profile, instance, MSG_ROUTING_NONE, NULL)); + tab_contents_.reset(CreateTabContents(profile, instance)); views::NativeViewHost::Attach(tab_contents_->GetNativeView()); return true; } +TabContents* DOMView::CreateTabContents(Profile* profile, + SiteInstance* instance) { + return new TabContents(profile, instance, MSG_ROUTING_NONE, NULL); +} + void DOMView::LoadURL(const GURL& url) { DCHECK(initialized_); tab_contents_->controller().LoadURL(url, GURL(), PageTransition::START_PAGE); diff --git a/chrome/browser/views/dom_view.h b/chrome/browser/views/dom_view.h index a9b8f39..f79dd8b 100644 --- a/chrome/browser/views/dom_view.h +++ b/chrome/browser/views/dom_view.h @@ -38,6 +38,11 @@ class DOMView : public views::NativeViewHost { virtual bool SkipDefaultKeyEventProcessing(const views::KeyEvent& e); virtual void Focus(); + // Returns new allocated TabContents instance, caller is responsible deleting. + // Override in derived classes to replace TabContents with derivative. + virtual TabContents* CreateTabContents(Profile* profile, + SiteInstance* instance); + scoped_ptr<TabContents> tab_contents_; private: |