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

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: Nits 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 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
2312 #if defined(OS_ANDROID) 2320 #if defined(OS_ANDROID)
2321 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
2313 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel. 2322 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel.
2314 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && 2323 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2315 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_BETA && 2324 channel != chrome::VersionInfo::CHANNEL_BETA &&
2316 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { 2325 channel != chrome::VersionInfo::CHANNEL_DEV) {
2317 return true; 2326 return true;
2318 } 2327 }
2319 // enable-data-reduction-proxy-alt is only available for the Dev channel. 2328 // enable-data-reduction-proxy-alt is only available for the Dev channel.
2320 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && 2329 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) &&
2321 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { 2330 channel != chrome::VersionInfo::CHANNEL_DEV) {
2322 return true; 2331 return true;
2323 } 2332 }
2324 // enable-data-reduction-proxy-lo-fi is only available for Chromium builds and 2333 // enable-data-reduction-proxy-lo-fi is only available for Chromium builds and
2325 // the Canary/Dev channel. 2334 // the Canary/Dev channel.
2326 if (!strcmp("enable-data-reduction-proxy-lo-fi", experiment.internal_name) && 2335 if (!strcmp("enable-data-reduction-proxy-lo-fi", experiment.internal_name) &&
2327 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV && 2336 channel != chrome::VersionInfo::CHANNEL_DEV &&
2328 chrome::VersionInfo::GetChannel() != 2337 channel != chrome::VersionInfo::CHANNEL_CANARY &&
2329 chrome::VersionInfo::CHANNEL_CANARY && 2338 channel != chrome::VersionInfo::CHANNEL_UNKNOWN) {
2330 chrome::VersionInfo::GetChannel() !=
2331 chrome::VersionInfo::CHANNEL_UNKNOWN) {
2332 return true; 2339 return true;
2333 } 2340 }
2334 #endif 2341 #endif
2342
2343 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2344 chrome::VersionInfo::Channel channel2 = chrome::VersionInfo::GetChannel();
Lei Zhang 2015/02/13 20:11:11 I would just do: #if defined(OS_ANDROID) || define
megjablon 2015/02/13 21:21:17 Done.
2345 // enable-data-reduction-proxy-bypass-warning is only available for Chromium
2346 // builds and Canary/Dev channel.
2347 if (!strcmp("enable-data-reduction-proxy-bypass-warnings",
2348 experiment.internal_name) &&
2349 channel2 != chrome::VersionInfo::CHANNEL_UNKNOWN &&
2350 channel2 != chrome::VersionInfo::CHANNEL_CANARY &&
2351 channel2 != chrome::VersionInfo::CHANNEL_DEV) {
2352 return true;
2353 }
2354 #endif
2335 2355
2336 return false; 2356 return false;
2337 } 2357 }
2338 2358
2339 2359
2340 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't 2360 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2341 // enabled on the current platform. 2361 // enabled on the current platform.
2342 void GetSanitizedEnabledFlagsForCurrentPlatform( 2362 void GetSanitizedEnabledFlagsForCurrentPlatform(
2343 FlagsStorage* flags_storage, std::set<std::string>* result) { 2363 FlagsStorage* flags_storage, std::set<std::string>* result) {
2344 GetSanitizedEnabledFlags(flags_storage, result); 2364 GetSanitizedEnabledFlags(flags_storage, result);
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
2779 } 2799 }
2780 2800
2781 const Experiment* GetExperiments(size_t* count) { 2801 const Experiment* GetExperiments(size_t* count) {
2782 *count = num_experiments; 2802 *count = num_experiments;
2783 return experiments; 2803 return experiments;
2784 } 2804 }
2785 2805
2786 } // namespace testing 2806 } // namespace testing
2787 2807
2788 } // namespace about_flags 2808 } // namespace about_flags
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698