OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |