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

Unified Diff: content/browser/loader/navigation_resource_handler.cc

Issue 1269813002: Add a NavigationThrottle to the public content/ interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-api
Patch Set: Addressed comments Created 5 years, 3 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/loader/navigation_resource_handler.cc
diff --git a/content/browser/loader/navigation_resource_handler.cc b/content/browser/loader/navigation_resource_handler.cc
index a01e7ef0796eb8b3e804eeb38195196406e29a92..62baab41c4c5324a4a00d87e5625431bf12b0b78 100644
--- a/content/browser/loader/navigation_resource_handler.cc
+++ b/content/browser/loader/navigation_resource_handler.cc
@@ -15,7 +15,10 @@
#include "content/public/browser/stream_handle.h"
#include "content/public/common/resource_response.h"
#include "net/base/net_errors.h"
+#include "net/url_request/redirect_info.h"
#include "net/url_request/url_request.h"
+#include "net/url_request/url_request_context.h"
+#include "net/url_request/url_request_job_factory.h"
namespace content {
@@ -62,7 +65,9 @@ bool NavigationResourceHandler::OnRequestRedirected(
// TODO(davidben): Perform a CSP check here, and anything else that would have
// been done renderer-side.
DevToolsNetLogObserver::PopulateResponseInfo(request(), response);
- core_->NotifyRequestRedirected(redirect_info, response);
+ bool is_external_protocol =
+ !request()->context()->job_factory()->IsHandledURL(redirect_info.new_url);
nasko 2015/09/04 23:36:49 Can some of those smaller bits, like propagating t
clamy 2015/09/08 16:27:19 I've taken out the is_external_protocol update par
+ core_->NotifyRequestRedirected(redirect_info, response, is_external_protocol);
*defer = true;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698