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

Unified Diff: chrome/browser/prerender/prerender_contents.cc

Issue 8785007: Prerenders that send an OpenURL are canceled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment and OVERRIDE Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_final_status.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_contents.cc
diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc
index 967f5c8d4f8583d01c1e71858f753ba20620d5b5..baba5b003d214397bca8bff676aaeea59c64fef3 100644
--- a/chrome/browser/prerender/prerender_contents.cc
+++ b/chrome/browser/prerender/prerender_contents.cc
@@ -88,6 +88,19 @@ class PrerenderContents::TabContentsDelegateImpl
prerender_contents_(prerender_contents) {
}
+ virtual TabContents* OpenURLFromTab(TabContents* source,
+ const OpenURLParams& params) OVERRIDE {
+ // |OpenURLFromTab| is typically called when a frame performs a navigation
+ // that requires the browser to perform the transition instead of WebKit.
+ // Examples include prerendering a site that redirects to an app URL,
+ // or if --enable-strict-site-isolation is specified and the prerendered
+ // frame redirects to a different origin.
+ // TODO(cbentzel): Consider supporting this is if it is a common case
+ // during prerenders.
+ prerender_contents_->Destroy(FINAL_STATUS_OPEN_URL);
+ return NULL;
+ }
+
// TabContentsDelegate implementation:
virtual bool ShouldAddNavigationToHistory(
const history::HistoryAddPageArgs& add_page_args,
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_final_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698