Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h" | 5 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 334 request->SetPriority(net::IDLE); | 334 request->SetPriority(net::IDLE); |
| 335 } | 335 } |
| 336 } | 336 } |
| 337 | 337 |
| 338 ProfileIOData* io_data = ProfileIOData::FromResourceContext( | 338 ProfileIOData* io_data = ProfileIOData::FromResourceContext( |
| 339 resource_context); | 339 resource_context); |
| 340 | 340 |
| 341 #if defined(OS_ANDROID) | 341 #if defined(OS_ANDROID) |
| 342 // TODO(davidben): This is insufficient to integrate with prerender properly. | 342 // TODO(davidben): This is insufficient to integrate with prerender properly. |
| 343 // https://crbug.com/370595 | 343 // https://crbug.com/370595 |
| 344 if (!is_prerendering) { | 344 if (!is_prerendering && resource_type != content::RESOURCE_TYPE_MAIN_FRAME) { |
| 345 if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME) { | 345 InterceptNavigationDelegate::UpdateUserGestureCarryoverInfo(request); |
|
davidben
2015/09/01 21:55:17
[This is probably for a separate CL, but... wow, t
clamy
2015/09/03 15:30:51
Done.
| |
| 346 throttles->push_back( | |
| 347 InterceptNavigationDelegate::CreateThrottleFor(request)); | |
| 348 } else { | |
| 349 InterceptNavigationDelegate::UpdateUserGestureCarryoverInfo(request); | |
| 350 } | |
| 351 } | |
| 352 #else | |
| 353 if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME) { | |
| 354 // Redirect some navigations to apps that have registered matching URL | |
| 355 // handlers ('url_handlers' in the manifest). | |
| 356 content::ResourceThrottle* url_to_app_throttle = | |
| 357 AppUrlRedirector::MaybeCreateThrottleFor(request, io_data); | |
| 358 if (url_to_app_throttle) | |
| 359 throttles->push_back(url_to_app_throttle); | |
| 360 } | 346 } |
| 361 #endif | 347 #endif |
| 362 | 348 |
| 363 #if defined(OS_CHROMEOS) | 349 #if defined(OS_CHROMEOS) |
| 364 // Check if we need to add merge session throttle. This throttle will postpone | 350 // Check if we need to add merge session throttle. This throttle will postpone |
| 365 // loading of main frames and XHR request. | 351 // loading of main frames and XHR request. |
| 366 if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME || | 352 if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME || |
| 367 resource_type == content::RESOURCE_TYPE_XHR) { | 353 resource_type == content::RESOURCE_TYPE_XHR) { |
| 368 // Add interstitial page while merge session process (cookie | 354 // Add interstitial page while merge session process (cookie |
| 369 // reconstruction from OAuth2 refresh token in ChromeOS login) is still in | 355 // reconstruction from OAuth2 refresh token in ChromeOS login) is still in |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 737 url_request->GetTotalReceivedBytes())); | 723 url_request->GetTotalReceivedBytes())); |
| 738 } | 724 } |
| 739 } | 725 } |
| 740 | 726 |
| 741 // static | 727 // static |
| 742 void ChromeResourceDispatcherHostDelegate:: | 728 void ChromeResourceDispatcherHostDelegate:: |
| 743 SetExternalProtocolHandlerDelegateForTesting( | 729 SetExternalProtocolHandlerDelegateForTesting( |
| 744 ExternalProtocolHandler::Delegate* delegate) { | 730 ExternalProtocolHandler::Delegate* delegate) { |
| 745 g_external_protocol_handler_delegate = delegate; | 731 g_external_protocol_handler_delegate = delegate; |
| 746 } | 732 } |
| OLD | NEW |