| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/data_reduction_proxy/content/browser/content_lofi_decider.h
" | 5 #include "components/data_reduction_proxy/content/browser/content_lofi_decider.h
" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 if (!request_info || | 205 if (!request_info || |
| 206 !(request_info->GetPreviewsState() & content::SERVER_LOFI_ON || | 206 !(request_info->GetPreviewsState() & content::SERVER_LOFI_ON || |
| 207 request_info->GetPreviewsState() & content::SERVER_LITE_PAGE_ON)) { | 207 request_info->GetPreviewsState() & content::SERVER_LITE_PAGE_ON)) { |
| 208 return false; | 208 return false; |
| 209 } | 209 } |
| 210 | 210 |
| 211 return params::IsIncludedInLoFiEnabledFieldTrial() || | 211 return params::IsIncludedInLoFiEnabledFieldTrial() || |
| 212 params::IsIncludedInLoFiControlFieldTrial(); | 212 params::IsIncludedInLoFiControlFieldTrial(); |
| 213 } | 213 } |
| 214 | 214 |
| 215 bool ContentLoFiDecider::IsClientLoFiImageRequest( |
| 216 const net::URLRequest& request) const { |
| 217 const content::ResourceRequestInfo* request_info = |
| 218 content::ResourceRequestInfo::ForRequest(&request); |
| 219 return request_info && |
| 220 request_info->GetResourceType() == content::RESOURCE_TYPE_IMAGE && |
| 221 (request_info->GetPreviewsState() & content::CLIENT_LOFI_ON); |
| 222 } |
| 223 |
| 215 } // namespace data_reduction_proxy | 224 } // namespace data_reduction_proxy |
| OLD | NEW |