Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Side by Side Diff: chrome/browser/ui/views/external_tab_container_win.cc

Issue 10868072: Make TabContents ctor private; poke hole for existing callers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: all green Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/external_tab_container_win.h" 5 #include "chrome/browser/ui/views/external_tab_container_win.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 // TODO(jcampan): limit focus traversal to contents. 187 // TODO(jcampan): limit focus traversal to contents.
188 188
189 prop_.reset(new ViewProp(GetNativeView(), kWindowObjectKey, this)); 189 prop_.reset(new ViewProp(GetNativeView(), kWindowObjectKey, this));
190 190
191 if (existing_contents) { 191 if (existing_contents) {
192 tab_contents_.reset(existing_contents); 192 tab_contents_.reset(existing_contents);
193 tab_contents_->web_contents()->GetController().SetBrowserContext(profile); 193 tab_contents_->web_contents()->GetController().SetBrowserContext(profile);
194 } else { 194 } else {
195 WebContents* new_contents = WebContents::Create( 195 WebContents* new_contents = WebContents::Create(
196 profile, NULL, MSG_ROUTING_NONE, NULL); 196 profile, NULL, MSG_ROUTING_NONE, NULL);
197 tab_contents_.reset(new TabContents(new_contents)); 197 tab_contents_.reset(TabContents::Factory::CreateTabContents(new_contents));
198 } 198 }
199 199
200 if (!infobars_enabled) 200 if (!infobars_enabled)
201 tab_contents_->infobar_tab_helper()->set_infobars_enabled(false); 201 tab_contents_->infobar_tab_helper()->set_infobars_enabled(false);
202 202
203 tab_contents_->web_contents()->SetDelegate(this); 203 tab_contents_->web_contents()->SetDelegate(this);
204 204
205 tab_contents_->web_contents()-> 205 tab_contents_->web_contents()->
206 GetMutableRendererPrefs()->browser_handles_non_local_top_level_requests = 206 GetMutableRendererPrefs()->browser_handles_non_local_top_level_requests =
207 handle_top_level_requests; 207 handle_top_level_requests;
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 // Reuse the same tab handle here as the new container instance is a dummy 482 // Reuse the same tab handle here as the new container instance is a dummy
483 // instance which does not have an automation client connected at the other 483 // instance which does not have an automation client connected at the other
484 // end. 484 // end.
485 new_container = new TemporaryPopupExternalTabContainerWin( 485 new_container = new TemporaryPopupExternalTabContainerWin(
486 automation_, automation_resource_message_filter_.get()); 486 automation_, automation_resource_message_filter_.get());
487 new_container->SetTabHandle(tab_handle_); 487 new_container->SetTabHandle(tab_handle_);
488 } 488 }
489 489
490 // Make sure that ExternalTabContainer instance is initialized with 490 // Make sure that ExternalTabContainer instance is initialized with
491 // an unwrapped Profile. 491 // an unwrapped Profile.
492 scoped_ptr<TabContents> tab_contents(new TabContents(new_contents)); 492 scoped_ptr<TabContents> tab_contents(
493 TabContents::Factory::CreateTabContents(new_contents));
493 bool result = new_container->Init( 494 bool result = new_container->Init(
494 tab_contents->profile()->GetOriginalProfile(), 495 tab_contents->profile()->GetOriginalProfile(),
495 NULL, 496 NULL,
496 initial_pos, 497 initial_pos,
497 WS_CHILD, 498 WS_CHILD,
498 load_requests_via_automation_, 499 load_requests_via_automation_,
499 handle_top_level_requests_, 500 handle_top_level_requests_,
500 tab_contents.get(), 501 tab_contents.get(),
501 GURL(), 502 GURL(),
502 GURL(), 503 GURL(),
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 if (params.disposition == CURRENT_TAB) { 1255 if (params.disposition == CURRENT_TAB) {
1255 DCHECK(route_all_top_level_navigations_); 1256 DCHECK(route_all_top_level_navigations_);
1256 forward_params.disposition = NEW_FOREGROUND_TAB; 1257 forward_params.disposition = NEW_FOREGROUND_TAB;
1257 } 1258 }
1258 WebContents* new_contents = 1259 WebContents* new_contents =
1259 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); 1260 ExternalTabContainerWin::OpenURLFromTab(source, forward_params);
1260 // support only one navigation for a dummy tab before it is killed. 1261 // support only one navigation for a dummy tab before it is killed.
1261 ::DestroyWindow(GetNativeView()); 1262 ::DestroyWindow(GetNativeView());
1262 return new_contents; 1263 return new_contents;
1263 } 1264 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/tab_strip_model_unittest.cc ('k') | chrome/browser/ui/webui/chrome_web_contents_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698