OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/core/common/data_reduction_proxy_heade
rs.h" | 5 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 25 matching lines...) Expand all Loading... |
36 "chrome-proxy-accept-transform"; | 36 "chrome-proxy-accept-transform"; |
37 const char kChromeProxyContentTransformHeader[] = | 37 const char kChromeProxyContentTransformHeader[] = |
38 "chrome-proxy-content-transform"; | 38 "chrome-proxy-content-transform"; |
39 | 39 |
40 const char kActionValueDelimiter = '='; | 40 const char kActionValueDelimiter = '='; |
41 | 41 |
42 // Previews directives. | 42 // Previews directives. |
43 const char kEmptyImageDirective[] = "empty-image"; | 43 const char kEmptyImageDirective[] = "empty-image"; |
44 const char kLitePageDirective[] = "lite-page"; | 44 const char kLitePageDirective[] = "lite-page"; |
45 const char kCompressedVideoDirective[] = "compressed-video"; | 45 const char kCompressedVideoDirective[] = "compressed-video"; |
| 46 const char kChromeProxyPagePoliciesDirective[] = "page-policies"; |
46 | 47 |
47 // The legacy Chrome-Proxy response header directive for LoFi images. | 48 // The legacy Chrome-Proxy response header directive for LoFi images. |
48 const char kLegacyChromeProxyLoFiResponseDirective[] = "q=low"; | 49 const char kLegacyChromeProxyLoFiResponseDirective[] = "q=low"; |
49 | 50 |
50 const char kChromeProxyExperimentForceLitePage[] = "force_lite_page"; | 51 const char kChromeProxyExperimentForceLitePage[] = "force_lite_page"; |
51 const char kChromeProxyExperimentForceEmptyImage[] = | 52 const char kChromeProxyExperimentForceEmptyImage[] = |
52 "force_page_policies_empty_image"; | 53 "force_page_policies_empty_image"; |
53 | 54 |
54 const char kIfHeavyQualifier[] = "if-heavy"; | 55 const char kIfHeavyQualifier[] = "if-heavy"; |
55 | 56 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 } | 151 } |
151 | 152 |
152 const char* lite_page_directive() { | 153 const char* lite_page_directive() { |
153 return kLitePageDirective; | 154 return kLitePageDirective; |
154 } | 155 } |
155 | 156 |
156 const char* compressed_video_directive() { | 157 const char* compressed_video_directive() { |
157 return kCompressedVideoDirective; | 158 return kCompressedVideoDirective; |
158 } | 159 } |
159 | 160 |
| 161 const char* page_policies_directive() { |
| 162 return kChromeProxyPagePoliciesDirective; |
| 163 } |
| 164 |
160 const char* chrome_proxy_experiment_force_lite_page() { | 165 const char* chrome_proxy_experiment_force_lite_page() { |
161 return kChromeProxyExperimentForceLitePage; | 166 return kChromeProxyExperimentForceLitePage; |
162 } | 167 } |
163 | 168 |
164 const char* chrome_proxy_experiment_force_empty_image() { | 169 const char* chrome_proxy_experiment_force_empty_image() { |
165 return kChromeProxyExperimentForceEmptyImage; | 170 return kChromeProxyExperimentForceEmptyImage; |
166 } | 171 } |
167 | 172 |
168 const char* if_heavy_qualifier() { | 173 const char* if_heavy_qualifier() { |
169 return kIfHeavyQualifier; | 174 return kIfHeavyQualifier; |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 std::string value; | 440 std::string value; |
436 size_t iter = 0; | 441 size_t iter = 0; |
437 while (headers->EnumerateHeader(&iter, kChromeProxyHeader, &value)) { | 442 while (headers->EnumerateHeader(&iter, kChromeProxyHeader, &value)) { |
438 if (StartsWithActionPrefix(value, kChromeProxyActionFingerprintChromeProxy)) | 443 if (StartsWithActionPrefix(value, kChromeProxyActionFingerprintChromeProxy)) |
439 continue; | 444 continue; |
440 values->push_back(std::move(value)); | 445 values->push_back(std::move(value)); |
441 } | 446 } |
442 } | 447 } |
443 | 448 |
444 } // namespace data_reduction_proxy | 449 } // namespace data_reduction_proxy |
OLD | NEW |