| 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 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures) | 2148 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures) |
| 2149 }, | 2149 }, |
| 2150 #endif | 2150 #endif |
| 2151 { | 2151 { |
| 2152 "enable-delay-agnostic-aec", | 2152 "enable-delay-agnostic-aec", |
| 2153 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME, | 2153 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME, |
| 2154 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION, | 2154 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION, |
| 2155 kOsDesktop, | 2155 kOsDesktop, |
| 2156 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec) | 2156 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec) |
| 2157 }, | 2157 }, |
| 2158 | |
| 2159 { | 2158 { |
| 2160 "mark-non-secure-as", // FLAGS:RECORD_UMA | 2159 "mark-non-secure-as", // FLAGS:RECORD_UMA |
| 2161 IDS_MARK_NON_SECURE_AS_NAME, | 2160 IDS_MARK_NON_SECURE_AS_NAME, |
| 2162 IDS_MARK_NON_SECURE_AS_DESCRIPTION, | 2161 IDS_MARK_NON_SECURE_AS_DESCRIPTION, |
| 2163 kOsAll, | 2162 kOsAll, |
| 2164 MULTI_VALUE_TYPE(kMarkNonSecureAsChoices) | 2163 MULTI_VALUE_TYPE(kMarkNonSecureAsChoices) |
| 2165 }, | 2164 }, |
| 2166 | |
| 2167 { | 2165 { |
| 2168 "enable-site-per-process", | 2166 "enable-site-per-process", |
| 2169 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_NAME, | 2167 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_NAME, |
| 2170 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_DESCRIPTION, | 2168 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_DESCRIPTION, |
| 2171 kOsAll, | 2169 kOsAll, |
| 2172 SINGLE_VALUE_TYPE(switches::kSitePerProcess) | 2170 SINGLE_VALUE_TYPE(switches::kSitePerProcess) |
| 2173 }, | 2171 }, |
| 2174 #if defined(OS_MACOSX) | 2172 #if defined(OS_MACOSX) |
| 2175 { | 2173 { |
| 2176 "enable-harfbuzz-rendertext", | 2174 "enable-harfbuzz-rendertext", |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2190 }, | 2188 }, |
| 2191 #endif // defined(OS_CHROMEOS) | 2189 #endif // defined(OS_CHROMEOS) |
| 2192 { | 2190 { |
| 2193 "enable-data-reduction-proxy-lo-fi", | 2191 "enable-data-reduction-proxy-lo-fi", |
| 2194 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LO_FI_NAME, | 2192 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LO_FI_NAME, |
| 2195 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LO_FI_DESCRIPTION, | 2193 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LO_FI_DESCRIPTION, |
| 2196 kOsAll, | 2194 kOsAll, |
| 2197 SINGLE_VALUE_TYPE(data_reduction_proxy::switches:: | 2195 SINGLE_VALUE_TYPE(data_reduction_proxy::switches:: |
| 2198 kEnableDataReductionProxyLoFi) | 2196 kEnableDataReductionProxyLoFi) |
| 2199 }, | 2197 }, |
| 2198 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING) |
| 2199 { |
| 2200 "enable-data-reduction-proxy-bypass-warnings", |
| 2201 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_NAME, |
| 2202 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_DESCRIPTION, |
| 2203 kOsAndroid, |
| 2204 SINGLE_VALUE_TYPE(data_reduction_proxy::switches:: |
| 2205 kEnableDataReductionProxyBypassWarning) |
| 2206 }, |
| 2207 #endif |
| 2200 | 2208 |
| 2201 // NOTE: Adding new command-line switches requires adding corresponding | 2209 // NOTE: Adding new command-line switches requires adding corresponding |
| 2202 // entries to enum "LoginCustomFlags" in histograms.xml. See note in | 2210 // entries to enum "LoginCustomFlags" in histograms.xml. See note in |
| 2203 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. | 2211 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. |
| 2204 }; | 2212 }; |
| 2205 | 2213 |
| 2206 const Experiment* experiments = kExperiments; | 2214 const Experiment* experiments = kExperiments; |
| 2207 size_t num_experiments = arraysize(kExperiments); | 2215 size_t num_experiments = arraysize(kExperiments); |
| 2208 | 2216 |
| 2209 // Stores and encapsulates the little state that about:flags has. | 2217 // Stores and encapsulates the little state that about:flags has. |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2302 } | 2310 } |
| 2303 | 2311 |
| 2304 bool SkipConditionalExperiment(const Experiment& experiment, | 2312 bool SkipConditionalExperiment(const Experiment& experiment, |
| 2305 FlagsStorage* flags_storage) { | 2313 FlagsStorage* flags_storage) { |
| 2306 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || | 2314 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || |
| 2307 (experiment.internal_name == | 2315 (experiment.internal_name == |
| 2308 std::string("manual-enhanced-bookmarks-optout"))) { | 2316 std::string("manual-enhanced-bookmarks-optout"))) { |
| 2309 return true; | 2317 return true; |
| 2310 } | 2318 } |
| 2311 | 2319 |
| 2320 #if defined(OS_ANDROID) || defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING) |
| 2321 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| 2322 #endif |
| 2323 |
| 2312 #if defined(OS_ANDROID) | 2324 #if defined(OS_ANDROID) |
| 2313 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel. | 2325 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel. |
| 2314 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && | 2326 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && |
| 2315 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_BETA && | 2327 channel != chrome::VersionInfo::CHANNEL_BETA && |
| 2316 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { | 2328 channel != chrome::VersionInfo::CHANNEL_DEV) { |
| 2317 return true; | 2329 return true; |
| 2318 } | 2330 } |
| 2319 // enable-data-reduction-proxy-alt is only available for the Dev channel. | 2331 // enable-data-reduction-proxy-alt is only available for the Dev channel. |
| 2320 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && | 2332 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && |
| 2321 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { | 2333 channel != chrome::VersionInfo::CHANNEL_DEV) { |
| 2322 return true; | 2334 return true; |
| 2323 } | 2335 } |
| 2324 // enable-data-reduction-proxy-lo-fi is only available for Chromium builds and | 2336 // enable-data-reduction-proxy-lo-fi is only available for Chromium builds and |
| 2325 // the Canary/Dev channel. | 2337 // the Canary/Dev channel. |
| 2326 if (!strcmp("enable-data-reduction-proxy-lo-fi", experiment.internal_name) && | 2338 if (!strcmp("enable-data-reduction-proxy-lo-fi", experiment.internal_name) && |
| 2327 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV && | 2339 channel != chrome::VersionInfo::CHANNEL_DEV && |
| 2328 chrome::VersionInfo::GetChannel() != | 2340 channel != chrome::VersionInfo::CHANNEL_CANARY && |
| 2329 chrome::VersionInfo::CHANNEL_CANARY && | 2341 channel != chrome::VersionInfo::CHANNEL_UNKNOWN) { |
| 2330 chrome::VersionInfo::GetChannel() != | |
| 2331 chrome::VersionInfo::CHANNEL_UNKNOWN) { | |
| 2332 return true; | 2342 return true; |
| 2333 } | 2343 } |
| 2334 #endif | 2344 #endif |
| 2345 |
| 2346 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING) |
| 2347 // enable-data-reduction-proxy-bypass-warning is only available for Chromium |
| 2348 // builds and Canary/Dev channel. |
| 2349 if (!strcmp("enable-data-reduction-proxy-bypass-warnings", |
| 2350 experiment.internal_name) && |
| 2351 channel != chrome::VersionInfo::CHANNEL_UNKNOWN && |
| 2352 channel != chrome::VersionInfo::CHANNEL_CANARY && |
| 2353 channel != chrome::VersionInfo::CHANNEL_DEV) { |
| 2354 return true; |
| 2355 } |
| 2356 #endif |
| 2335 | 2357 |
| 2336 return false; | 2358 return false; |
| 2337 } | 2359 } |
| 2338 | 2360 |
| 2339 | 2361 |
| 2340 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't | 2362 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't |
| 2341 // enabled on the current platform. | 2363 // enabled on the current platform. |
| 2342 void GetSanitizedEnabledFlagsForCurrentPlatform( | 2364 void GetSanitizedEnabledFlagsForCurrentPlatform( |
| 2343 FlagsStorage* flags_storage, std::set<std::string>* result) { | 2365 FlagsStorage* flags_storage, std::set<std::string>* result) { |
| 2344 GetSanitizedEnabledFlags(flags_storage, result); | 2366 GetSanitizedEnabledFlags(flags_storage, result); |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2779 } | 2801 } |
| 2780 | 2802 |
| 2781 const Experiment* GetExperiments(size_t* count) { | 2803 const Experiment* GetExperiments(size_t* count) { |
| 2782 *count = num_experiments; | 2804 *count = num_experiments; |
| 2783 return experiments; | 2805 return experiments; |
| 2784 } | 2806 } |
| 2785 | 2807 |
| 2786 } // namespace testing | 2808 } // namespace testing |
| 2787 | 2809 |
| 2788 } // namespace about_flags | 2810 } // namespace about_flags |
| OLD | NEW |