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