| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/about_flags.h" | 5 #include "chrome/browser/about_flags.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 2165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2176 flags_storage->SetFlags(new_enabled_experiments); | 2176 flags_storage->SetFlags(new_enabled_experiments); |
| 2177 } | 2177 } |
| 2178 | 2178 |
| 2179 void GetSanitizedEnabledFlags( | 2179 void GetSanitizedEnabledFlags( |
| 2180 FlagsStorage* flags_storage, std::set<std::string>* result) { | 2180 FlagsStorage* flags_storage, std::set<std::string>* result) { |
| 2181 SanitizeList(flags_storage); | 2181 SanitizeList(flags_storage); |
| 2182 *result = flags_storage->GetFlags(); | 2182 *result = flags_storage->GetFlags(); |
| 2183 } | 2183 } |
| 2184 | 2184 |
| 2185 bool SkipConditionalExperiment(const Experiment& experiment) { | 2185 bool SkipConditionalExperiment(const Experiment& experiment) { |
| 2186 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 2186 version_info::Channel channel = chrome::VersionInfo::GetChannel(); |
| 2187 | 2187 |
| 2188 #if defined(OS_ANDROID) | 2188 #if defined(OS_ANDROID) |
| 2189 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel. | 2189 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel. |
| 2190 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && | 2190 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && |
| 2191 channel != chrome::VersionInfo::CHANNEL_BETA && | 2191 channel != version_info::CHANNEL_BETA && |
| 2192 channel != chrome::VersionInfo::CHANNEL_DEV) { | 2192 channel != version_info::CHANNEL_DEV) { |
| 2193 return true; | 2193 return true; |
| 2194 } | 2194 } |
| 2195 // enable-data-reduction-proxy-alt is only available for the Dev channel. | 2195 // enable-data-reduction-proxy-alt is only available for the Dev channel. |
| 2196 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && | 2196 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && |
| 2197 channel != chrome::VersionInfo::CHANNEL_DEV) { | 2197 channel != version_info::CHANNEL_DEV) { |
| 2198 return true; | 2198 return true; |
| 2199 } | 2199 } |
| 2200 // enable-data-reduction-proxy-carrier-test is only available for Chromium | 2200 // enable-data-reduction-proxy-carrier-test is only available for Chromium |
| 2201 // builds and the Canary/Dev channel. | 2201 // builds and the Canary/Dev channel. |
| 2202 if (!strcmp("enable-data-reduction-proxy-carrier-test", | 2202 if (!strcmp("enable-data-reduction-proxy-carrier-test", |
| 2203 experiment.internal_name) && | 2203 experiment.internal_name) && |
| 2204 channel != chrome::VersionInfo::CHANNEL_DEV && | 2204 channel != version_info::CHANNEL_DEV && |
| 2205 channel != chrome::VersionInfo::CHANNEL_CANARY && | 2205 channel != version_info::CHANNEL_CANARY && |
| 2206 channel != chrome::VersionInfo::CHANNEL_UNKNOWN) { | 2206 channel != version_info::CHANNEL_UNKNOWN) { |
| 2207 return true; | 2207 return true; |
| 2208 } | 2208 } |
| 2209 #endif | 2209 #endif |
| 2210 | 2210 |
| 2211 // data-reduction-proxy-lo-fi is only available for Chromium builds and | 2211 // data-reduction-proxy-lo-fi is only available for Chromium builds and |
| 2212 // the Canary/Dev/Beta channels. | 2212 // the Canary/Dev/Beta channels. |
| 2213 if (!strcmp("data-reduction-proxy-lo-fi", experiment.internal_name) && | 2213 if (!strcmp("data-reduction-proxy-lo-fi", experiment.internal_name) && |
| 2214 channel != chrome::VersionInfo::CHANNEL_BETA && | 2214 channel != version_info::CHANNEL_BETA && |
| 2215 channel != chrome::VersionInfo::CHANNEL_DEV && | 2215 channel != version_info::CHANNEL_DEV && |
| 2216 channel != chrome::VersionInfo::CHANNEL_CANARY && | 2216 channel != version_info::CHANNEL_CANARY && |
| 2217 channel != chrome::VersionInfo::CHANNEL_UNKNOWN) { | 2217 channel != version_info::CHANNEL_UNKNOWN) { |
| 2218 return true; | 2218 return true; |
| 2219 } | 2219 } |
| 2220 | 2220 |
| 2221 // enable-data-reduction-proxy-config-client is only available for Chromium | 2221 // enable-data-reduction-proxy-config-client is only available for Chromium |
| 2222 // builds and the Canary/Dev channels. | 2222 // builds and the Canary/Dev channels. |
| 2223 if (!strcmp("enable-data-reduction-proxy-config-client", | 2223 if (!strcmp("enable-data-reduction-proxy-config-client", |
| 2224 experiment.internal_name) && | 2224 experiment.internal_name) && |
| 2225 channel != chrome::VersionInfo::CHANNEL_DEV && | 2225 channel != version_info::CHANNEL_DEV && |
| 2226 channel != chrome::VersionInfo::CHANNEL_CANARY && | 2226 channel != version_info::CHANNEL_CANARY && |
| 2227 channel != chrome::VersionInfo::CHANNEL_UNKNOWN) { | 2227 channel != version_info::CHANNEL_UNKNOWN) { |
| 2228 return true; | 2228 return true; |
| 2229 } | 2229 } |
| 2230 | 2230 |
| 2231 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING) | 2231 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING) |
| 2232 // enable-data-reduction-proxy-bypass-warning is only available for Chromium | 2232 // enable-data-reduction-proxy-bypass-warning is only available for Chromium |
| 2233 // builds and Canary/Dev channel. | 2233 // builds and Canary/Dev channel. |
| 2234 if (!strcmp("enable-data-reduction-proxy-bypass-warnings", | 2234 if (!strcmp("enable-data-reduction-proxy-bypass-warnings", |
| 2235 experiment.internal_name) && | 2235 experiment.internal_name) && |
| 2236 channel != chrome::VersionInfo::CHANNEL_UNKNOWN && | 2236 channel != version_info::CHANNEL_UNKNOWN && |
| 2237 channel != chrome::VersionInfo::CHANNEL_CANARY && | 2237 channel != version_info::CHANNEL_CANARY && |
| 2238 channel != chrome::VersionInfo::CHANNEL_DEV) { | 2238 channel != version_info::CHANNEL_DEV) { |
| 2239 return true; | 2239 return true; |
| 2240 } | 2240 } |
| 2241 #endif | 2241 #endif |
| 2242 | 2242 |
| 2243 return false; | 2243 return false; |
| 2244 } | 2244 } |
| 2245 | 2245 |
| 2246 | 2246 |
| 2247 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't | 2247 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't |
| 2248 // enabled on the current platform. | 2248 // enabled on the current platform. |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2712 } | 2712 } |
| 2713 | 2713 |
| 2714 const Experiment* GetExperiments(size_t* count) { | 2714 const Experiment* GetExperiments(size_t* count) { |
| 2715 *count = num_experiments; | 2715 *count = num_experiments; |
| 2716 return experiments; | 2716 return experiments; |
| 2717 } | 2717 } |
| 2718 | 2718 |
| 2719 } // namespace testing | 2719 } // namespace testing |
| 2720 | 2720 |
| 2721 } // namespace about_flags | 2721 } // namespace about_flags |
| OLD | NEW |