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

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, 11 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 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after
2098 }, 2098 },
2099 #if defined(OS_CHROMEOS) 2099 #if defined(OS_CHROMEOS)
2100 { 2100 {
2101 "enable-wifi-credential-sync", // FLAGS:RECORD_UMA 2101 "enable-wifi-credential-sync", // FLAGS:RECORD_UMA
2102 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_NAME, 2102 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_NAME,
2103 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_DESCRIPTION, 2103 IDS_FLAGS_ENABLE_WIFI_CREDENTIAL_SYNC_DESCRIPTION,
2104 kOsCrOS, 2104 kOsCrOS,
2105 SINGLE_VALUE_TYPE(switches::kEnableWifiCredentialSync) 2105 SINGLE_VALUE_TYPE(switches::kEnableWifiCredentialSync)
2106 }, 2106 },
2107 #endif 2107 #endif
2108 #if defined(OS_ANDROID)
2109 {
2110 "enable-data-reduction-proxy-bypass-warning",
2111 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_NAME,
2112 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_DESCRIPTION,
2113 kOsAndroid,
2114 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2115 kEnableDataReductionProxyBypassWarning)
2116 },
2117 #endif
2108 2118
2109 // NOTE: Adding new command-line switches requires adding corresponding 2119 // NOTE: Adding new command-line switches requires adding corresponding
2110 // entries to enum "LoginCustomFlags" in histograms.xml. See note in 2120 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2111 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. 2121 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2112 }; 2122 };
2113 2123
2114 const Experiment* experiments = kExperiments; 2124 const Experiment* experiments = kExperiments;
2115 size_t num_experiments = arraysize(kExperiments); 2125 size_t num_experiments = arraysize(kExperiments);
2116 2126
2117 // Stores and encapsulates the little state that about:flags has. 2127 // Stores and encapsulates the little state that about:flags has.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && 2232 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2223 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_BETA && 2233 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_BETA &&
2224 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { 2234 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) {
2225 return true; 2235 return true;
2226 } 2236 }
2227 // enable-data-reduction-proxy-alt is only available for the Dev channel. 2237 // enable-data-reduction-proxy-alt is only available for the Dev channel.
2228 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && 2238 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) &&
2229 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { 2239 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) {
2230 return true; 2240 return true;
2231 } 2241 }
2242 // enable-data-reduction-proxy-bypass-warning is only available for Chromium
2243 // builds and Canary/Dev channel.
2244 if (!strcmp("enable-data-reduction-proxy-bypass-warning",
2245 experiment.internal_name) &&
2246 chrome::VersionInfo::GetChannel() !=
Lei Zhang 2015/01/07 23:49:42 If you don't mind, just call GetChannel() once and
megjablon 2015/01/12 22:01:58 Done.
2247 chrome::VersionInfo::CHANNEL_UNKNOWN &&
2248 chrome::VersionInfo::GetChannel() !=
2249 chrome::VersionInfo::CHANNEL_CANARY &&
2250 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) {
2251 return true;
2252 }
2232 #endif 2253 #endif
2233 2254
2234 return false; 2255 return false;
2235 } 2256 }
2236 2257
2237 2258
2238 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't 2259 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2239 // enabled on the current platform. 2260 // enabled on the current platform.
2240 void GetSanitizedEnabledFlagsForCurrentPlatform( 2261 void GetSanitizedEnabledFlagsForCurrentPlatform(
2241 FlagsStorage* flags_storage, std::set<std::string>* result) { 2262 FlagsStorage* flags_storage, std::set<std::string>* result) {
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
2677 } 2698 }
2678 2699
2679 const Experiment* GetExperiments(size_t* count) { 2700 const Experiment* GetExperiments(size_t* count) {
2680 *count = num_experiments; 2701 *count = num_experiments;
2681 return experiments; 2702 return experiments;
2682 } 2703 }
2683 2704
2684 } // namespace testing 2705 } // namespace testing
2685 2706
2686 } // namespace about_flags 2707 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698