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

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 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures) 2129 SINGLE_VALUE_TYPE(switches::kEnablePotentiallyAnnoyingSecurityFeatures)
2130 }, 2130 },
2131 #endif 2131 #endif
2132 { 2132 {
2133 "enable-delay-agnostic-aec", 2133 "enable-delay-agnostic-aec",
2134 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME, 2134 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_NAME,
2135 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION, 2135 IDS_FLAGS_ENABLE_DELAY_AGNOSTIC_AEC_DESCRIPTION,
2136 kOsDesktop, 2136 kOsDesktop,
2137 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec) 2137 SINGLE_VALUE_TYPE(switches::kEnableDelayAgnosticAec)
2138 }, 2138 },
2139
2140 { 2139 {
2141 "mark-non-secure-as", // FLAGS:RECORD_UMA 2140 "mark-non-secure-as", // FLAGS:RECORD_UMA
2142 IDS_MARK_NON_SECURE_AS_NAME, 2141 IDS_MARK_NON_SECURE_AS_NAME,
2143 IDS_MARK_NON_SECURE_AS_DESCRIPTION, 2142 IDS_MARK_NON_SECURE_AS_DESCRIPTION,
2144 kOsAll, 2143 kOsAll,
2145 MULTI_VALUE_TYPE(kMarkNonSecureAsChoices) 2144 MULTI_VALUE_TYPE(kMarkNonSecureAsChoices)
2146 }, 2145 },
2147
2148 { 2146 {
2149 "enable-site-per-process", 2147 "enable-site-per-process",
2150 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_NAME, 2148 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_NAME,
2151 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_DESCRIPTION, 2149 IDS_FLAGS_ENABLE_SITE_PER_PROCESS_DESCRIPTION,
2152 kOsAll, 2150 kOsAll,
2153 SINGLE_VALUE_TYPE(switches::kSitePerProcess) 2151 SINGLE_VALUE_TYPE(switches::kSitePerProcess)
2154 }, 2152 },
2155 #if defined(OS_CHROMEOS) 2153 #if defined(OS_CHROMEOS)
2156 { 2154 {
2157 "enable-timezone-tracking", 2155 "enable-timezone-tracking",
2158 IDS_FLAGS_ENABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_NAME, 2156 IDS_FLAGS_ENABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_NAME,
2159 IDS_FLAGS_ENABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_DESCRIPTION, 2157 IDS_FLAGS_ENABLE_RESOLVE_TIMEZONE_BY_GEOLOCATION_DESCRIPTION,
2160 kOsCrOS, 2158 kOsCrOS,
2161 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTimeZoneTrackingOption) 2159 SINGLE_VALUE_TYPE(chromeos::switches::kEnableTimeZoneTrackingOption)
2162 }, 2160 },
2163 #endif // defined(OS_CHROMEOS) 2161 #endif // defined(OS_CHROMEOS)
2162 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2163 {
2164 "enable-data-reduction-proxy-bypass-warning",
2165 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_NAME,
2166 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_DESCRIPTION,
2167 kOsAndroid,
2168 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2169 kEnableDataReductionProxyBypassWarning)
2170 },
2171 #endif
2164 2172
2165 // NOTE: Adding new command-line switches requires adding corresponding 2173 // NOTE: Adding new command-line switches requires adding corresponding
2166 // entries to enum "LoginCustomFlags" in histograms.xml. See note in 2174 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2167 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. 2175 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2168 }; 2176 };
2169 2177
2170 const Experiment* experiments = kExperiments; 2178 const Experiment* experiments = kExperiments;
2171 size_t num_experiments = arraysize(kExperiments); 2179 size_t num_experiments = arraysize(kExperiments);
2172 2180
2173 // Stores and encapsulates the little state that about:flags has. 2181 // Stores and encapsulates the little state that about:flags has.
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
2267 2275
2268 bool SkipConditionalExperiment(const Experiment& experiment, 2276 bool SkipConditionalExperiment(const Experiment& experiment,
2269 FlagsStorage* flags_storage) { 2277 FlagsStorage* flags_storage) {
2270 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) || 2278 if ((experiment.internal_name == std::string("manual-enhanced-bookmarks")) ||
2271 (experiment.internal_name == 2279 (experiment.internal_name ==
2272 std::string("manual-enhanced-bookmarks-optout"))) { 2280 std::string("manual-enhanced-bookmarks-optout"))) {
2273 return true; 2281 return true;
2274 } 2282 }
2275 2283
2276 #if defined(OS_ANDROID) 2284 #if defined(OS_ANDROID)
2285 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
2277 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel. 2286 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel.
2278 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && 2287 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2279 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_BETA && 2288 channel != chrome::VersionInfo::CHANNEL_BETA &&
2280 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { 2289 channel != chrome::VersionInfo::CHANNEL_DEV) {
2281 return true; 2290 return true;
2282 } 2291 }
2283 // enable-data-reduction-proxy-alt is only available for the Dev channel. 2292 // enable-data-reduction-proxy-alt is only available for the Dev channel.
2284 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && 2293 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) &&
2285 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { 2294 channel != chrome::VersionInfo::CHANNEL_DEV) {
2286 return true; 2295 return true;
2287 } 2296 }
2288 #endif 2297 #endif
2298 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2299 chrome::VersionInfo::Channel channel2 = chrome::VersionInfo::GetChannel();
2300 // enable-data-reduction-proxy-bypass-warning is only available for Chromium
2301 // builds and Canary/Dev channel.
2302 if (!strcmp("enable-data-reduction-proxy-bypass-warning",
2303 experiment.internal_name) &&
2304 channel2 != chrome::VersionInfo::CHANNEL_UNKNOWN &&
2305 channel2 != chrome::VersionInfo::CHANNEL_CANARY &&
2306 channel2 != chrome::VersionInfo::CHANNEL_DEV) {
mmenke 2015/02/02 15:45:52 Hrm...Can we just make ENABLE_DATA_REDUCTION_PROXY
megjablon 2015/02/03 23:21:26 Is this possible? I'm not sure how to do this.
mmenke 2015/02/03 23:57:32 I'm assuming that the channel is a gyp variable, a
2307 return true;
2308 }
2309 #endif
2289 2310
2290 return false; 2311 return false;
2291 } 2312 }
2292 2313
2293 2314
2294 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't 2315 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2295 // enabled on the current platform. 2316 // enabled on the current platform.
2296 void GetSanitizedEnabledFlagsForCurrentPlatform( 2317 void GetSanitizedEnabledFlagsForCurrentPlatform(
2297 FlagsStorage* flags_storage, std::set<std::string>* result) { 2318 FlagsStorage* flags_storage, std::set<std::string>* result) {
2298 GetSanitizedEnabledFlags(flags_storage, result); 2319 GetSanitizedEnabledFlags(flags_storage, result);
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
2733 } 2754 }
2734 2755
2735 const Experiment* GetExperiments(size_t* count) { 2756 const Experiment* GetExperiments(size_t* count) {
2736 *count = num_experiments; 2757 *count = num_experiments;
2737 return experiments; 2758 return experiments;
2738 } 2759 }
2739 2760
2740 } // namespace testing 2761 } // namespace testing
2741 2762
2742 } // namespace about_flags 2763 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698