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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 DCHECK_EQ(request->priority(), net::MAXIMUM_PRIORITY); | 332 DCHECK_EQ(request->priority(), net::MAXIMUM_PRIORITY); |
333 } else { | 333 } else { |
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 if (resource_type != content::RESOURCE_TYPE_MAIN_FRAME) | 342 // TODO(davidben): This is insufficient to integrate with prerender properly. |
343 InterceptNavigationDelegate::UpdateUserGestureCarryoverInfo(request); | 343 // https://crbug.com/370595 |
| 344 if (!is_prerendering) { |
| 345 if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME) { |
| 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 } |
344 #endif | 361 #endif |
345 | 362 |
346 #if defined(OS_CHROMEOS) | 363 #if defined(OS_CHROMEOS) |
347 // Check if we need to add merge session throttle. This throttle will postpone | 364 // Check if we need to add merge session throttle. This throttle will postpone |
348 // loading of main frames and XHR request. | 365 // loading of main frames and XHR request. |
349 if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME || | 366 if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME || |
350 resource_type == content::RESOURCE_TYPE_XHR) { | 367 resource_type == content::RESOURCE_TYPE_XHR) { |
351 // Add interstitial page while merge session process (cookie | 368 // Add interstitial page while merge session process (cookie |
352 // reconstruction from OAuth2 refresh token in ChromeOS login) is still in | 369 // reconstruction from OAuth2 refresh token in ChromeOS login) is still in |
353 // progress while we are attempting to load a google property. | 370 // progress while we are attempting to load a google property. |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 url_request->GetTotalReceivedBytes())); | 737 url_request->GetTotalReceivedBytes())); |
721 } | 738 } |
722 } | 739 } |
723 | 740 |
724 // static | 741 // static |
725 void ChromeResourceDispatcherHostDelegate:: | 742 void ChromeResourceDispatcherHostDelegate:: |
726 SetExternalProtocolHandlerDelegateForTesting( | 743 SetExternalProtocolHandlerDelegateForTesting( |
727 ExternalProtocolHandler::Delegate* delegate) { | 744 ExternalProtocolHandler::Delegate* delegate) { |
728 g_external_protocol_handler_delegate = delegate; | 745 g_external_protocol_handler_delegate = delegate; |
729 } | 746 } |
OLD | NEW |