| 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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 switches::kEnableWebFontsInterventionV2, | 637 switches::kEnableWebFontsInterventionV2, |
| 638 switches::kEnableWebFontsInterventionV2SwitchValueDisabled}, | 638 switches::kEnableWebFontsInterventionV2SwitchValueDisabled}, |
| 639 }; | 639 }; |
| 640 | 640 |
| 641 const FeatureEntry::Choice kSSLVersionMaxChoices[] = { | 641 const FeatureEntry::Choice kSSLVersionMaxChoices[] = { |
| 642 {IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, | 642 {IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 643 {IDS_FLAGS_SSL_VERSION_MAX_TLS12, switches::kSSLVersionMax, "tls1.2"}, | 643 {IDS_FLAGS_SSL_VERSION_MAX_TLS12, switches::kSSLVersionMax, "tls1.2"}, |
| 644 {IDS_FLAGS_SSL_VERSION_MAX_TLS13, switches::kSSLVersionMax, "tls1.3"}, | 644 {IDS_FLAGS_SSL_VERSION_MAX_TLS13, switches::kSSLVersionMax, "tls1.3"}, |
| 645 }; | 645 }; |
| 646 | 646 |
| 647 const FeatureEntry::Choice kSecurityVerboseChoices[] = { | 647 const FeatureEntry::Choice kSecurityChipChoices[] = { |
| 648 {IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_DEFAULT, "", ""}, | 648 {IDS_FLAGS_SECURITY_CHIP_DEFAULT, "", ""}, |
| 649 {IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_SHOW_ALL_ANIMATED, | 649 {IDS_FLAGS_SECURITY_CHIP_SHOW_NONSECURE_ONLY, switches::kSecurityChip, |
| 650 switches::kMaterialSecurityVerbose, | 650 switches::kSecurityChipShowNonSecureOnly}, |
| 651 switches::kMaterialSecurityVerboseShowAllAnimated}, | 651 {IDS_FLAGS_SECURITY_CHIP_SHOW_ALL, switches::kSecurityChip, |
| 652 {IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_SHOW_ALL_NONANIMATED, | 652 switches::kSecurityChipShowAll}, |
| 653 switches::kMaterialSecurityVerbose, | 653 }; |
| 654 switches::kMaterialSecurityVerboseShowAllNonAnimated}, | 654 |
| 655 {IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_SHOW_NONSECURE_ANIMATED, | 655 const FeatureEntry::Choice kSecurityChipAnimationChoices[] = { |
| 656 switches::kMaterialSecurityVerbose, | 656 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_DEFAULT, "", ""}, |
| 657 switches::kMaterialSecurityVerboseShowNonSecureAnimated}, | 657 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_NONE, switches::kSecurityChipAnimation, |
| 658 {IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_SHOW_NONSECURE_NONANIMATED, | 658 switches::kSecurityChipAnimationNone}, |
| 659 switches::kMaterialSecurityVerbose, | 659 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_NONSECURE_ONLY, |
| 660 switches::kMaterialSecurityVerboseShowNonSecureNonAnimated}, | 660 switches::kSecurityChipAnimation, |
| 661 switches::kSecurityChipAnimationNonSecureOnly}, |
| 662 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_ALL, switches::kSecurityChipAnimation, |
| 663 switches::kSecurityChipAnimationAll}, |
| 661 }; | 664 }; |
| 662 | 665 |
| 663 // RECORDING USER METRICS FOR FLAGS: | 666 // RECORDING USER METRICS FOR FLAGS: |
| 664 // ----------------------------------------------------------------------------- | 667 // ----------------------------------------------------------------------------- |
| 665 // The first line of the entry is the internal name. | 668 // The first line of the entry is the internal name. |
| 666 // | 669 // |
| 667 // To add a new entry, add to the end of kFeatureEntries. There are two | 670 // To add a new entry, add to the end of kFeatureEntries. There are two |
| 668 // distinct types of entries: | 671 // distinct types of entries: |
| 669 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE | 672 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE |
| 670 // macro for this type supplying the command line to the macro. | 673 // macro for this type supplying the command line to the macro. |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1555 IDS_FLAGS_RESOLVE_TIMEZONE_BY_GEOLOCATION_NAME, | 1558 IDS_FLAGS_RESOLVE_TIMEZONE_BY_GEOLOCATION_NAME, |
| 1556 IDS_FLAGS_RESOLVE_TIMEZONE_BY_GEOLOCATION_DESCRIPTION, kOsCrOS, | 1559 IDS_FLAGS_RESOLVE_TIMEZONE_BY_GEOLOCATION_DESCRIPTION, kOsCrOS, |
| 1557 SINGLE_DISABLE_VALUE_TYPE( | 1560 SINGLE_DISABLE_VALUE_TYPE( |
| 1558 chromeos::switches::kDisableTimeZoneTrackingOption)}, | 1561 chromeos::switches::kDisableTimeZoneTrackingOption)}, |
| 1559 #endif // OS_CHROMEOS | 1562 #endif // OS_CHROMEOS |
| 1560 {"data-reduction-proxy-lo-fi", IDS_FLAGS_DATA_REDUCTION_PROXY_LO_FI_NAME, | 1563 {"data-reduction-proxy-lo-fi", IDS_FLAGS_DATA_REDUCTION_PROXY_LO_FI_NAME, |
| 1561 IDS_FLAGS_DATA_REDUCTION_PROXY_LO_FI_DESCRIPTION, kOsAll, | 1564 IDS_FLAGS_DATA_REDUCTION_PROXY_LO_FI_DESCRIPTION, kOsAll, |
| 1562 MULTI_VALUE_TYPE(kDataReductionProxyLoFiChoices)}, | 1565 MULTI_VALUE_TYPE(kDataReductionProxyLoFiChoices)}, |
| 1563 {"enable-data-reduction-proxy-lite-page", | 1566 {"enable-data-reduction-proxy-lite-page", |
| 1564 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LITE_PAGE_NAME, | 1567 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LITE_PAGE_NAME, |
| 1565 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LITE_PAGE_DESCRIPTION, | 1568 IDS_FLAGS_ENABLE_DATA_REDUCTION_PROXY_LITE_PAGE_DESCRIPTION, kOsAll, |
| 1566 kOsAll, SINGLE_VALUE_TYPE(data_reduction_proxy::switches:: | 1569 SINGLE_VALUE_TYPE( |
| 1567 kEnableDataReductionProxyLitePage)}, | 1570 data_reduction_proxy::switches::kEnableDataReductionProxyLitePage)}, |
| 1568 {"clear-data-reduction-proxy-data-savings", | 1571 {"clear-data-reduction-proxy-data-savings", |
| 1569 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_NAME, | 1572 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_NAME, |
| 1570 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_DESCRIPTION, kOsAll, | 1573 IDS_FLAGS_DATA_REDUCTION_PROXY_RESET_SAVINGS_DESCRIPTION, kOsAll, |
| 1571 SINGLE_VALUE_TYPE( | 1574 SINGLE_VALUE_TYPE( |
| 1572 data_reduction_proxy::switches::kClearDataReductionProxyDataSavings)}, | 1575 data_reduction_proxy::switches::kClearDataReductionProxyDataSavings)}, |
| 1573 {"allow-insecure-localhost", IDS_ALLOW_INSECURE_LOCALHOST, | 1576 {"allow-insecure-localhost", IDS_ALLOW_INSECURE_LOCALHOST, |
| 1574 IDS_ALLOW_INSECURE_LOCALHOST_DESCRIPTION, kOsAll, | 1577 IDS_ALLOW_INSECURE_LOCALHOST_DESCRIPTION, kOsAll, |
| 1575 SINGLE_VALUE_TYPE(switches::kAllowInsecureLocalhost)}, | 1578 SINGLE_VALUE_TYPE(switches::kAllowInsecureLocalhost)}, |
| 1576 {"enable-add-to-shelf", IDS_FLAGS_ADD_TO_SHELF_NAME, | 1579 {"enable-add-to-shelf", IDS_FLAGS_ADD_TO_SHELF_NAME, |
| 1577 IDS_FLAGS_ADD_TO_SHELF_DESCRIPTION, kOsDesktop, | 1580 IDS_FLAGS_ADD_TO_SHELF_DESCRIPTION, kOsDesktop, |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2096 IDS_FLAGS_GAMEPAD_EXTENSIONS_DESCRIPTION, kOsAll, | 2099 IDS_FLAGS_GAMEPAD_EXTENSIONS_DESCRIPTION, kOsAll, |
| 2097 FEATURE_VALUE_TYPE(features::kGamepadExtensions)}, | 2100 FEATURE_VALUE_TYPE(features::kGamepadExtensions)}, |
| 2098 #if defined(OS_CHROMEOS) | 2101 #if defined(OS_CHROMEOS) |
| 2099 {"arc-use-auth-endpoint", IDS_FLAGS_ARC_USE_AUTH_ENDPOINT_NAME, | 2102 {"arc-use-auth-endpoint", IDS_FLAGS_ARC_USE_AUTH_ENDPOINT_NAME, |
| 2100 IDS_FLAGS_ARC_USE_AUTH_ENDPOINT_DESCRIPTION, kOsCrOS, | 2103 IDS_FLAGS_ARC_USE_AUTH_ENDPOINT_DESCRIPTION, kOsCrOS, |
| 2101 SINGLE_VALUE_TYPE_AND_VALUE( | 2104 SINGLE_VALUE_TYPE_AND_VALUE( |
| 2102 chromeos::switches::kArcUseAuthEndpoint, | 2105 chromeos::switches::kArcUseAuthEndpoint, |
| 2103 "https://www-googleapis-staging.sandbox.google.com/oauth2/v4/" | 2106 "https://www-googleapis-staging.sandbox.google.com/oauth2/v4/" |
| 2104 "ExchangeToken")}, | 2107 "ExchangeToken")}, |
| 2105 #endif // OS_CHROMEOS | 2108 #endif // OS_CHROMEOS |
| 2106 {"material-security-verbose", IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_NAME, | 2109 {"security-chip", IDS_FLAGS_SECURITY_CHIP_NAME, |
| 2107 IDS_FLAGS_MATERIAL_SECURITY_VERBOSE_DESCRIPTION, kOsDesktop, | 2110 IDS_FLAGS_SECURITY_CHIP_DESCRIPTION, kOsDesktop, |
| 2108 MULTI_VALUE_TYPE(kSecurityVerboseChoices)}, | 2111 MULTI_VALUE_TYPE(kSecurityChipChoices)}, |
| 2112 {"security-chip-animation", IDS_FLAGS_SECURITY_CHIP_ANIMATION_NAME, |
| 2113 IDS_FLAGS_SECURITY_CHIP_ANIMATION_DESCRIPTION, kOsDesktop, |
| 2114 MULTI_VALUE_TYPE(kSecurityChipAnimationChoices)}, |
| 2109 // NOTE: Adding new command-line switches requires adding corresponding | 2115 // NOTE: Adding new command-line switches requires adding corresponding |
| 2110 // entries to enum "LoginCustomFlags" in histograms.xml. See note in | 2116 // entries to enum "LoginCustomFlags" in histograms.xml. See note in |
| 2111 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. | 2117 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. |
| 2112 }; | 2118 }; |
| 2113 | 2119 |
| 2114 class FlagsStateSingleton { | 2120 class FlagsStateSingleton { |
| 2115 public: | 2121 public: |
| 2116 FlagsStateSingleton() | 2122 FlagsStateSingleton() |
| 2117 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} | 2123 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} |
| 2118 ~FlagsStateSingleton() {} | 2124 ~FlagsStateSingleton() {} |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2307 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; | 2313 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; |
| 2308 | 2314 |
| 2309 const FeatureEntry* GetFeatureEntries(size_t* count) { | 2315 const FeatureEntry* GetFeatureEntries(size_t* count) { |
| 2310 *count = arraysize(kFeatureEntries); | 2316 *count = arraysize(kFeatureEntries); |
| 2311 return kFeatureEntries; | 2317 return kFeatureEntries; |
| 2312 } | 2318 } |
| 2313 | 2319 |
| 2314 } // namespace testing | 2320 } // namespace testing |
| 2315 | 2321 |
| 2316 } // namespace about_flags | 2322 } // namespace about_flags |
| OLD | NEW |