diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-07 16:48:07 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-07 16:48:07 +0000 |
commit | 3ff3493b8904ee4db7b41cd1676ccdcb127ecbd8 (patch) | |
tree | 6d3dcf4bf6a0f19d553a3e1a2c2eba0a81e72ce3 /chrome/browser/external_tab_container.cc | |
parent | a64691f2882ea7403dc2fcd39f026583e12429fe (diff) | |
download | chromium_src-3ff3493b8904ee4db7b41cd1676ccdcb127ecbd8.zip chromium_src-3ff3493b8904ee4db7b41cd1676ccdcb127ecbd8.tar.gz chromium_src-3ff3493b8904ee4db7b41cd1676ccdcb127ecbd8.tar.bz2 |
Make the RenderViewHostFactory a global. This prevents us from having to pass
a factory pointer around all the time. Removing TestTabContents will require
making the Browser object keep track of the Factory pointer as well, so I think
the global is the best approach and cleans some things up.
Review URL: http://codereview.chromium.org/62044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13255 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/external_tab_container.cc')
-rw-r--r-- | chrome/browser/external_tab_container.cc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index da38c7e..3ec28a89 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -64,20 +64,11 @@ bool ExternalTabContainer::Init(Profile* profile, HWND parent, DCHECK(focus_manager); focus_manager->AddKeystrokeListener(this); - tab_contents_ = TabContents::CreateWithType(TAB_CONTENTS_WEB, profile, - NULL, NULL); - if (!tab_contents_) { - NOTREACHED(); - DestroyWindow(); - return false; - } + tab_contents_ = new WebContents(profile, NULL, MSG_ROUTING_NONE, NULL); tab_contents_->SetupController(profile); tab_contents_->set_delegate(this); - - WebContents* web_conents = tab_contents_->AsWebContents(); - if (web_conents) - web_conents->render_view_host()->AllowExternalHostBindings(); + tab_contents_->render_view_host()->AllowExternalHostBindings(); // Create a TabContentsContainerView to handle focus cycling using Tab and // Shift-Tab. @@ -402,7 +393,7 @@ void ExternalTabContainer::ProcessUnhandledAccelerator(const MSG& msg) { void ExternalTabContainer::SetInitialFocus(bool reverse) { DCHECK(tab_contents_); if (tab_contents_) { - tab_contents_->SetInitialFocus(reverse); + static_cast<TabContents*>(tab_contents_)->SetInitialFocus(reverse); } } |