Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: chrome/browser/about_flags.cc

Issue 684223003: Data Reduction Proxy Interstitials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2114 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures) 2114 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures)
2115 }, 2115 },
2116 #endif 2116 #endif
2117 { 2117 {
2118 "enable-delay-agnostic-aec", 2118 "enable-delay-agnostic-aec",
2119 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME, 2119 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME,
2120 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION, 2120 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION,
2121 kOsDesktop, 2121 kOsDesktop,
2122 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec) 2122 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec)
2123 }, 2123 },
2124
2125 { 2124 {
2126 "mark-non-secure-as", // FLAGS:RECORD_UMA 2125 "mark-non-secure-as", // FLAGS:RECORD_UMA
2127 IDS_MARK_NON_SECURE_AS_NAME, 2126 IDS_MARK_NON_SECURE_AS_NAME,
2128 IDS_MARK_NON_SECURE_AS_DESCRIPTION, 2127 IDS_MARK_NON_SECURE_AS_DESCRIPTION,
2129 kOsAll, 2128 kOsAll,
2130 MULTI_VALUE_TYPE(kMarkNonSecureAsChoices) 2129 MULTI_VALUE_TYPE(kMarkNonSecureAsChoices)
2131 }, 2130 },
2132
2133 { 2131 {
2134 "enable-site-per-process", 2132 "enable-site-per-process",
2135 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_NAME, 2133 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_NAME,
2136 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_DESCRIPTION, 2134 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_DESCRIPTION,
2137 kOsAll, 2135 kOsAll,
2138 SINGLE_VALUE_TYPE(switches::kSitePerProcess) 2136 SINGLE_VALUE_TYPE(switches::kSitePerProcess)
2139 }, 2137 },
2140 #if defined(OS_MACOSX) 2138 #if defined(OS_MACOSX)
2141 { 2139 {
2142 "enable-harfbuzz-rendertext", 2140 "enable-harfbuzz-rendertext",
2143 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_NAME, 2141 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_NAME,
2144 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_DESCRIPTION, 2142 IDS_FLAGS_ENABLE_HARFBUZZ_RENDERTEXT_DESCRIPTION,
2145 kOsMac, 2143 kOsMac,
2146 SINGLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText) 2144 SINGLE_VALUE_TYPE(switches::kEnableHarfBuzzRenderText)
2147 }, 2145 },
2148 #endif // defined(OS_MACOSX) 2146 #endif // defined(OS_MACOSX)
2149 #if defined(OS_CHROMEOS) 2147 #if defined(OS_CHROMEOS)
2150 { 2148 {
2151 "enable-timezone-tracking", 2149 "enable-timezone-tracking",
2152 IDS_FLAGS_ENABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_NAME, 2150 IDS_FLAGS_ENABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_NAME,
2153 IDS_FLAGS_ENABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_DESCRIPTION, 2151 IDS_FLAGS_ENABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_DESCRIPTION,
2154 kOsCrOS, 2152 kOsCrOS,
2155 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTimeZoneTrackingOption) 2153 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTimeZoneTrackingOption)
2156 }, 2154 },
2157 #endif // defined(OS_CHROMEOS) 2155 #endif // defined(OS_CHROMEOS)
2156 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2157 {
2158 "enable-data-reduction-proxy-bypass-warning",
2159 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_NAME,
2160 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_DESCRIPTION,
2161 kOsAndroid,
2162 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2163 kEnableDataReductionProxyBypassWarning)
2164 },
2165 #endif
2158 2166
2159 // NOTE: Adding new command-line switches requires adding corresponding 2167 // NOTE: Adding new command-line switches requires adding corresponding
2160 // entries to enum "LoginCustomFlags" in histograms.xml. See note in 2168 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2161 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. 2169 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2162 }; 2170 };
2163 2171
2164 const Experiment* experiments = kExperiments; 2172 const Experiment* experiments = kExperiments;
2165 size_t num_experiments = arraysize(kExperiments); 2173 size_t num_experiments = arraysize(kExperiments);
2166 2174
2167 // Stores and encapsulates the little state that about:flags has. 2175 // Stores and encapsulates the little state that about:flags has.
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
2261 2269
2262 bool SkipConditionalExperiment(const Experiment& experiment, 2270 bool SkipConditionalExperiment(const Experiment& experiment,
2263 FlagsStorage* flags_storage) { 2271 FlagsStorage* flags_storage) {
2264 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || 2272 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) ||
2265 (experiment.internal_name == 2273 (experiment.internal_name ==
2266 std::string("manual-enhanced-bookmarks-optout"))) { 2274 std::string("manual-enhanced-bookmarks-optout"))) {
2267 return true; 2275 return true;
2268 } 2276 }
2269 2277
2270 #if defined(OS_ANDROID) 2278 #if defined(OS_ANDROID)
2279 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
2271 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel. 2280 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel.
2272 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && 2281 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2273 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_BETA && 2282 channel != chrome::VersionInfo::CHANNEL_BETA &&
2274 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { 2283 channel != chrome::VersionInfo::CHANNEL_DEV) {
2275 return true; 2284 return true;
2276 } 2285 }
2277 // enable-data-reduction-proxy-alt is only available for the Dev channel. 2286 // enable-data-reduction-proxy-alt is only available for the Dev channel.
2278 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && 2287 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) &&
2279 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { 2288 channel != chrome::VersionInfo::CHANNEL_DEV) {
2280 return true; 2289 return true;
2281 } 2290 }
2282 #endif 2291 #endif
2292 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
bengr 2015/02/05 00:23:46 Add a blank line above this line.
megjablon 2015/02/07 05:15:13 Done.
2293 chrome::VersionInfo::Channel channel2 = chrome::VersionInfo::GetChannel();
2294 // enable-data-reduction-proxy-bypass-warning is only available for Chromium
2295 // builds and Canary/Dev channel.
2296 if (!strcmp("enable-data-reduction-proxy-bypass-warning",
2297 experiment.internal_name) &&
2298 channel2 != chrome::VersionInfo::CHANNEL_UNKNOWN &&
2299 channel2 != chrome::VersionInfo::CHANNEL_CANARY &&
2300 channel2 != chrome::VersionInfo::CHANNEL_DEV) {
2301 return true;
2302 }
2303 #endif
2283 2304
2284 return false; 2305 return false;
2285 } 2306 }
2286 2307
2287 2308
2288 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't 2309 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2289 // enabled on the current platform. 2310 // enabled on the current platform.
2290 void GetSanitizedEnabledFlagsForCurrentPlatform( 2311 void GetSanitizedEnabledFlagsForCurrentPlatform(
2291 FlagsStorage* flags_storage, std::set<std::string>* result) { 2312 FlagsStorage* flags_storage, std::set<std::string>* result) {
2292 GetSanitizedEnabledFlags(flags_storage, result); 2313 GetSanitizedEnabledFlags(flags_storage, result);
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
2727 } 2748 }
2728 2749
2729 const Experiment* GetExperiments(size_t* count) { 2750 const Experiment* GetExperiments(size_t* count) {
2730 *count = num_experiments; 2751 *count = num_experiments;
2731 return experiments; 2752 return experiments;
2732 } 2753 }
2733 2754
2734 } // namespace testing 2755 } // namespace testing
2735 2756
2736 } // namespace about_flags 2757 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698