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

Unified Diff: components/data_reduction_proxy/content/browser/content_lofi_decider.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/content/browser/content_lofi_decider.cc
diff --git a/components/data_reduction_proxy/content/browser/content_lofi_decider.cc b/components/data_reduction_proxy/content/browser/content_lofi_decider.cc
index f600474209e79d6a53f1f31e3462e89a25855216..d24fab4bb500569f6837daf9d9ce16846a5bb0e9 100644
--- a/components/data_reduction_proxy/content/browser/content_lofi_decider.cc
+++ b/components/data_reduction_proxy/content/browser/content_lofi_decider.cc
@@ -212,4 +212,13 @@ bool ContentLoFiDecider::ShouldRecordLoFiUMA(
params::IsIncludedInLoFiControlFieldTrial();
}
+bool ContentLoFiDecider::IsClientLoFiImageRequest(
+ const net::URLRequest& request) const {
+ const content::ResourceRequestInfo* request_info =
+ content::ResourceRequestInfo::ForRequest(&request);
+ return request_info &&
+ request_info->GetResourceType() == content::RESOURCE_TYPE_IMAGE &&
+ (request_info->GetPreviewsState() & content::CLIENT_LOFI_ON);
+}
+
} // namespace data_reduction_proxy

Powered by Google App Engine
This is Rietveld 408576698