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 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2112 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures) | 2112 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures) |
2113 }, | 2113 }, |
2114 #endif | 2114 #endif |
2115 { | 2115 { |
2116 "enable-delay-agnostic-aec", | 2116 "enable-delay-agnostic-aec", |
2117 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME, | 2117 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME, |
2118 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION, | 2118 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION, |
2119 kOsDesktop, | 2119 kOsDesktop, |
2120 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec) | 2120 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec) |
2121 }, | 2121 }, |
| 2122 #if defined(OS_ANDROID) |
| 2123 { |
| 2124 "enable-data-reduction-proxy-bypass-warning", |
| 2125 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_NAME, |
| 2126 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_DESCRIPTION, |
| 2127 kOsAndroid, |
| 2128 SINGLE_VALUE_TYPE(data_reduction_proxy::switches:: |
| 2129 kEnableDataReductionProxyBypassWarning) |
| 2130 }, |
| 2131 #endif |
2122 | 2132 |
2123 // NOTE: Adding new command-line switches requires adding corresponding | 2133 // NOTE: Adding new command-line switches requires adding corresponding |
2124 // entries to enum "LoginCustomFlags" in histograms.xml. See note in | 2134 // entries to enum "LoginCustomFlags" in histograms.xml. See note in |
2125 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. | 2135 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. |
2126 }; | 2136 }; |
2127 | 2137 |
2128 const Experiment* experiments = kExperiments; | 2138 const Experiment* experiments = kExperiments; |
2129 size_t num_experiments = arraysize(kExperiments); | 2139 size_t num_experiments = arraysize(kExperiments); |
2130 | 2140 |
2131 // Stores and encapsulates the little state that about:flags has. | 2141 // Stores and encapsulates the little state that about:flags has. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2225 | 2235 |
2226 bool SkipConditionalExperiment(const Experiment& experiment, | 2236 bool SkipConditionalExperiment(const Experiment& experiment, |
2227 FlagsStorage* flags_storage) { | 2237 FlagsStorage* flags_storage) { |
2228 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || | 2238 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || |
2229 (experiment.internal_name == | 2239 (experiment.internal_name == |
2230 std::string("manual-enhanced-bookmarks-optout"))) { | 2240 std::string("manual-enhanced-bookmarks-optout"))) { |
2231 return true; | 2241 return true; |
2232 } | 2242 } |
2233 | 2243 |
2234 #if defined(OS_ANDROID) | 2244 #if defined(OS_ANDROID) |
| 2245 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
2235 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel. | 2246 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel. |
2236 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && | 2247 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && |
2237 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_BETA && | 2248 channel != chrome::VersionInfo::CHANNEL_BETA && |
2238 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { | 2249 channel != chrome::VersionInfo::CHANNEL_DEV) { |
2239 return true; | 2250 return true; |
2240 } | 2251 } |
2241 // enable-data-reduction-proxy-alt is only available for the Dev channel. | 2252 // enable-data-reduction-proxy-alt is only available for the Dev channel. |
2242 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && | 2253 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && |
2243 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { | 2254 channel != chrome::VersionInfo::CHANNEL_DEV) { |
| 2255 return true; |
| 2256 } |
| 2257 // enable-data-reduction-proxy-bypass-warning is only available for Chromium |
| 2258 // builds and Canary/Dev channel. |
| 2259 if (!strcmp("enable-data-reduction-proxy-bypass-warning", |
| 2260 experiment.internal_name) && |
| 2261 channel != chrome::VersionInfo::CHANNEL_UNKNOWN && |
| 2262 channel != chrome::VersionInfo::CHANNEL_CANARY && |
| 2263 channel != chrome::VersionInfo::CHANNEL_DEV) { |
2244 return true; | 2264 return true; |
2245 } | 2265 } |
2246 #endif | 2266 #endif |
2247 | 2267 |
2248 return false; | 2268 return false; |
2249 } | 2269 } |
2250 | 2270 |
2251 | 2271 |
2252 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't | 2272 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't |
2253 // enabled on the current platform. | 2273 // enabled on the current platform. |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2691 } | 2711 } |
2692 | 2712 |
2693 const Experiment* GetExperiments(size_t* count) { | 2713 const Experiment* GetExperiments(size_t* count) { |
2694 *count = num_experiments; | 2714 *count = num_experiments; |
2695 return experiments; | 2715 return experiments; |
2696 } | 2716 } |
2697 | 2717 |
2698 } // namespace testing | 2718 } // namespace testing |
2699 | 2719 |
2700 } // namespace about_flags | 2720 } // namespace about_flags |
OLD | NEW |