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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 loader_->loader_delegate_->InstantSupportDetermined(loader_, | 258 loader_->loader_delegate_->InstantSupportDetermined(loader_, |
259 supports_instant); | 259 supports_instant); |
260 } | 260 } |
261 | 261 |
262 // InstantLoader --------------------------------------------------------------- | 262 // InstantLoader --------------------------------------------------------------- |
263 | 263 |
264 InstantLoader::InstantLoader(InstantLoaderDelegate* delegate, | 264 InstantLoader::InstantLoader(InstantLoaderDelegate* delegate, |
265 const std::string& instant_url, | 265 const std::string& instant_url, |
266 const TabContents* tab_contents) | 266 const TabContents* tab_contents) |
267 : loader_delegate_(delegate), | 267 : loader_delegate_(delegate), |
268 preview_contents_(new TabContents(content::WebContents::Create( | 268 preview_contents_( |
269 tab_contents->profile(), NULL, MSG_ROUTING_NONE, | 269 new TabContents(content::WebContents::CreateWithSessionStorage( |
270 tab_contents->web_contents(), | 270 tab_contents->profile(), NULL, MSG_ROUTING_NONE, |
271 tab_contents->web_contents()->GetController(). | 271 tab_contents->web_contents(), |
272 GetSessionStorageNamespace()))), | 272 tab_contents->web_contents()->GetController(). |
| 273 GetSessionStorageNamespaceMap()))), |
273 supports_instant_(false), | 274 supports_instant_(false), |
274 instant_url_(instant_url) { | 275 instant_url_(instant_url) { |
275 } | 276 } |
276 | 277 |
277 InstantLoader::~InstantLoader() { | 278 InstantLoader::~InstantLoader() { |
278 if (preview_contents()) | 279 if (preview_contents()) |
279 preview_contents_->web_contents()->SetDelegate(NULL); | 280 preview_contents_->web_contents()->SetDelegate(NULL); |
280 } | 281 } |
281 | 282 |
282 void InstantLoader::Init() { | 283 void InstantLoader::Init() { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 TabContents* new_tc) { | 393 TabContents* new_tc) { |
393 DCHECK(old_tc == preview_contents_); | 394 DCHECK(old_tc == preview_contents_); |
394 CleanupPreviewContents(); | 395 CleanupPreviewContents(); |
395 // We release here without deleting so that the caller still has the | 396 // We release here without deleting so that the caller still has the |
396 // responsibility for deleting the TabContents. | 397 // responsibility for deleting the TabContents. |
397 ignore_result(preview_contents_.release()); | 398 ignore_result(preview_contents_.release()); |
398 preview_contents_.reset(new_tc); | 399 preview_contents_.reset(new_tc); |
399 SetupPreviewContents(); | 400 SetupPreviewContents(); |
400 loader_delegate_->SwappedTabContents(this); | 401 loader_delegate_->SwappedTabContents(this); |
401 } | 402 } |
OLD | NEW |