Chromium Code Reviews| 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..e9a8aee80178dad556521932db32e4eaafbcae01 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,25 @@ void ChromeResourceDispatcherHostDelegate::RequestBeginning( |
| request->SetPriority(net::IDLE); |
| } |
| -#if defined(OS_ANDROID) |
| + ProfileIOData* io_data = ProfileIOData::FromResourceContext( |
| + resource_context); |
| + bool incognito = io_data->is_incognito(); |
|
darin (slow to review)
2013/09/06 04:18:48
it doesn't look like you need to add the 'incognit
sergeygs
2013/09/06 05:46:46
Yes, right. I originally moved it to reuse it in t
|
| + |
| 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, child_id, route_id, 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,9 +303,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(), |
| incognito, |
| @@ -310,7 +322,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); |