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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc

Issue 2848293002: Adding the Previews infobar to pages that show a client LoFi image (Closed)
Patch Set: sclittle comments Created 3 years, 8 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: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
index 6752c415e7861dbec641209707bdcbf868b57226..dcba55a78278e4d2969d01def100cdde46f86960 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
@@ -380,10 +380,17 @@ void DataReductionProxyNetworkDelegate::OnCompletedInternal(
net_error);
net::HttpRequestHeaders request_headers;
- if (data_reduction_proxy_io_data_ && request->response_headers() &&
- IsEmptyImagePreview(*(request->response_headers()))) {
+ bool server_lofi = data_reduction_proxy_io_data_ &&
+ request->response_headers() &&
+ IsEmptyImagePreview(*(request->response_headers()));
+ bool client_lofi =
+ !server_lofi && data_reduction_proxy_io_data_ &&
+ data_reduction_proxy_io_data_->lofi_decider() &&
+ data_reduction_proxy_io_data_->lofi_decider()->IsClientLoFiImageRequest(
+ *request);
+ if (server_lofi || client_lofi) {
data_reduction_proxy_io_data_->lofi_ui_service()->OnLoFiReponseReceived(
- *request);
+ *request, server_lofi /* is_server_lofi */);
sclittle 2017/05/03 22:51:30 nit: I don't think you need the /* is_server_lofi
RyanSturm 2017/05/03 23:20:30 Oops. Definitely agree. Done.
} else if (data_reduction_proxy_io_data_ && request->response_headers() &&
IsLitePagePreview(*(request->response_headers()))) {
RecordLitePageTransformationType(LITE_PAGE);

Powered by Google App Engine
This is Rietveld 408576698