| Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
|
| diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
|
| index 266d8e1b9ed2def0d49ea851cea7b0bc2193f9df..323c13186bafbf8e7bac8254f3f67cdafcf07eb9 100644
|
| --- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
|
| +++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
|
| @@ -64,6 +64,8 @@
|
| #if defined(OS_ANDROID)
|
| #include "chrome/browser/android/intercept_download_resource_throttle.h"
|
| #include "components/navigation_interception/intercept_navigation_delegate.h"
|
| +#else
|
| +#include "chrome/browser/apps/app_url_redirector.h"
|
| #endif
|
|
|
| #if defined(OS_CHROMEOS)
|
| @@ -262,12 +264,23 @@ void ChromeResourceDispatcherHostDelegate::RequestBeginning(
|
| request->SetPriority(net::IDLE);
|
| }
|
|
|
| -#if defined(OS_ANDROID)
|
| + ProfileIOData* io_data = ProfileIOData::FromResourceContext(
|
| + resource_context);
|
| +
|
| if (!is_prerendering && resource_type == ResourceType::MAIN_FRAME) {
|
| +#if defined(OS_ANDROID)
|
| throttles->push_back(
|
| InterceptNavigationDelegate::CreateThrottleFor(request));
|
| - }
|
| +#else
|
| + // Redirect some navigations to apps that have registered matching URL
|
| + // handlers ('url_handlers' in the manifest).
|
| + content::ResourceThrottle* url_to_app_throttle =
|
| + AppUrlRedirector::MaybeCreateThrottleFor(request, io_data);
|
| + if (url_to_app_throttle)
|
| + throttles->push_back(url_to_app_throttle);
|
| #endif
|
| + }
|
| +
|
| #if defined(OS_CHROMEOS)
|
| if (resource_type == ResourceType::MAIN_FRAME) {
|
| // We check offline first, then check safe browsing so that we still can
|
| @@ -288,8 +301,6 @@ void ChromeResourceDispatcherHostDelegate::RequestBeginning(
|
| if (!request->is_pending()) {
|
| net::HttpRequestHeaders headers;
|
| headers.CopyFrom(request->extra_request_headers());
|
| - ProfileIOData* io_data = ProfileIOData::FromResourceContext(
|
| - resource_context);
|
| bool incognito = io_data->is_incognito();
|
| chrome_variations::VariationsHttpHeaderProvider::GetInstance()->
|
| AppendHeaders(request->url(),
|
| @@ -310,7 +321,6 @@ void ChromeResourceDispatcherHostDelegate::RequestBeginning(
|
| resource_type,
|
| throttles);
|
|
|
| - ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
|
| if (io_data->resource_prefetch_predictor_observer()) {
|
| io_data->resource_prefetch_predictor_observer()->OnRequestStarted(
|
| request, resource_type, child_id, route_id);
|
|
|