| 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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 ScopedVector<content::ResourceThrottle>* throttles) { | 492 ScopedVector<content::ResourceThrottle>* throttles) { |
| 493 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 493 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
| 494 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 494 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) |
| 495 // Insert safe browsing at the front of the list, so it gets to decide on | 495 // Insert safe browsing at the front of the list, so it gets to decide on |
| 496 // policies first. | 496 // policies first. |
| 497 if (io_data->safe_browsing_enabled()->GetValue() | 497 if (io_data->safe_browsing_enabled()->GetValue() |
| 498 #if defined(OS_ANDROID) | 498 #if defined(OS_ANDROID) |
| 499 || io_data->IsDataReductionProxyEnabled() | 499 || io_data->IsDataReductionProxyEnabled() |
| 500 #endif | 500 #endif |
| 501 ) { | 501 ) { |
| 502 bool is_subresource_request = | |
| 503 resource_type != content::RESOURCE_TYPE_MAIN_FRAME; | |
| 504 content::ResourceThrottle* throttle = | 502 content::ResourceThrottle* throttle = |
| 505 SafeBrowsingResourceThrottleFactory::Create(request, | 503 SafeBrowsingResourceThrottleFactory::Create(request, |
| 506 resource_context, | 504 resource_context, |
| 507 is_subresource_request, | 505 resource_type, |
| 508 safe_browsing_.get()); | 506 safe_browsing_.get()); |
| 509 if (throttle) | 507 if (throttle) |
| 510 throttles->push_back(throttle); | 508 throttles->push_back(throttle); |
| 511 } | 509 } |
| 512 #endif | 510 #endif |
| 513 | 511 |
| 514 #if defined(ENABLE_MANAGED_USERS) | 512 #if defined(ENABLE_MANAGED_USERS) |
| 515 bool is_subresource_request = | 513 bool is_subresource_request = |
| 516 resource_type != content::RESOURCE_TYPE_MAIN_FRAME; | 514 resource_type != content::RESOURCE_TYPE_MAIN_FRAME; |
| 517 throttles->push_back(new SupervisedUserResourceThrottle( | 515 throttles->push_back(new SupervisedUserResourceThrottle( |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 url_request->GetTotalReceivedBytes())); | 749 url_request->GetTotalReceivedBytes())); |
| 752 } | 750 } |
| 753 } | 751 } |
| 754 | 752 |
| 755 // static | 753 // static |
| 756 void ChromeResourceDispatcherHostDelegate:: | 754 void ChromeResourceDispatcherHostDelegate:: |
| 757 SetExternalProtocolHandlerDelegateForTesting( | 755 SetExternalProtocolHandlerDelegateForTesting( |
| 758 ExternalProtocolHandler::Delegate* delegate) { | 756 ExternalProtocolHandler::Delegate* delegate) { |
| 759 g_external_protocol_handler_delegate = delegate; | 757 g_external_protocol_handler_delegate = delegate; |
| 760 } | 758 } |
| OLD | NEW |