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

Side by Side Diff: chrome/browser/instant/instant_loader.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, 4 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/instant/instant_loader.h" 5 #include "chrome/browser/instant/instant_loader.h"
6 6
7 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 7 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
8 #include "chrome/browser/history/history_types.h" 8 #include "chrome/browser/history/history_types.h"
9 #include "chrome/browser/instant/instant_loader_delegate.h" 9 #include "chrome/browser/instant/instant_loader_delegate.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 supports_instant); 257 supports_instant);
258 } 258 }
259 259
260 // InstantLoader --------------------------------------------------------------- 260 // InstantLoader ---------------------------------------------------------------
261 261
262 InstantLoader::InstantLoader(InstantLoaderDelegate* delegate, 262 InstantLoader::InstantLoader(InstantLoaderDelegate* delegate,
263 const std::string& instant_url, 263 const std::string& instant_url,
264 const TabContents* tab_contents) 264 const TabContents* tab_contents)
265 : loader_delegate_(delegate), 265 : loader_delegate_(delegate),
266 preview_contents_( 266 preview_contents_(
267 new TabContents(content::WebContents::CreateWithSessionStorage( 267 TabContents::Factory::CreateTabContents(
268 tab_contents->profile(), NULL, MSG_ROUTING_NONE, 268 content::WebContents::CreateWithSessionStorage(
269 tab_contents->web_contents(), 269 tab_contents->profile(), NULL, MSG_ROUTING_NONE,
270 tab_contents->web_contents()->GetController(). 270 tab_contents->web_contents(),
271 tab_contents->web_contents()->GetController().
271 GetSessionStorageNamespaceMap()))), 272 GetSessionStorageNamespaceMap()))),
272 supports_instant_(false), 273 supports_instant_(false),
273 instant_url_(instant_url) { 274 instant_url_(instant_url) {
274 } 275 }
275 276
276 InstantLoader::~InstantLoader() { 277 InstantLoader::~InstantLoader() {
277 if (preview_contents()) 278 if (preview_contents())
278 preview_contents_->web_contents()->SetDelegate(NULL); 279 preview_contents_->web_contents()->SetDelegate(NULL);
279 } 280 }
280 281
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 TabContents* new_tc) { 400 TabContents* new_tc) {
400 DCHECK(old_tc == preview_contents_); 401 DCHECK(old_tc == preview_contents_);
401 CleanupPreviewContents(); 402 CleanupPreviewContents();
402 // We release here without deleting so that the caller still has the 403 // We release here without deleting so that the caller still has the
403 // responsibility for deleting the TabContents. 404 // responsibility for deleting the TabContents.
404 ignore_result(preview_contents_.release()); 405 ignore_result(preview_contents_.release());
405 preview_contents_.reset(new_tc); 406 preview_contents_.reset(new_tc);
406 SetupPreviewContents(); 407 SetupPreviewContents();
407 loader_delegate_->SwappedTabContents(this); 408 loader_delegate_->SwappedTabContents(this);
408 } 409 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698