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 16 matching lines...) Expand all Loading... | |
27 #include "chrome/browser/profiles/profile_io_data.h" | 27 #include "chrome/browser/profiles/profile_io_data.h" |
28 #include "chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_an droid.h" | 28 #include "chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_an droid.h" |
29 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" | 29 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" |
30 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 30 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
31 #include "chrome/browser/signin/chrome_signin_helper.h" | 31 #include "chrome/browser/signin/chrome_signin_helper.h" |
32 #include "chrome/browser/tab_contents/tab_util.h" | 32 #include "chrome/browser/tab_contents/tab_util.h" |
33 #include "chrome/browser/ui/login/login_prompt.h" | 33 #include "chrome/browser/ui/login/login_prompt.h" |
34 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
35 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
36 #include "components/content_settings/core/browser/host_content_settings_map.h" | 36 #include "components/content_settings/core/browser/host_content_settings_map.h" |
37 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h" | |
37 #include "components/google/core/browser/google_util.h" | 38 #include "components/google/core/browser/google_util.h" |
38 #include "components/variations/net/variations_http_header_provider.h" | 39 #include "components/variations/net/variations_http_header_provider.h" |
39 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
40 #include "content/public/browser/notification_service.h" | 41 #include "content/public/browser/notification_service.h" |
41 #include "content/public/browser/plugin_service.h" | 42 #include "content/public/browser/plugin_service.h" |
42 #include "content/public/browser/plugin_service_filter.h" | 43 #include "content/public/browser/plugin_service_filter.h" |
43 #include "content/public/browser/render_process_host.h" | 44 #include "content/public/browser/render_process_host.h" |
44 #include "content/public/browser/render_view_host.h" | 45 #include "content/public/browser/render_view_host.h" |
45 #include "content/public/browser/resource_context.h" | 46 #include "content/public/browser/resource_context.h" |
46 #include "content/public/browser/resource_dispatcher_host.h" | 47 #include "content/public/browser/resource_dispatcher_host.h" |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
731 if (url_request && !url_request->was_cached()) { | 732 if (url_request && !url_request->was_cached()) { |
732 BrowserThread::PostTask(BrowserThread::UI, | 733 BrowserThread::PostTask(BrowserThread::UI, |
733 FROM_HERE, | 734 FROM_HERE, |
734 base::Bind(&UpdatePrerenderNetworkBytesCallback, | 735 base::Bind(&UpdatePrerenderNetworkBytesCallback, |
735 info->GetChildID(), | 736 info->GetChildID(), |
736 info->GetRouteID(), | 737 info->GetRouteID(), |
737 url_request->GetTotalReceivedBytes())); | 738 url_request->GetTotalReceivedBytes())); |
738 } | 739 } |
739 } | 740 } |
740 | 741 |
742 bool ChromeResourceDispatcherHostDelegate::ShouldEnableLoFiMode( | |
743 net::URLRequest* url_request, | |
744 content::ResourceContext* resource_context) { | |
745 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); | |
746 data_reduction_proxy::DataReductionProxyIOData* data_reduction_proxy_io_data = | |
747 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
| |
748 | |
749 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.
| |
750 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request); | |
751 } | |
mmenke
2015/09/29 16:35:57
nit: Remove braces.
megjablon
2015/09/29 21:20:06
Done.
| |
752 | |
753 return false; | |
754 } | |
755 | |
741 // static | 756 // static |
742 void ChromeResourceDispatcherHostDelegate:: | 757 void ChromeResourceDispatcherHostDelegate:: |
743 SetExternalProtocolHandlerDelegateForTesting( | 758 SetExternalProtocolHandlerDelegateForTesting( |
744 ExternalProtocolHandler::Delegate* delegate) { | 759 ExternalProtocolHandler::Delegate* delegate) { |
745 g_external_protocol_handler_delegate = delegate; | 760 g_external_protocol_handler_delegate = delegate; |
746 } | 761 } |
OLD | NEW |