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

Side by Side Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 1350913008: Revert of Add a NavigationThrottle to the public content/ interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-api
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | components/components_tests.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | components/components_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698