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

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

Issue 2642793005: Create a Lite Page bit for previews and fallback to Lo-Fi (Closed)
Patch Set: remove unused frame_messages.h code Created 3 years, 10 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
« no previous file with comments | « no previous file | components/data_reduction_proxy/content/browser/content_lofi_decider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 32a26c597bd0daf7ca4d9d52c11e6e9c9085a7fb..893828fc193c2b52f6216f75797e34c6eea70248 100644
--- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
@@ -867,12 +867,18 @@ content::PreviewsState ChromeResourceDispatcherHostDelegate::GetPreviewsState(
data_reduction_proxy::DataReductionProxyIOData* data_reduction_proxy_io_data =
io_data->data_reduction_proxy_io_data();
+ content::PreviewsState previews_state = content::PREVIEWS_UNSPECIFIED;
+
if (data_reduction_proxy_io_data) {
- return data_reduction_proxy_io_data->ShouldEnableLoFiMode(url_request)
- ? content::SERVER_LOFI_ON
- : content::PREVIEWS_OFF;
+ if (data_reduction_proxy_io_data->ShouldEnableLoFi(url_request))
+ previews_state |= content::SERVER_LOFI_ON;
+ if (data_reduction_proxy_io_data->ShouldEnableLitePages(url_request))
+ previews_state |= content::SERVER_LITE_PAGE_ON;
}
- return content::PREVIEWS_OFF;
+
+ if (previews_state == content::PREVIEWS_UNSPECIFIED)
+ return content::PREVIEWS_OFF;
+ return previews_state;
}
// static
« no previous file with comments | « no previous file | components/data_reduction_proxy/content/browser/content_lofi_decider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698