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

Unified Diff: chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc

Issue 2484633004: Change Lo-Fi bool to bitmask to support multiple Previews types (Closed)
Patch Set: rebase Created 4 years 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/loader/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
index a144df7c4cdae464df51155daecf41bc870484f4..8292b9a9c742d96264cce8fcd0c02956efca9f97 100644
--- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
@@ -832,16 +832,19 @@ void ChromeResourceDispatcherHostDelegate::RequestComplete(
base::TimeTicks::Now() - url_request->creation_time()));
}
-bool ChromeResourceDispatcherHostDelegate::ShouldEnableLoFiMode(
+content::PreviewsState ChromeResourceDispatcherHostDelegate::GetPreviewsState(
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;
+ if (data_reduction_proxy_io_data) {
+ return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request)
+ ? content::SERVER_LOFI_ON
+ : content::PREVIEWS_OFF;
+ }
+ return content::PREVIEWS_OFF;
}
// static

Powered by Google App Engine
This is Rietveld 408576698