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

Unified Diff: content/browser/frame_host/navigation_request.cc

Issue 2760463005: Fix handling of external protocols with PlzNavigate. (Closed)
Patch Set: review comments 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
Index: content/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index a5a193160646054bdf9751aaf94b7c100b7092ed..b246aabbf64fba0cbcefc396b13f31bbf2af873d 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -360,15 +360,16 @@ void NavigationRequest::BeginNavigation() {
!navigation_handle_->IsSameDocument()) {
// It's safe to use base::Unretained because this NavigationRequest owns
// the NavigationHandle where the callback will be stored.
- // TODO(clamy): pass the real value for |is_external_protocol| if needed.
// TODO(clamy): pass the method to the NavigationHandle instead of a
// boolean.
+ bool is_external_protocol =
+ !GetContentClient()->browser()->IsHandledURL(common_params_.url);
navigation_handle_->WillStartRequest(
common_params_.method, common_params_.post_data,
Referrer::SanitizeForRequest(common_params_.url,
common_params_.referrer),
- begin_params_.has_user_gesture, common_params_.transition, false,
- begin_params_.request_context_type,
+ begin_params_.has_user_gesture, common_params_.transition,
+ is_external_protocol, begin_params_.request_context_type,
begin_params_.mixed_content_context_type,
base::Bind(&NavigationRequest::OnStartChecksComplete,
base::Unretained(this)));
@@ -480,10 +481,12 @@ void NavigationRequest::OnRequestRedirected(
// It's safe to use base::Unretained because this NavigationRequest owns the
// NavigationHandle where the callback will be stored.
- // TODO(clamy): pass the real value for |is_external_protocol| if needed.
+ bool is_external_protocol =
+ !GetContentClient()->browser()->IsHandledURL(common_params_.url);
navigation_handle_->WillRedirectRequest(
common_params_.url, common_params_.method, common_params_.referrer.url,
- false, response->head.headers, response->head.connection_info,
+ is_external_protocol, response->head.headers,
+ response->head.connection_info,
base::Bind(&NavigationRequest::OnRedirectChecksComplete,
base::Unretained(this)));
}

Powered by Google App Engine
This is Rietveld 408576698