Index: chrome/browser/tab_contents/tab_contents.cc |
=================================================================== |
--- chrome/browser/tab_contents/tab_contents.cc (revision 71719) |
+++ chrome/browser/tab_contents/tab_contents.cc (working copy) |
@@ -1635,6 +1635,17 @@ |
if (!is_error_page) |
content_settings_delegate_->ClearCookieSpecificContentSettings(); |
content_settings_delegate_->ClearGeolocationContentSettings(); |
+ |
+ // Check if the URL we are about to load has been prerendered by any chance, |
+ // and use it if possible. |
+ PrerenderManager* pm = profile()->GetPrerenderManager(); |
cbentzel
2011/01/19 17:08:03
This block of code is now repeated three times - m
tburkard
2011/01/19 19:00:45
Done.
|
+ if (pm != NULL) { |
+ if (pm->MaybeUsePreloadedPage(this, url)) { |
+ // TODO(tburkard): If the preloaded page has not finished preloading |
+ // yet, we should not do this. |
+ DidStopLoading(); |
+ } |
+ } |
} |
} |
@@ -1649,6 +1660,17 @@ |
if (!entry || entry->url() != source_url) |
return; |
entry->set_url(target_url); |
+ |
+ // Check if the URL we are about to load has been prerendered by any chance, |
+ // and use it if possible. |
+ PrerenderManager* pm = profile()->GetPrerenderManager(); |
+ if (pm != NULL) { |
+ if (pm->MaybeUsePreloadedPage(this, target_url)) { |
+ // TODO(tburkard): If the preloaded page has not finished preloading |
+ // yet, we should not do this. |
+ DidStopLoading(); |
+ } |
+ } |
} |
void TabContents::OnDidFailProvisionalLoadWithError( |