From 3ff3493b8904ee4db7b41cd1676ccdcb127ecbd8 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Tue, 7 Apr 2009 16:48:07 +0000 Subject: 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 --- chrome/browser/external_tab_container.cc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'chrome/browser/external_tab_container.cc') 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(tab_contents_)->SetInitialFocus(reverse); } } -- cgit v1.1