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

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: Adding tests and addressing comments Created 6 years 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 2053 matching lines...) Expand 10 before | Expand all | Expand 10 after
2064 SINGLE_VALUE_TYPE("enable-touch-hover") 2064 SINGLE_VALUE_TYPE("enable-touch-hover")
2065 }, 2065 },
2066 { 2066 {
2067 "enable-fill-on-account-select", 2067 "enable-fill-on-account-select",
2068 IDS_FILL_ON_ACCOUNT_SELECT_NAME, 2068 IDS_FILL_ON_ACCOUNT_SELECT_NAME,
2069 IDS_FILL_ON_ACCOUNT_SELECT_DESCRIPTION, 2069 IDS_FILL_ON_ACCOUNT_SELECT_DESCRIPTION,
2070 kOsAll, 2070 kOsAll,
2071 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnableFillOnAccountSelect, 2071 ENABLE_DISABLE_VALUE_TYPE(autofill::switches::kEnableFillOnAccountSelect,
2072 autofill::switches::kDisableFillOnAccountSelect) 2072 autofill::switches::kDisableFillOnAccountSelect)
2073 }, 2073 },
2074 #if defined(OS_ANDROID)
2075 {
2076 "enable-data-reduction-proxy-bypass-warning",
2077 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_NAME,
2078 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_BYPASS_WARNING_DESCRIPTION,
2079 kOsAndroid,
2080 SINGLE_VALUE_TYPE(data_reduction_proxy::switches::
2081 kEnableDataReductionProxyBypassWarning)
2082 },
2083 #endif
2074 2084
2075 // NOTE: Adding new command-line switches requires adding corresponding 2085 // NOTE: Adding new command-line switches requires adding corresponding
2076 // entries to enum "LoginCustomFlags" in histograms.xml. See note in 2086 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2077 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. 2087 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2078 }; 2088 };
2079 2089
2080 const Experiment* experiments = kExperiments; 2090 const Experiment* experiments = kExperiments;
2081 size_t num_experiments = arraysize(kExperiments); 2091 size_t num_experiments = arraysize(kExperiments);
2082 2092
2083 // Stores and encapsulates the little state that about:flags has. 2093 // Stores and encapsulates the little state that about:flags has.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
2188 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && 2198 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2189 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_BETA && 2199 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_BETA &&
2190 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { 2200 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) {
2191 return true; 2201 return true;
2192 } 2202 }
2193 // enable-data-reduction-proxy-alt is only available for the Dev channel. 2203 // enable-data-reduction-proxy-alt is only available for the Dev channel.
2194 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && 2204 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) &&
2195 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) { 2205 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) {
2196 return true; 2206 return true;
2197 } 2207 }
2208 // enable-data-reduction-proxy-bypass-warning is only available for Chromium
2209 // builds and Canary/Dev channel.
2210 if (!strcmp("enable-data-reduction-proxy-bypass-warning",
2211 experiment.internal_name) &&
2212 chrome::VersionInfo::GetChannel() !=
2213 chrome::VersionInfo::CHANNEL_UNKNOWN &&
2214 chrome::VersionInfo::GetChannel() !=
2215 chrome::VersionInfo::CHANNEL_CANARY &&
2216 chrome::VersionInfo::GetChannel() != chrome::VersionInfo::CHANNEL_DEV) {
2217 return true;
2218 }
2198 #endif 2219 #endif
2199 2220
2200 return false; 2221 return false;
2201 } 2222 }
2202 2223
2203 2224
2204 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't 2225 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2205 // enabled on the current platform. 2226 // enabled on the current platform.
2206 void GetSanitizedEnabledFlagsForCurrentPlatform( 2227 void GetSanitizedEnabledFlagsForCurrentPlatform(
2207 FlagsStorage* flags_storage, std::set<std::string>* result) { 2228 FlagsStorage* flags_storage, std::set<std::string>* result) {
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
2643 } 2664 }
2644 2665
2645 const Experiment* GetExperiments(size_t* count) { 2666 const Experiment* GetExperiments(size_t* count) {
2646 *count = num_experiments; 2667 *count = num_experiments;
2647 return experiments; 2668 return experiments;
2648 } 2669 }
2649 2670
2650 } // namespace testing 2671 } // namespace testing
2651 2672
2652 } // namespace about_flags 2673 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698