Chromium Code Reviews| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 #endif | 82 #endif |
| 83 | 83 |
| 84 #if defined(USE_SYSTEM_PROTOBUF) | 84 #if defined(USE_SYSTEM_PROTOBUF) |
| 85 #include <google/protobuf/repeated_field.h> | 85 #include <google/protobuf/repeated_field.h> |
| 86 #else | 86 #else |
| 87 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" | 87 #include "third_party/protobuf/src/google/protobuf/repeated_field.h" |
| 88 #endif | 88 #endif |
| 89 | 89 |
| 90 #if defined(OS_ANDROID) | 90 #if defined(OS_ANDROID) |
| 91 #include "chrome/browser/android/intercept_download_resource_throttle.h" | 91 #include "chrome/browser/android/intercept_download_resource_throttle.h" |
| 92 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_r esource_throttle.h" | |
| 93 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_u i_service.h" | |
| 94 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" | |
| 95 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc hes.h" | |
| 92 #include "components/navigation_interception/intercept_navigation_delegate.h" | 96 #include "components/navigation_interception/intercept_navigation_delegate.h" |
| 93 #endif | 97 #endif |
| 94 | 98 |
| 95 #if defined(OS_CHROMEOS) | 99 #if defined(OS_CHROMEOS) |
| 96 #include "chrome/browser/chromeos/login/signin/merge_session_throttle.h" | 100 #include "chrome/browser/chromeos/login/signin/merge_session_throttle.h" |
| 97 // TODO(oshima): Enable this for other platforms. | 101 // TODO(oshima): Enable this for other platforms. |
| 98 #include "chrome/browser/renderer_host/offline_resource_throttle.h" | 102 #include "chrome/browser/renderer_host/offline_resource_throttle.h" |
| 99 #endif | 103 #endif |
| 100 | 104 |
| 101 using content::BrowserThread; | 105 using content::BrowserThread; |
| 102 using content::RenderViewHost; | 106 using content::RenderViewHost; |
| 103 using content::ResourceDispatcherHostLoginDelegate; | 107 using content::ResourceDispatcherHostLoginDelegate; |
| 104 using content::ResourceRequestInfo; | 108 using content::ResourceRequestInfo; |
| 105 using content::ResourceType; | 109 using content::ResourceType; |
| 106 | 110 |
| 107 #if defined(ENABLE_EXTENSIONS) | 111 #if defined(ENABLE_EXTENSIONS) |
| 108 using extensions::Extension; | 112 using extensions::Extension; |
| 109 using extensions::StreamsPrivateAPI; | 113 using extensions::StreamsPrivateAPI; |
| 110 #endif | 114 #endif |
| 111 | 115 |
| 112 #if defined(OS_ANDROID) | 116 #if defined(OS_ANDROID) |
|
bengr
2014/12/17 00:30:19
Remove #if defined.
Remove usings. Better to spel
megjablon
2014/12/23 02:18:03
Done.
| |
| 117 using data_reduction_proxy::DataReductionProxyParams; | |
| 118 using data_reduction_proxy::DataReductionProxyResourceThrottle; | |
| 113 using navigation_interception::InterceptNavigationDelegate; | 119 using navigation_interception::InterceptNavigationDelegate; |
| 114 #endif | 120 #endif |
| 115 | 121 |
| 116 namespace { | 122 namespace { |
| 117 | 123 |
| 118 ExternalProtocolHandler::Delegate* g_external_protocol_handler_delegate = NULL; | 124 ExternalProtocolHandler::Delegate* g_external_protocol_handler_delegate = NULL; |
| 119 | 125 |
| 120 void NotifyDownloadInitiatedOnUI(int render_process_id, int render_view_id) { | 126 void NotifyDownloadInitiatedOnUI(int render_process_id, int render_view_id) { |
| 121 RenderViewHost* rvh = RenderViewHost::FromID(render_process_id, | 127 RenderViewHost* rvh = RenderViewHost::FromID(render_process_id, |
| 122 render_view_id); | 128 render_view_id); |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 516 content::ResourceThrottle* throttle = | 522 content::ResourceThrottle* throttle = |
| 517 SafeBrowsingResourceThrottleFactory::Create(request, | 523 SafeBrowsingResourceThrottleFactory::Create(request, |
| 518 resource_context, | 524 resource_context, |
| 519 resource_type, | 525 resource_type, |
| 520 safe_browsing_.get()); | 526 safe_browsing_.get()); |
| 521 if (throttle) | 527 if (throttle) |
| 522 throttles->push_back(throttle); | 528 throttles->push_back(throttle); |
| 523 } | 529 } |
| 524 #endif | 530 #endif |
| 525 | 531 |
| 532 #if defined(OS_ANDROID) | |
|
bengr
2014/12/17 00:30:19
Remove #if defined.
megjablon
2014/12/23 02:18:04
We decided not to have a base class as discussed o
| |
| 533 if (io_data->IsDataReductionProxyEnabled() && | |
| 534 DataReductionProxyParams::IsIncludedInBypassWarningTrial()) { | |
| 535 DataReductionProxyParams* params = io_data->data_reduction_proxy_params(); | |
| 536 data_reduction_proxy::DataReductionProxyUIService* service = | |
| 537 io_data->data_reduction_proxy_ui_service(); | |
| 538 | |
| 539 if (params && service) { | |
| 540 throttles->push_back(new DataReductionProxyResourceThrottle( | |
| 541 request, resource_type, service, params)); | |
| 542 } | |
| 543 | |
|
bengr
2014/12/17 00:30:19
Remove blank line.
megjablon
2014/12/23 02:18:04
Done.
| |
| 544 } | |
| 545 #endif | |
| 546 | |
| 526 #if defined(ENABLE_SUPERVISED_USERS) | 547 #if defined(ENABLE_SUPERVISED_USERS) |
| 527 bool is_subresource_request = | 548 bool is_subresource_request = |
| 528 resource_type != content::RESOURCE_TYPE_MAIN_FRAME; | 549 resource_type != content::RESOURCE_TYPE_MAIN_FRAME; |
| 529 throttles->push_back(new SupervisedUserResourceThrottle( | 550 throttles->push_back(new SupervisedUserResourceThrottle( |
| 530 request, !is_subresource_request, | 551 request, !is_subresource_request, |
| 531 io_data->supervised_user_url_filter())); | 552 io_data->supervised_user_url_filter())); |
| 532 #endif | 553 #endif |
| 533 | 554 |
| 534 #if defined(ENABLE_EXTENSIONS) | 555 #if defined(ENABLE_EXTENSIONS) |
| 535 content::ResourceThrottle* throttle = | 556 content::ResourceThrottle* throttle = |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 756 url_request->GetTotalReceivedBytes())); | 777 url_request->GetTotalReceivedBytes())); |
| 757 } | 778 } |
| 758 } | 779 } |
| 759 | 780 |
| 760 // static | 781 // static |
| 761 void ChromeResourceDispatcherHostDelegate:: | 782 void ChromeResourceDispatcherHostDelegate:: |
| 762 SetExternalProtocolHandlerDelegateForTesting( | 783 SetExternalProtocolHandlerDelegateForTesting( |
| 763 ExternalProtocolHandler::Delegate* delegate) { | 784 ExternalProtocolHandler::Delegate* delegate) { |
| 764 g_external_protocol_handler_delegate = delegate; | 785 g_external_protocol_handler_delegate = delegate; |
| 765 } | 786 } |
| OLD | NEW |