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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 {IDS_FLAGS_WEBRTC_HW_ENCODING_ALL, switches::kDisableWebRtcHWEncoding, ""}, | 606 {IDS_FLAGS_WEBRTC_HW_ENCODING_ALL, switches::kDisableWebRtcHWEncoding, ""}, |
607 {IDS_FLAGS_WEBRTC_HW_ENCODING_VPX, switches::kDisableWebRtcHWEncoding, | 607 {IDS_FLAGS_WEBRTC_HW_ENCODING_VPX, switches::kDisableWebRtcHWEncoding, |
608 switches::kDisableWebRtcHWEncodingVPx}, | 608 switches::kDisableWebRtcHWEncodingVPx}, |
609 {IDS_FLAGS_WEBRTC_HW_ENCODING_H264, switches::kDisableWebRtcHWEncoding, | 609 {IDS_FLAGS_WEBRTC_HW_ENCODING_H264, switches::kDisableWebRtcHWEncoding, |
610 switches::kDisableWebRtcHWEncodingH264}, | 610 switches::kDisableWebRtcHWEncodingH264}, |
611 {IDS_FLAGS_WEBRTC_HW_ENCODING_NONE, switches::kDisableWebRtcHWEncoding, | 611 {IDS_FLAGS_WEBRTC_HW_ENCODING_NONE, switches::kDisableWebRtcHWEncoding, |
612 switches::kDisableWebRtcHWEncodingNone}, | 612 switches::kDisableWebRtcHWEncodingNone}, |
613 }; | 613 }; |
614 #endif | 614 #endif |
615 | 615 |
| 616 const FeatureEntry::Choice kEnableDefaultMediaSessionChoices[] = { |
| 617 {IDS_FLAGS_ENABLE_DEFAULT_MEDIA_SESSION_DISABLED, "", ""}, |
| 618 {IDS_FLAGS_ENABLE_DEFAULT_MEDIA_SESSION_ENABLED, |
| 619 switches::kEnableDefaultMediaSession, ""}, |
| 620 #if defined(ENABLE_PLUGINS) |
| 621 {IDS_FLAGS_ENABLE_DEFAULT_MEDIA_SESSION_ENABLED_WITH_FLASH, |
| 622 switches::kEnableDefaultMediaSession, |
| 623 switches::kEnableDefaultMediaSessionWithFlash}, |
| 624 #endif // defined(ENABLE_PLUGINS) |
| 625 }; |
| 626 |
616 // RECORDING USER METRICS FOR FLAGS: | 627 // RECORDING USER METRICS FOR FLAGS: |
617 // ----------------------------------------------------------------------------- | 628 // ----------------------------------------------------------------------------- |
618 // The first line of the entry is the internal name. | 629 // The first line of the entry is the internal name. |
619 // | 630 // |
620 // To add a new entry, add to the end of kFeatureEntries. There are two | 631 // To add a new entry, add to the end of kFeatureEntries. There are two |
621 // distinct types of entries: | 632 // distinct types of entries: |
622 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE | 633 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE |
623 // macro for this type supplying the command line to the macro. | 634 // macro for this type supplying the command line to the macro. |
624 // . MULTI_VALUE: a list of choices, the first of which should correspond to a | 635 // . MULTI_VALUE: a list of choices, the first of which should correspond to a |
625 // deactivated state for this lab (i.e. no command line option). To specify | 636 // deactivated state for this lab (i.e. no command line option). To specify |
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2035 {"saveas-menu-text-experiment", IDS_FLAGS_SAVEAS_MENU_LABEL_EXPERIMENT_NAME, | 2046 {"saveas-menu-text-experiment", IDS_FLAGS_SAVEAS_MENU_LABEL_EXPERIMENT_NAME, |
2036 IDS_FLAGS_SAVEAS_MENU_LABEL_EXPERIMENT_DESCRIPTION, kOsDesktop, | 2047 IDS_FLAGS_SAVEAS_MENU_LABEL_EXPERIMENT_DESCRIPTION, kOsDesktop, |
2037 SINGLE_VALUE_TYPE(switches::kEnableSaveAsMenuLabelExperiment)}, | 2048 SINGLE_VALUE_TYPE(switches::kEnableSaveAsMenuLabelExperiment)}, |
2038 {"enable-generic-sensor", IDS_FLAGS_ENABLE_GENERIC_SENSOR_NAME, | 2049 {"enable-generic-sensor", IDS_FLAGS_ENABLE_GENERIC_SENSOR_NAME, |
2039 IDS_FLAGS_ENABLE_GENERIC_SENSOR_DESCRIPTION, kOsAndroid | kOsMac, | 2050 IDS_FLAGS_ENABLE_GENERIC_SENSOR_DESCRIPTION, kOsAndroid | kOsMac, |
2040 FEATURE_VALUE_TYPE(features::kGenericSensor)}, | 2051 FEATURE_VALUE_TYPE(features::kGenericSensor)}, |
2041 {"expensive-background-timer-throttling", | 2052 {"expensive-background-timer-throttling", |
2042 IDS_FLAGS_EXPENSIVE_BACKGROUND_TIMER_THROTTLING_NAME, | 2053 IDS_FLAGS_EXPENSIVE_BACKGROUND_TIMER_THROTTLING_NAME, |
2043 IDS_FLAGS_EXPENSIVE_BACKGROUND_TIMER_THROTTLING_DESCRIPTION, kOsAll, | 2054 IDS_FLAGS_EXPENSIVE_BACKGROUND_TIMER_THROTTLING_DESCRIPTION, kOsAll, |
2044 FEATURE_VALUE_TYPE(features::kExpensiveBackgroundTimerThrottling)}, | 2055 FEATURE_VALUE_TYPE(features::kExpensiveBackgroundTimerThrottling)}, |
2045 {"security-chip", IDS_FLAGS_SECURITY_CHIP_NAME, | 2056 {"security-chip", IDS_FLAGS_SECURITY_CHIP_NAME, |
2046 IDS_FLAGS_SECURITY_CHIP_DESCRIPTION, kOsDesktop, | 2057 IDS_FLAGS_SECURITY_CHIP_DESCRIPTION, kOsDesktop, |
2047 MULTI_VALUE_TYPE(kSecurityChipChoices)}, | 2058 MULTI_VALUE_TYPE(kSecurityChipChoices)}, |
2048 {"security-chip-animation", IDS_FLAGS_SECURITY_CHIP_ANIMATION_NAME, | 2059 {"security-chip-animation", IDS_FLAGS_SECURITY_CHIP_ANIMATION_NAME, |
2049 IDS_FLAGS_SECURITY_CHIP_ANIMATION_DESCRIPTION, kOsDesktop, | 2060 IDS_FLAGS_SECURITY_CHIP_ANIMATION_DESCRIPTION, kOsDesktop, |
2050 MULTI_VALUE_TYPE(kSecurityChipAnimationChoices)}, | 2061 MULTI_VALUE_TYPE(kSecurityChipAnimationChoices)}, |
| 2062 {"enable-default-media-session", |
| 2063 IDS_FLAGS_ENABLE_DEFAULT_MEDIA_SESSION_NAME, |
| 2064 IDS_FLAGS_ENABLE_DEFAULT_MEDIA_SESSION_DESCRIPTION, kOsDesktop, |
| 2065 MULTI_VALUE_TYPE(kEnableDefaultMediaSessionChoices)}, |
2051 // NOTE: Adding new command-line switches requires adding corresponding | 2066 // NOTE: Adding new command-line switches requires adding corresponding |
2052 // entries to enum "LoginCustomFlags" in histograms.xml. See note in | 2067 // entries to enum "LoginCustomFlags" in histograms.xml. See note in |
2053 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. | 2068 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. |
2054 }; | 2069 }; |
2055 | 2070 |
2056 class FlagsStateSingleton { | 2071 class FlagsStateSingleton { |
2057 public: | 2072 public: |
2058 FlagsStateSingleton() | 2073 FlagsStateSingleton() |
2059 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} | 2074 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} |
2060 ~FlagsStateSingleton() {} | 2075 ~FlagsStateSingleton() {} |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2249 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; | 2264 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; |
2250 | 2265 |
2251 const FeatureEntry* GetFeatureEntries(size_t* count) { | 2266 const FeatureEntry* GetFeatureEntries(size_t* count) { |
2252 *count = arraysize(kFeatureEntries); | 2267 *count = arraysize(kFeatureEntries); |
2253 return kFeatureEntries; | 2268 return kFeatureEntries; |
2254 } | 2269 } |
2255 | 2270 |
2256 } // namespace testing | 2271 } // namespace testing |
2257 | 2272 |
2258 } // namespace about_flags | 2273 } // namespace about_flags |
OLD | NEW |