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

Unified 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: bengr comments and rebase 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 side-by-side diff with in-line comments
Download patch
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 e86ef16df29ccb62f0ca45d2a70498380d2a8df5..b7a15ca75c6bf01676f43b49337b6bd4f9223de4 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"
@@ -721,6 +722,18 @@ void ChromeResourceDispatcherHostDelegate::RequestComplete(
}
}
+bool ChromeResourceDispatcherHostDelegate::ShouldEnableLoFiMode(
+ const 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();
+
+ if (data_reduction_proxy_io_data)
+ return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request);
+ return false;
+}
+
// static
void ChromeResourceDispatcherHostDelegate::
SetExternalProtocolHandlerDelegateForTesting(
« no previous file with comments | « chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h ('k') | chrome/renderer/page_load_histograms.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698