Chromium Code Reviews| Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc |
| diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc |
| index aa4705e9c628f7ffdb6ba3162844bff8c2f5fb87..7e6279958ddca97f9b7832a917adc43406e3442a 100644 |
| --- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc |
| +++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc |
| @@ -34,6 +34,7 @@ |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/common/url_constants.h" |
| #include "components/content_settings/core/browser/host_content_settings_map.h" |
| +#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h" |
| #include "components/google/core/browser/google_util.h" |
| #include "components/variations/net/variations_http_header_provider.h" |
| #include "content/public/browser/browser_thread.h" |
| @@ -738,6 +739,20 @@ void ChromeResourceDispatcherHostDelegate::RequestComplete( |
| } |
| } |
| +bool ChromeResourceDispatcherHostDelegate::ShouldEnableLoFiMode( |
| + net::URLRequest* url_request, |
| + content::ResourceContext* resource_context) { |
| + ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
| + data_reduction_proxy::DataReductionProxyIOData* data_reduction_proxy_io_data = |
| + io_data->data_reduction_proxy_io_data(); |
|
mmenke
2015/09/29 16:35:57
Why does this need to go through a new DRP class?
megjablon
2015/09/29 21:20:07
This isn't a new class. This is just adding a meth
|
| + |
| + if (url_request && data_reduction_proxy_io_data) { |
|
mmenke
2015/09/29 16:35:57
url_request can't be NULL, so shouldn't check for
megjablon
2015/09/29 21:20:07
Done.
|
| + return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); |
| + } |
|
mmenke
2015/09/29 16:35:57
nit: Remove braces.
megjablon
2015/09/29 21:20:06
Done.
|
| + |
| + return false; |
| +} |
| + |
| // static |
| void ChromeResourceDispatcherHostDelegate:: |
| SetExternalProtocolHandlerDelegateForTesting( |