| 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 0f8a31b584d86bd7990de5e7977ffe6e44236d9b..fbef8c0757547da51fb1baa1e4e25d4d1cd514da 100644
|
| --- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
|
| +++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
|
| @@ -31,20 +31,21 @@
|
| #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h"
|
| #include "chrome/browser/renderer_host/thread_hop_resource_throttle.h"
|
| #include "chrome/browser/safe_browsing/safe_browsing_service.h"
|
| #include "chrome/browser/signin/chrome_signin_helper.h"
|
| #include "chrome/browser/tab_contents/tab_util.h"
|
| #include "chrome/browser/ui/login/login_prompt.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/features.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_config.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_headers.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/notification_service.h"
|
| #include "content/public/browser/plugin_service.h"
|
| #include "content/public/browser/plugin_service_filter.h"
|
| #include "content/public/browser/render_process_host.h"
|
| #include "content/public/browser/render_view_host.h"
|
| #include "content/public/browser/resource_context.h"
|
| @@ -723,16 +724,29 @@ bool ChromeResourceDispatcherHostDelegate::ShouldEnableLoFiMode(
|
| 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();
|
|
|
| if (data_reduction_proxy_io_data)
|
| return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request);
|
| return false;
|
| }
|
|
|
| +bool ChromeResourceDispatcherHostDelegate::UsedDataReductionProxy(
|
| + const net::HostPortPair& proxy_server,
|
| + 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();
|
| +
|
| + if (data_reduction_proxy_io_data && data_reduction_proxy_io_data->config())
|
| + return data_reduction_proxy_io_data->config()->IsDataReductionProxy(
|
| + proxy_server, nullptr);
|
| + return false;
|
| +}
|
| +
|
| // static
|
| void ChromeResourceDispatcherHostDelegate::
|
| SetExternalProtocolHandlerDelegateForTesting(
|
| ExternalProtocolHandler::Delegate* delegate) {
|
| g_external_protocol_handler_delegate = delegate;
|
| }
|
|
|