Chromium Code Reviews

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

Issue 1257633002: Componentize VersionInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Convert version_info::Channel to a "class enum" Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 2161 matching lines...)
2172 flags_storage->SetFlags(new_enabled_experiments); 2172 flags_storage->SetFlags(new_enabled_experiments);
2173 } 2173 }
2174 2174
2175 void GetSanitizedEnabledFlags( 2175 void GetSanitizedEnabledFlags(
2176 FlagsStorage* flags_storage, std::set<std::string>* result) { 2176 FlagsStorage* flags_storage, std::set<std::string>* result) {
2177 SanitizeList(flags_storage); 2177 SanitizeList(flags_storage);
2178 *result = flags_storage->GetFlags(); 2178 *result = flags_storage->GetFlags();
2179 } 2179 }
2180 2180
2181 bool SkipConditionalExperiment(const Experiment& experiment) { 2181 bool SkipConditionalExperiment(const Experiment& experiment) {
2182 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); 2182 version_info::Channel channel = chrome::VersionInfo::GetChannel();
2183 2183
2184 #if defined(OS_ANDROID) 2184 #if defined(OS_ANDROID)
2185 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel. 2185 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel.
2186 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && 2186 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) &&
2187 channel != chrome::VersionInfo::CHANNEL_BETA && 2187 channel != version_info::Channel::BETA &&
2188 channel != chrome::VersionInfo::CHANNEL_DEV) { 2188 channel != version_info::Channel::DEV) {
2189 return true; 2189 return true;
2190 } 2190 }
2191 // enable-data-reduction-proxy-alt is only available for the Dev channel. 2191 // enable-data-reduction-proxy-alt is only available for the Dev channel.
2192 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && 2192 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) &&
2193 channel != chrome::VersionInfo::CHANNEL_DEV) { 2193 channel != version_info::Channel::DEV) {
2194 return true; 2194 return true;
2195 } 2195 }
2196 // enable-data-reduction-proxy-carrier-test is only available for Chromium 2196 // enable-data-reduction-proxy-carrier-test is only available for Chromium
2197 // builds and the Canary/Dev channel. 2197 // builds and the Canary/Dev channel.
2198 if (!strcmp("enable-data-reduction-proxy-carrier-test", 2198 if (!strcmp("enable-data-reduction-proxy-carrier-test",
2199 experiment.internal_name) && 2199 experiment.internal_name) &&
2200 channel != chrome::VersionInfo::CHANNEL_DEV && 2200 channel != version_info::Channel::DEV &&
2201 channel != chrome::VersionInfo::CHANNEL_CANARY && 2201 channel != version_info::Channel::CANARY &&
2202 channel != chrome::VersionInfo::CHANNEL_UNKNOWN) { 2202 channel != version_info::Channel::UNKNOWN) {
2203 return true; 2203 return true;
2204 } 2204 }
2205 #endif 2205 #endif
2206 2206
2207 // data-reduction-proxy-lo-fi is only available for Chromium builds and 2207 // data-reduction-proxy-lo-fi is only available for Chromium builds and
2208 // the Canary/Dev/Beta channels. 2208 // the Canary/Dev/Beta channels.
2209 if (!strcmp("data-reduction-proxy-lo-fi", experiment.internal_name) && 2209 if (!strcmp("data-reduction-proxy-lo-fi", experiment.internal_name) &&
2210 channel != chrome::VersionInfo::CHANNEL_BETA && 2210 channel != version_info::Channel::BETA &&
2211 channel != chrome::VersionInfo::CHANNEL_DEV && 2211 channel != version_info::Channel::DEV &&
2212 channel != chrome::VersionInfo::CHANNEL_CANARY && 2212 channel != version_info::Channel::CANARY &&
2213 channel != chrome::VersionInfo::CHANNEL_UNKNOWN) { 2213 channel != version_info::Channel::UNKNOWN) {
2214 return true; 2214 return true;
2215 } 2215 }
2216 2216
2217 // enable-data-reduction-proxy-config-client is only available for Chromium 2217 // enable-data-reduction-proxy-config-client is only available for Chromium
2218 // builds and the Canary/Dev channels. 2218 // builds and the Canary/Dev channels.
2219 if (!strcmp("enable-data-reduction-proxy-config-client", 2219 if (!strcmp("enable-data-reduction-proxy-config-client",
2220 experiment.internal_name) && 2220 experiment.internal_name) &&
2221 channel != chrome::VersionInfo::CHANNEL_DEV && 2221 channel != version_info::Channel::DEV &&
2222 channel != chrome::VersionInfo::CHANNEL_CANARY && 2222 channel != version_info::Channel::CANARY &&
2223 channel != chrome::VersionInfo::CHANNEL_UNKNOWN) { 2223 channel != version_info::Channel::UNKNOWN) {
2224 return true; 2224 return true;
2225 } 2225 }
2226 2226
2227 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING) 2227 #if defined(ENABLE_DATA_REDUCTION_PROXY_DEBUGGING)
2228 // enable-data-reduction-proxy-bypass-warning is only available for Chromium 2228 // enable-data-reduction-proxy-bypass-warning is only available for Chromium
2229 // builds and Canary/Dev channel. 2229 // builds and Canary/Dev channel.
2230 if (!strcmp("enable-data-reduction-proxy-bypass-warnings", 2230 if (!strcmp("enable-data-reduction-proxy-bypass-warnings",
2231 experiment.internal_name) && 2231 experiment.internal_name) &&
2232 channel != chrome::VersionInfo::CHANNEL_UNKNOWN && 2232 channel != version_info::Channel::UNKNOWN &&
2233 channel != chrome::VersionInfo::CHANNEL_CANARY && 2233 channel != version_info::Channel::CANARY &&
2234 channel != chrome::VersionInfo::CHANNEL_DEV) { 2234 channel != version_info::Channel::DEV) {
2235 return true; 2235 return true;
2236 } 2236 }
2237 #endif 2237 #endif
2238 2238
2239 return false; 2239 return false;
2240 } 2240 }
2241 2241
2242 2242
2243 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't 2243 // Variant of GetSanitizedEnabledFlags that also removes any flags that aren't
2244 // enabled on the current platform. 2244 // enabled on the current platform.
(...skipping 463 matching lines...)
2708 } 2708 }
2709 2709
2710 const Experiment* GetExperiments(size_t* count) { 2710 const Experiment* GetExperiments(size_t* count) {
2711 *count = num_experiments; 2711 *count = num_experiments;
2712 return experiments; 2712 return experiments;
2713 } 2713 }
2714 2714
2715 } // namespace testing 2715 } // namespace testing
2716 2716
2717 } // namespace about_flags 2717 } // namespace about_flags
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/apps/app_window_intercept_all_keys_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine