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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2746733002: Fix shouldOverrideUrlLoading being called with the wrong is_redirect value with PlzNavigate. (Closed)
Patch Set: without PlzNavigate Created 3 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 | « content/child/web_url_loader_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index aa76a1ed0948dd124ec4950bfe8fdb1679166ede..39b28f8f91ff284089b77c90ceebc7eb87acde4a 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -5254,10 +5254,21 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
->navigation_state()
->IsContentInitiated()
: !IsBrowserInitiated(pending_navigation_params_.get());
+
+ // Webkit is asking whether to navigate to a new URL.
+ // This is fine normally, except if we're showing UI from one security
+ // context and they're trying to navigate to a different context.
+ const GURL& url = info.urlRequest.url();
+
+ // With PlzNavigate, the redirect list is available for the first url. So
+ // maintain the old behavior of not classifying the first URL in the chain as
+ // a redirect.
bool is_redirect =
info.extraData ||
(pending_navigation_params_ &&
- !pending_navigation_params_->request_params.redirects.empty());
+ !pending_navigation_params_->request_params.redirects.empty() &&
+ (!IsBrowserSideNavigationEnabled() ||
+ url != pending_navigation_params_->request_params.redirects[0]));
#ifdef OS_ANDROID
bool render_view_was_created_by_renderer =
@@ -5275,11 +5286,6 @@ WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation(
Referrer referrer(
RenderViewImpl::GetReferrerFromRequest(frame_, info.urlRequest));
- // Webkit is asking whether to navigate to a new URL.
- // This is fine normally, except if we're showing UI from one security
- // context and they're trying to navigate to a different context.
- const GURL& url = info.urlRequest.url();
-
// If the browser is interested, then give it a chance to look at the request.
if (is_content_initiated && IsTopLevelNavigation(frame_) &&
render_view_->renderer_preferences_
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698