| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" | 31 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" |
| 32 #include "chrome/browser/renderer_host/thread_hop_resource_throttle.h" | 32 #include "chrome/browser/renderer_host/thread_hop_resource_throttle.h" |
| 33 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 33 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 34 #include "chrome/browser/signin/chrome_signin_helper.h" | 34 #include "chrome/browser/signin/chrome_signin_helper.h" |
| 35 #include "chrome/browser/tab_contents/tab_util.h" | 35 #include "chrome/browser/tab_contents/tab_util.h" |
| 36 #include "chrome/browser/ui/login/login_prompt.h" | 36 #include "chrome/browser/ui/login/login_prompt.h" |
| 37 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
| 38 #include "chrome/common/features.h" | 38 #include "chrome/common/features.h" |
| 39 #include "chrome/common/url_constants.h" | 39 #include "chrome/common/url_constants.h" |
| 40 #include "components/content_settings/core/browser/host_content_settings_map.h" | 40 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig.h" |
| 41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" | 42 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
| 42 #include "components/google/core/browser/google_util.h" | 43 #include "components/google/core/browser/google_util.h" |
| 43 #include "components/variations/net/variations_http_headers.h" | 44 #include "components/variations/net/variations_http_headers.h" |
| 44 #include "content/public/browser/browser_thread.h" | 45 #include "content/public/browser/browser_thread.h" |
| 45 #include "content/public/browser/notification_service.h" | 46 #include "content/public/browser/notification_service.h" |
| 46 #include "content/public/browser/plugin_service.h" | 47 #include "content/public/browser/plugin_service.h" |
| 47 #include "content/public/browser/plugin_service_filter.h" | 48 #include "content/public/browser/plugin_service_filter.h" |
| 48 #include "content/public/browser/render_process_host.h" | 49 #include "content/public/browser/render_process_host.h" |
| 49 #include "content/public/browser/render_view_host.h" | 50 #include "content/public/browser/render_view_host.h" |
| 50 #include "content/public/browser/resource_context.h" | 51 #include "content/public/browser/resource_context.h" |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 content::ResourceContext* resource_context) { | 724 content::ResourceContext* resource_context) { |
| 724 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | 725 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
| 725 data_reduction_proxy::DataReductionProxyIOData* data_reduction_proxy_io_data = | 726 data_reduction_proxy::DataReductionProxyIOData* data_reduction_proxy_io_data = |
| 726 io_data->data_reduction_proxy_io_data(); | 727 io_data->data_reduction_proxy_io_data(); |
| 727 | 728 |
| 728 if (data_reduction_proxy_io_data) | 729 if (data_reduction_proxy_io_data) |
| 729 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); | 730 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); |
| 730 return false; | 731 return false; |
| 731 } | 732 } |
| 732 | 733 |
| 734 bool ChromeResourceDispatcherHostDelegate::UsedDataReductionProxy( |
| 735 const net::HostPortPair& proxy_server, |
| 736 content::ResourceContext* resource_context) { |
| 737 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
| 738 data_reduction_proxy::DataReductionProxyIOData* data_reduction_proxy_io_data = |
| 739 io_data->data_reduction_proxy_io_data(); |
| 740 |
| 741 if (data_reduction_proxy_io_data && data_reduction_proxy_io_data->config()) |
| 742 return data_reduction_proxy_io_data->config()->IsDataReductionProxy( |
| 743 proxy_server, nullptr); |
| 744 return false; |
| 745 } |
| 746 |
| 733 // static | 747 // static |
| 734 void ChromeResourceDispatcherHostDelegate:: | 748 void ChromeResourceDispatcherHostDelegate:: |
| 735 SetExternalProtocolHandlerDelegateForTesting( | 749 SetExternalProtocolHandlerDelegateForTesting( |
| 736 ExternalProtocolHandler::Delegate* delegate) { | 750 ExternalProtocolHandler::Delegate* delegate) { |
| 737 g_external_protocol_handler_delegate = delegate; | 751 g_external_protocol_handler_delegate = delegate; |
| 738 } | 752 } |
| OLD | NEW |