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

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 nit Created 3 years, 7 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..9727090d5115ad2b6a9300d20e5ee3b9450ccffb 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,8 +380,15 @@ 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 =
+ 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);
} else if (data_reduction_proxy_io_data_ && request->response_headers() &&

Powered by Google App Engine
This is Rietveld 408576698