| 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> |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 switches::kEnableWebFontsInterventionV2, | 574 switches::kEnableWebFontsInterventionV2, |
| 575 switches::kEnableWebFontsInterventionV2SwitchValueDisabled}, | 575 switches::kEnableWebFontsInterventionV2SwitchValueDisabled}, |
| 576 }; | 576 }; |
| 577 | 577 |
| 578 const FeatureEntry::Choice kSSLVersionMaxChoices[] = { | 578 const FeatureEntry::Choice kSSLVersionMaxChoices[] = { |
| 579 {IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, | 579 {IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 580 {IDS_FLAGS_SSL_VERSION_MAX_TLS12, switches::kSSLVersionMax, "tls1.2"}, | 580 {IDS_FLAGS_SSL_VERSION_MAX_TLS12, switches::kSSLVersionMax, "tls1.2"}, |
| 581 {IDS_FLAGS_SSL_VERSION_MAX_TLS13, switches::kSSLVersionMax, "tls1.3"}, | 581 {IDS_FLAGS_SSL_VERSION_MAX_TLS13, switches::kSSLVersionMax, "tls1.3"}, |
| 582 }; | 582 }; |
| 583 | 583 |
| 584 const FeatureEntry::Choice kSecurityVerboseChoices[] = { | 584 const FeatureEntry::Choice kSecurityChipChoices[] = { |
| 585 {IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_DEFAULT, "", ""}, | 585 {IDS_FLAGS_SECURITY_CHIP_DEFAULT, "", ""}, |
| 586 {IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_SHOW_ALL_ANIMATED, | 586 {IDS_FLAGS_SECURITY_CHIP_SHOW_NONSECURE_ONLY, switches::kSecurityChip, |
| 587 switches::kMaterialSecurityVerbose, | 587 switches::kSecurityChipShowNonSecureOnly}, |
| 588 switches::kMaterialSecurityVerboseShowAllAnimated}, | 588 {IDS_FLAGS_SECURITY_CHIP_SHOW_ALL, switches::kSecurityChip, |
| 589 {IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_SHOW_ALL_NONANIMATED, | 589 switches::kSecurityChipShowAll}, |
| 590 switches::kMaterialSecurityVerbose, | 590 }; |
| 591 switches::kMaterialSecurityVerboseShowAllNonAnimated}, | 591 |
| 592 {IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_SHOW_NONSECURE_ANIMATED, | 592 const FeatureEntry::Choice kSecurityChipAnimationChoices[] = { |
| 593 switches::kMaterialSecurityVerbose, | 593 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_DEFAULT, "", ""}, |
| 594 switches::kMaterialSecurityVerboseShowNonSecureAnimated}, | 594 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_NONE, switches::kSecurityChipAnimation, |
| 595 {IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_SHOW_NONSECURE_NONANIMATED, | 595 switches::kSecurityChipAnimationNone}, |
| 596 switches::kMaterialSecurityVerbose, | 596 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_NONSECURE_ONLY, |
| 597 switches::kMaterialSecurityVerboseShowNonSecureNonAnimated}, | 597 switches::kSecurityChipAnimation, |
| 598 switches::kSecurityChipAnimationNonSecureOnly}, |
| 599 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_ALL, switches::kSecurityChipAnimation, |
| 600 switches::kSecurityChipAnimationAll}, |
| 598 }; | 601 }; |
| 599 | 602 |
| 600 // RECORDING USER METRICS FOR FLAGS: | 603 // RECORDING USER METRICS FOR FLAGS: |
| 601 // ----------------------------------------------------------------------------- | 604 // ----------------------------------------------------------------------------- |
| 602 // The first line of the entry is the internal name. | 605 // The first line of the entry is the internal name. |
| 603 // | 606 // |
| 604 // To add a new entry, add to the end of kFeatureEntries. There are two | 607 // To add a new entry, add to the end of kFeatureEntries. There are two |
| 605 // distinct types of entries: | 608 // distinct types of entries: |
| 606 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE | 609 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE |
| 607 // macro for this type supplying the command line to the macro. | 610 // macro for this type supplying the command line to the macro. |
| (...skipping 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2000 IDS_FLAGS_GAMEPAD_EXTENSIONS_DESCRIPTION, kOsAll, | 2003 IDS_FLAGS_GAMEPAD_EXTENSIONS_DESCRIPTION, kOsAll, |
| 2001 FEATURE_VALUE_TYPE(features::kGamepadExtensions)}, | 2004 FEATURE_VALUE_TYPE(features::kGamepadExtensions)}, |
| 2002 #if defined(OS_CHROMEOS) | 2005 #if defined(OS_CHROMEOS) |
| 2003 {"arc-use-auth-endpoint", IDS_FLAGS_ARC_USE_AUTH_ENDPOINT_NAME, | 2006 {"arc-use-auth-endpoint", IDS_FLAGS_ARC_USE_AUTH_ENDPOINT_NAME, |
| 2004 IDS_FLAGS_ARC_USE_AUTH_ENDPOINT_DESCRIPTION, kOsCrOS, | 2007 IDS_FLAGS_ARC_USE_AUTH_ENDPOINT_DESCRIPTION, kOsCrOS, |
| 2005 SINGLE_VALUE_TYPE_AND_VALUE( | 2008 SINGLE_VALUE_TYPE_AND_VALUE( |
| 2006 chromeos::switches::kArcUseAuthEndpoint, | 2009 chromeos::switches::kArcUseAuthEndpoint, |
| 2007 "https://www-googleapis-staging.sandbox.google.com/oauth2/v4/" | 2010 "https://www-googleapis-staging.sandbox.google.com/oauth2/v4/" |
| 2008 "ExchangeToken")}, | 2011 "ExchangeToken")}, |
| 2009 #endif // OS_CHROMEOS | 2012 #endif // OS_CHROMEOS |
| 2010 {"material-security-verbose", IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_NAME, | |
| 2011 IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_DESCRIPTION, kOsDesktop, | |
| 2012 MULTI_VALUE_TYPE(kSecurityVerboseChoices)}, | |
| 2013 #if defined(OS_CHROMEOS) | 2013 #if defined(OS_CHROMEOS) |
| 2014 {"arc-boot-completed-broadcast", IDS_FLAGS_ARC_BOOT_COMPLETED, | 2014 {"arc-boot-completed-broadcast", IDS_FLAGS_ARC_BOOT_COMPLETED, |
| 2015 IDS_FLAGS_ARC_BOOT_COMPLETED_DESCRIPTION, kOsCrOS, | 2015 IDS_FLAGS_ARC_BOOT_COMPLETED_DESCRIPTION, kOsCrOS, |
| 2016 FEATURE_VALUE_TYPE(arc::kBootCompletedBroadcastFeature)}, | 2016 FEATURE_VALUE_TYPE(arc::kBootCompletedBroadcastFeature)}, |
| 2017 #endif | 2017 #endif |
| 2018 #if defined(OS_WIN) | 2018 #if defined(OS_WIN) |
| 2019 {"disable-winrt-midi-api", IDS_FLAGS_DISABLE_WINRT_MIDI_API_NAME, | 2019 {"disable-winrt-midi-api", IDS_FLAGS_DISABLE_WINRT_MIDI_API_NAME, |
| 2020 IDS_FLAGS_DISABLE_WINRT_MIDI_API_DESCRIPTION, kOsWin, | 2020 IDS_FLAGS_DISABLE_WINRT_MIDI_API_DESCRIPTION, kOsWin, |
| 2021 SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWinrtMidiApi)}, | 2021 SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWinrtMidiApi)}, |
| 2022 #endif // OS_WIN | 2022 #endif // OS_WIN |
| 2023 {"saveas-menu-text-experiment", IDS_FLAGS_SAVEAS_MENU_LABEL_EXPERIMENT_NAME, | 2023 {"saveas-menu-text-experiment", IDS_FLAGS_SAVEAS_MENU_LABEL_EXPERIMENT_NAME, |
| 2024 IDS_FLAGS_SAVEAS_MENU_LABEL_EXPERIMENT_DESCRIPTION, kOsDesktop, | 2024 IDS_FLAGS_SAVEAS_MENU_LABEL_EXPERIMENT_DESCRIPTION, kOsDesktop, |
| 2025 SINGLE_VALUE_TYPE(switches::kEnableSaveAsMenuLabelExperiment)}, | 2025 SINGLE_VALUE_TYPE(switches::kEnableSaveAsMenuLabelExperiment)}, |
| 2026 {"enable-generic-sensor", IDS_FLAGS_ENABLE_GENERIC_SENSOR_NAME, | 2026 {"enable-generic-sensor", IDS_FLAGS_ENABLE_GENERIC_SENSOR_NAME, |
| 2027 IDS_FLAGS_ENABLE_GENERIC_SENSOR_DESCRIPTION, kOsAndroid | kOsMac, | 2027 IDS_FLAGS_ENABLE_GENERIC_SENSOR_DESCRIPTION, kOsAndroid | kOsMac, |
| 2028 FEATURE_VALUE_TYPE(features::kGenericSensor)}, | 2028 FEATURE_VALUE_TYPE(features::kGenericSensor)}, |
| 2029 {"expensive-background-timer-throttling", | 2029 {"expensive-background-timer-throttling", |
| 2030 IDS_FLAGS_EXPENSIVE_BACKGROUND_TIMER_THROTTLING_NAME, | 2030 IDS_FLAGS_EXPENSIVE_BACKGROUND_TIMER_THROTTLING_NAME, |
| 2031 IDS_FLAGS_EXPENSIVE_BACKGROUND_TIMER_THROTTLING_DESCRIPTION, kOsAll, | 2031 IDS_FLAGS_EXPENSIVE_BACKGROUND_TIMER_THROTTLING_DESCRIPTION, kOsAll, |
| 2032 FEATURE_VALUE_TYPE(features::kExpensiveBackgroundTimerThrottling)}, | 2032 FEATURE_VALUE_TYPE(features::kExpensiveBackgroundTimerThrottling)}, |
| 2033 {"security-chip", IDS_FLAGS_SECURITY_CHIP_NAME, |
| 2034 IDS_FLAGS_SECURITY_CHIP_DESCRIPTION, kOsDesktop, |
| 2035 MULTI_VALUE_TYPE(kSecurityChipChoices)}, |
| 2036 {"security-chip-animation", IDS_FLAGS_SECURITY_CHIP_ANIMATION_NAME, |
| 2037 IDS_FLAGS_SECURITY_CHIP_ANIMATION_DESCRIPTION, kOsDesktop, |
| 2038 MULTI_VALUE_TYPE(kSecurityChipAnimationChoices)}, |
| 2033 // NOTE: Adding new command-line switches requires adding corresponding | 2039 // NOTE: Adding new command-line switches requires adding corresponding |
| 2034 // entries to enum "LoginCustomFlags" in histograms.xml. See note in | 2040 // entries to enum "LoginCustomFlags" in histograms.xml. See note in |
| 2035 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. | 2041 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. |
| 2036 }; | 2042 }; |
| 2037 | 2043 |
| 2038 class FlagsStateSingleton { | 2044 class FlagsStateSingleton { |
| 2039 public: | 2045 public: |
| 2040 FlagsStateSingleton() | 2046 FlagsStateSingleton() |
| 2041 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} | 2047 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} |
| 2042 ~FlagsStateSingleton() {} | 2048 ~FlagsStateSingleton() {} |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2231 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; | 2237 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; |
| 2232 | 2238 |
| 2233 const FeatureEntry* GetFeatureEntries(size_t* count) { | 2239 const FeatureEntry* GetFeatureEntries(size_t* count) { |
| 2234 *count = arraysize(kFeatureEntries); | 2240 *count = arraysize(kFeatureEntries); |
| 2235 return kFeatureEntries; | 2241 return kFeatureEntries; |
| 2236 } | 2242 } |
| 2237 | 2243 |
| 2238 } // namespace testing | 2244 } // namespace testing |
| 2239 | 2245 |
| 2240 } // namespace about_flags | 2246 } // namespace about_flags |
| OLD | NEW |