Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 1310743003: Consistently use LoFi for an entire page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 if (url_request && !url_request->was_cached()) { 715 if (url_request && !url_request->was_cached()) {
715 BrowserThread::PostTask(BrowserThread::UI, 716 BrowserThread::PostTask(BrowserThread::UI,
716 FROM_HERE, 717 FROM_HERE,
717 base::Bind(&UpdatePrerenderNetworkBytesCallback, 718 base::Bind(&UpdatePrerenderNetworkBytesCallback,
718 info->GetChildID(), 719 info->GetChildID(),
719 info->GetRouteID(), 720 info->GetRouteID(),
720 url_request->GetTotalReceivedBytes())); 721 url_request->GetTotalReceivedBytes()));
721 } 722 }
722 } 723 }
723 724
725 bool ChromeResourceDispatcherHostDelegate::ShouldEnableLoFiMode(
726 net::URLRequest* url_request,
727 content::ResourceContext* resource_context) {
728 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
729 data_reduction_proxy::DataReductionProxyIOData* data_reduction_proxy_io_data =
730 io_data->data_reduction_proxy_io_data();
731
732 if (data_reduction_proxy_io_data)
733 return data_reduction_proxy_io_data->ShouldEnableLoFiMode(*url_request);
734 return false;
735 }
736
724 // static 737 // static
725 void ChromeResourceDispatcherHostDelegate:: 738 void ChromeResourceDispatcherHostDelegate::
726 SetExternalProtocolHandlerDelegateForTesting( 739 SetExternalProtocolHandlerDelegateForTesting(
727 ExternalProtocolHandler::Delegate* delegate) { 740 ExternalProtocolHandler::Delegate* delegate) {
728 g_external_protocol_handler_delegate = delegate; 741 g_external_protocol_handler_delegate = delegate;
729 } 742 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698