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" | |
bengr
2014/12/29 18:45:41
Can you forward declare this instead?
megjablon
2014/12/30 23:39:59
Done.
| |
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" | |
bengr
2014/12/29 18:45:41
Is this needed?
megjablon
2014/12/30 23:39:59
No. Done.
| |
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; |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
516 content::ResourceThrottle* throttle = | 520 content::ResourceThrottle* throttle = |
517 SafeBrowsingResourceThrottleFactory::Create(request, | 521 SafeBrowsingResourceThrottleFactory::Create(request, |
518 resource_context, | 522 resource_context, |
519 resource_type, | 523 resource_type, |
520 safe_browsing_.get()); | 524 safe_browsing_.get()); |
521 if (throttle) | 525 if (throttle) |
522 throttles->push_back(throttle); | 526 throttles->push_back(throttle); |
523 } | 527 } |
524 #endif | 528 #endif |
525 | 529 |
530 #if defined(OS_ANDROID) | |
531 if (io_data->IsDataReductionProxyEnabled() && | |
532 data_reduction_proxy::DataReductionProxyParams:: | |
533 IsIncludedInBypassWarningTrial()) { | |
534 data_reduction_proxy::DataReductionProxyParams* params = | |
535 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) { | |
bengr
2014/12/29 18:45:41
Is it possible for params to be null here? If not,
megjablon
2014/12/30 23:39:59
Done.
| |
540 throttles->push_back( | |
541 new data_reduction_proxy::DataReductionProxyResourceThrottle( | |
542 request, resource_type, service, params)); | |
543 } | |
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 |