Index: chrome/browser/instant/instant_loader.cc |
diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc |
index f686ecb88928eca1229c996078012340a2a1c702..12deb9b960f978a223cf7158612c1124dcda9d4f 100644 |
--- a/chrome/browser/instant/instant_loader.cc |
+++ b/chrome/browser/instant/instant_loader.cc |
@@ -139,6 +139,19 @@ void InstantLoader::FrameLoadObserver::Observe( |
} |
} |
+// If this is being called, something is swapping in to our preview_contents_ |
+// before we've added it to the tab strip. |
+void InstantLoader::SwapTabContents(TabContentsWrapper* old_tc, |
+ TabContentsWrapper* new_tc) { |
+ DCHECK(old_tc == preview_contents_); |
+ // We release here without deleting so that the caller still has reponsibility |
+ // for deleting the TabContentsWrapper. The (void) cast is so that we use the |
+ // returned value. |
+ TabContentsWrapper* tab_contents_wrapper = preview_contents_.release(); |
sky
2011/05/19 19:53:55
ignore_result
dominich
2011/05/19 23:57:28
Done.
|
+ (void) tab_contents_wrapper; |
+ preview_contents_.reset(new_tc); |
sky
2011/05/19 19:53:55
I'm not sure under when this might be invoked. Cou
dominich
2011/05/19 23:57:28
It's invoked if the InstantLoader is the delegate
|
+} |
+ |
// TabContentsDelegateImpl ----------------------------------------------------- |
class InstantLoader::TabContentsDelegateImpl |
@@ -996,6 +1009,7 @@ void InstantLoader::CreatePreviewContents(TabContentsWrapper* tab_contents) { |
new TabContents( |
tab_contents->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); |
preview_contents_.reset(new TabContentsWrapper(new_contents)); |
+ preview_contents_->set_delegate(this); |
preview_contents_->blocked_content_tab_helper()->SetAllContentsBlocked(true); |
// Propagate the max page id. That way if we end up merging the two |
// NavigationControllers (which happens if we commit) none of the page ids |