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

Unified Diff: chrome/browser/instant/instant_loader.cc

Issue 12730017: Merge 184467 "Instant: Don't commit unless the page supports Ins..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1364/src/
Patch Set: Created 7 years, 9 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_loader.cc
===================================================================
--- chrome/browser/instant/instant_loader.cc (revision 187437)
+++ chrome/browser/instant/instant_loader.cc (working copy)
@@ -18,6 +18,7 @@
#include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/browser/page_navigator.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents_delegate.h"
#include "ipc/ipc_message.h"
@@ -164,6 +165,22 @@
content::WebContents* InstantLoader::WebContentsDelegateImpl::OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) {
+ if (!loader_->supports_instant_) {
+ // If the page doesn't yet support Instant, it hasn't fully loaded.
+ // This is a redirect that we should allow. http://crbug.com/177948
+ content::NavigationController::LoadURLParams load_params(params.url);
+ load_params.transition_type = params.transition;
+ load_params.referrer = params.referrer;
+ load_params.extra_headers = params.extra_headers;
+ load_params.is_renderer_initiated = params.is_renderer_initiated;
+ load_params.transferred_global_request_id =
+ params.transferred_global_request_id;
+ load_params.is_cross_site_redirect = params.is_cross_site_redirect;
+
+ loader_->contents_->GetController().LoadURLWithParams(load_params);
+ return loader_->contents_.get();
+ }
+
content::WebContents* preview = loader_->contents_.get();
if (loader_->controller_->CommitIfPossible(INSTANT_COMMIT_NAVIGATED))
return preview->GetDelegate()->OpenURLFromTab(source, params);
@@ -323,6 +340,8 @@
}
void InstantLoader::AboutToNavigateMainFrame(const GURL& url) {
+ if (!supports_instant_)
+ return;
controller_->InstantLoaderAboutToNavigateMainFrame(url);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698