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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 net::URLRequest* request, | 481 net::URLRequest* request, |
482 content::ResourceContext* resource_context, | 482 content::ResourceContext* resource_context, |
483 ResourceType::Type resource_type, | 483 ResourceType::Type resource_type, |
484 ScopedVector<content::ResourceThrottle>* throttles) { | 484 ScopedVector<content::ResourceThrottle>* throttles) { |
485 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 485 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
486 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 486 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) |
487 // Insert safe browsing at the front of the list, so it gets to decide on | 487 // Insert safe browsing at the front of the list, so it gets to decide on |
488 // policies first. | 488 // policies first. |
489 if (io_data->safe_browsing_enabled()->GetValue() | 489 if (io_data->safe_browsing_enabled()->GetValue() |
490 #if defined(OS_ANDROID) | 490 #if defined(OS_ANDROID) |
491 || io_data->data_reduction_proxy_enabled()->GetValue() | 491 || io_data->IsDataReductionProxyEnabled() |
492 #endif | 492 #endif |
493 ) { | 493 ) { |
494 bool is_subresource_request = resource_type != ResourceType::MAIN_FRAME; | 494 bool is_subresource_request = resource_type != ResourceType::MAIN_FRAME; |
495 content::ResourceThrottle* throttle = | 495 content::ResourceThrottle* throttle = |
496 SafeBrowsingResourceThrottleFactory::Create(request, | 496 SafeBrowsingResourceThrottleFactory::Create(request, |
497 resource_context, | 497 resource_context, |
498 is_subresource_request, | 498 is_subresource_request, |
499 safe_browsing_.get()); | 499 safe_browsing_.get()); |
500 if (throttle) | 500 if (throttle) |
501 throttles->push_back(throttle); | 501 throttles->push_back(throttle); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 url_request->GetTotalReceivedBytes())); | 731 url_request->GetTotalReceivedBytes())); |
732 } | 732 } |
733 } | 733 } |
734 | 734 |
735 // static | 735 // static |
736 void ChromeResourceDispatcherHostDelegate:: | 736 void ChromeResourceDispatcherHostDelegate:: |
737 SetExternalProtocolHandlerDelegateForTesting( | 737 SetExternalProtocolHandlerDelegateForTesting( |
738 ExternalProtocolHandler::Delegate* delegate) { | 738 ExternalProtocolHandler::Delegate* delegate) { |
739 g_external_protocol_handler_delegate = delegate; | 739 g_external_protocol_handler_delegate = delegate; |
740 } | 740 } |
OLD | NEW |