| 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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 return true; | 470 return true; |
| 471 #endif | 471 #endif |
| 472 } | 472 } |
| 473 | 473 |
| 474 void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles( | 474 void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles( |
| 475 net::URLRequest* request, | 475 net::URLRequest* request, |
| 476 content::ResourceContext* resource_context, | 476 content::ResourceContext* resource_context, |
| 477 ResourceType::Type resource_type, | 477 ResourceType::Type resource_type, |
| 478 ScopedVector<content::ResourceThrottle>* throttles) { | 478 ScopedVector<content::ResourceThrottle>* throttles) { |
| 479 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 479 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
| 480 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 480 #if defined(SAFE_BROWSING_SERVICE) |
| 481 // Insert safe browsing at the front of the list, so it gets to decide on | 481 // Insert safe browsing at the front of the list, so it gets to decide on |
| 482 // policies first. | 482 // policies first. |
| 483 if (io_data->safe_browsing_enabled()->GetValue() | 483 if (io_data->safe_browsing_enabled()->GetValue() |
| 484 #if defined(OS_ANDROID) | 484 #if defined(OS_ANDROID) |
| 485 || io_data->data_reduction_proxy_enabled()->GetValue() | 485 || io_data->data_reduction_proxy_enabled()->GetValue() |
| 486 #endif | 486 #endif |
| 487 ) { | 487 ) { |
| 488 bool is_subresource_request = resource_type != ResourceType::MAIN_FRAME; | 488 bool is_subresource_request = resource_type != ResourceType::MAIN_FRAME; |
| 489 content::ResourceThrottle* throttle = | 489 content::ResourceThrottle* throttle = |
| 490 SafeBrowsingResourceThrottleFactory::Create(request, | 490 SafeBrowsingResourceThrottleFactory::Create(request, |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 url_request->GetTotalReceivedBytes())); | 719 url_request->GetTotalReceivedBytes())); |
| 720 } | 720 } |
| 721 } | 721 } |
| 722 | 722 |
| 723 // static | 723 // static |
| 724 void ChromeResourceDispatcherHostDelegate:: | 724 void ChromeResourceDispatcherHostDelegate:: |
| 725 SetExternalProtocolHandlerDelegateForTesting( | 725 SetExternalProtocolHandlerDelegateForTesting( |
| 726 ExternalProtocolHandler::Delegate* delegate) { | 726 ExternalProtocolHandler::Delegate* delegate) { |
| 727 g_external_protocol_handler_delegate = delegate; | 727 g_external_protocol_handler_delegate = delegate; |
| 728 } | 728 } |
| OLD | NEW |