| OLD | NEW |
| 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> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
| 14 #include "base/metrics/sparse_histogram.h" | 14 #include "base/metrics/sparse_histogram.h" |
| 15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "base/values.h" | 19 #include "base/values.h" |
| 20 #include "cc/base/switches.h" | 20 #include "cc/base/switches.h" |
| 21 #include "chrome/browser/flags_storage.h" | 21 #include "chrome/browser/flags_storage.h" |
| 22 #include "chrome/common/channel_info.h" |
| 22 #include "chrome/common/chrome_content_client.h" | 23 #include "chrome/common/chrome_content_client.h" |
| 23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 24 #include "chrome/common/chrome_version_info.h" | |
| 25 #include "chrome/grit/chromium_strings.h" | 25 #include "chrome/grit/chromium_strings.h" |
| 26 #include "chrome/grit/generated_resources.h" | 26 #include "chrome/grit/generated_resources.h" |
| 27 #include "chrome/grit/google_chrome_strings.h" | 27 #include "chrome/grit/google_chrome_strings.h" |
| 28 #include "components/autofill/core/common/autofill_switches.h" | 28 #include "components/autofill/core/common/autofill_switches.h" |
| 29 #include "components/cloud_devices/common/cloud_devices_switches.h" | 29 #include "components/cloud_devices/common/cloud_devices_switches.h" |
| 30 #include "components/dom_distiller/core/dom_distiller_switches.h" | 30 #include "components/dom_distiller/core/dom_distiller_switches.h" |
| 31 #include "components/enhanced_bookmarks/enhanced_bookmark_switches.h" | 31 #include "components/enhanced_bookmarks/enhanced_bookmark_switches.h" |
| 32 #include "components/metrics/metrics_hashes.h" | 32 #include "components/metrics/metrics_hashes.h" |
| 33 #include "components/nacl/common/nacl_switches.h" | 33 #include "components/nacl/common/nacl_switches.h" |
| 34 #include "components/omnibox/browser/omnibox_switches.h" | 34 #include "components/omnibox/browser/omnibox_switches.h" |
| 35 #include "components/plugins/common/plugins_switches.h" | 35 #include "components/plugins/common/plugins_switches.h" |
| 36 #include "components/proximity_auth/switches.h" | 36 #include "components/proximity_auth/switches.h" |
| 37 #include "components/search/search_switches.h" | 37 #include "components/search/search_switches.h" |
| 38 #include "components/version_info/version_info.h" |
| 38 #include "content/public/browser/user_metrics.h" | 39 #include "content/public/browser/user_metrics.h" |
| 39 #include "media/base/media_switches.h" | 40 #include "media/base/media_switches.h" |
| 40 #include "ui/base/l10n/l10n_util.h" | 41 #include "ui/base/l10n/l10n_util.h" |
| 41 #include "ui/base/ui_base_switches.h" | 42 #include "ui/base/ui_base_switches.h" |
| 42 #include "ui/display/display_switches.h" | 43 #include "ui/display/display_switches.h" |
| 43 #include "ui/events/event_switches.h" | 44 #include "ui/events/event_switches.h" |
| 44 #include "ui/gfx/switches.h" | 45 #include "ui/gfx/switches.h" |
| 45 #include "ui/gl/gl_switches.h" | 46 #include "ui/gl/gl_switches.h" |
| 46 #include "ui/keyboard/keyboard_switches.h" | 47 #include "ui/keyboard/keyboard_switches.h" |
| 47 #include "ui/native_theme/native_theme_switches.h" | 48 #include "ui/native_theme/native_theme_switches.h" |
| (...skipping 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2167 flags_storage->SetFlags(new_enabled_experiments); | 2168 flags_storage->SetFlags(new_enabled_experiments); |
| 2168 } | 2169 } |
| 2169 | 2170 |
| 2170 void GetSanitizedEnabledFlags( | 2171 void GetSanitizedEnabledFlags( |
| 2171 FlagsStorage* flags_storage, std::set<std::string>* result) { | 2172 FlagsStorage* flags_storage, std::set<std::string>* result) { |
| 2172 SanitizeList(flags_storage); | 2173 SanitizeList(flags_storage); |
| 2173 *result = flags_storage->GetFlags(); | 2174 *result = flags_storage->GetFlags(); |
| 2174 } | 2175 } |
| 2175 | 2176 |
| 2176 bool SkipConditionalExperiment(const Experiment& experiment) { | 2177 bool SkipConditionalExperiment(const Experiment& experiment) { |
| 2177 version_info::Channel channel = chrome::VersionInfo::GetChannel(); | 2178 version_info::Channel channel = chrome::GetChannel(); |
| 2178 | 2179 |
| 2179 #if defined(OS_ANDROID) | 2180 #if defined(OS_ANDROID) |
| 2180 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel. | 2181 // enable-data-reduction-proxy-dev is only available for the Dev/Beta channel. |
| 2181 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && | 2182 if (!strcmp("enable-data-reduction-proxy-dev", experiment.internal_name) && |
| 2182 channel != version_info::Channel::BETA && | 2183 channel != version_info::Channel::BETA && |
| 2183 channel != version_info::Channel::DEV) { | 2184 channel != version_info::Channel::DEV) { |
| 2184 return true; | 2185 return true; |
| 2185 } | 2186 } |
| 2186 // enable-data-reduction-proxy-alt is only available for the Dev channel. | 2187 // enable-data-reduction-proxy-alt is only available for the Dev channel. |
| 2187 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && | 2188 if (!strcmp("enable-data-reduction-proxy-alt", experiment.internal_name) && |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2703 } | 2704 } |
| 2704 | 2705 |
| 2705 const Experiment* GetExperiments(size_t* count) { | 2706 const Experiment* GetExperiments(size_t* count) { |
| 2706 *count = num_experiments; | 2707 *count = num_experiments; |
| 2707 return experiments; | 2708 return experiments; |
| 2708 } | 2709 } |
| 2709 | 2710 |
| 2710 } // namespace testing | 2711 } // namespace testing |
| 2711 | 2712 |
| 2712 } // namespace about_flags | 2713 } // namespace about_flags |
| OLD | NEW |