Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

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

Issue 2428873002: Add about_flag for experimenting MediaSession on Desktop (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_DEFAULT, "", ""}, 593 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_DEFAULT, "", ""},
594 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_NONE, switches::kSecurityChipAnimation, 594 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_NONE, switches::kSecurityChipAnimation,
595 switches::kSecurityChipAnimationNone}, 595 switches::kSecurityChipAnimationNone},
596 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_NONSECURE_ONLY, 596 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_NONSECURE_ONLY,
597 switches::kSecurityChipAnimation, 597 switches::kSecurityChipAnimation,
598 switches::kSecurityChipAnimationNonSecureOnly}, 598 switches::kSecurityChipAnimationNonSecureOnly},
599 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_ALL, switches::kSecurityChipAnimation, 599 {IDS_FLAGS_SECURITY_CHIP_ANIMATION_ALL, switches::kSecurityChipAnimation,
600 switches::kSecurityChipAnimationAll}, 600 switches::kSecurityChipAnimationAll},
601 }; 601 };
602 602
603 const FeatureEntry::Choice kEnableDefaultMediaSessionChoices[] = {
604 {IDS_FLAGS_ENABLE_DEFAULT_MEDIA_SESSION_DISABLED, "", ""},
605 {IDS_FLAGS_ENABLE_DEFAULT_MEDIA_SESSION_ENABLED,
606 switches::kEnableDefaultMediaSession, ""},
607 #if defined(ENABLE_PLUGINS)
608 {IDS_FLAGS_ENABLE_DEFAULT_MEDIA_SESSION_ENABLED_WITH_FLASH,
609 switches::kEnableDefaultMediaSession,
610 switches::kEnableDefaultMediaSessionWithFlash},
611 #endif // defined(ENABLE_PLUGINS)
612 };
613
603 // RECORDING USER METRICS FOR FLAGS: 614 // RECORDING USER METRICS FOR FLAGS:
604 // ----------------------------------------------------------------------------- 615 // -----------------------------------------------------------------------------
605 // The first line of the entry is the internal name. 616 // The first line of the entry is the internal name.
606 // 617 //
607 // To add a new entry, add to the end of kFeatureEntries. There are two 618 // To add a new entry, add to the end of kFeatureEntries. There are two
608 // distinct types of entries: 619 // distinct types of entries:
609 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE 620 // . SINGLE_VALUE: entry is either on or off. Use the SINGLE_VALUE_TYPE
610 // macro for this type supplying the command line to the macro. 621 // macro for this type supplying the command line to the macro.
611 // . MULTI_VALUE: a list of choices, the first of which should correspond to a 622 // . MULTI_VALUE: a list of choices, the first of which should correspond to a
612 // deactivated state for this lab (i.e. no command line option). To specify 623 // 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
2022 {"saveas-menu-text-experiment", IDS_FLAGS_SAVEAS_MENU_LABEL_EXPERIMENT_NAME, 2033 {"saveas-menu-text-experiment", IDS_FLAGS_SAVEAS_MENU_LABEL_EXPERIMENT_NAME,
2023 IDS_FLAGS_SAVEAS_MENU_LABEL_EXPERIMENT_DESCRIPTION, kOsDesktop, 2034 IDS_FLAGS_SAVEAS_MENU_LABEL_EXPERIMENT_DESCRIPTION, kOsDesktop,
2024 SINGLE_VALUE_TYPE(switches::kEnableSaveAsMenuLabelExperiment)}, 2035 SINGLE_VALUE_TYPE(switches::kEnableSaveAsMenuLabelExperiment)},
2025 {"enable-generic-sensor", IDS_FLAGS_ENABLE_GENERIC_SENSOR_NAME, 2036 {"enable-generic-sensor", IDS_FLAGS_ENABLE_GENERIC_SENSOR_NAME,
2026 IDS_FLAGS_ENABLE_GENERIC_SENSOR_DESCRIPTION, kOsAndroid | kOsMac, 2037 IDS_FLAGS_ENABLE_GENERIC_SENSOR_DESCRIPTION, kOsAndroid | kOsMac,
2027 FEATURE_VALUE_TYPE(features::kGenericSensor)}, 2038 FEATURE_VALUE_TYPE(features::kGenericSensor)},
2028 {"expensive-background-timer-throttling", 2039 {"expensive-background-timer-throttling",
2029 IDS_FLAGS_EXPENSIVE_BACKGROUND_TIMER_THROTTLING_NAME, 2040 IDS_FLAGS_EXPENSIVE_BACKGROUND_TIMER_THROTTLING_NAME,
2030 IDS_FLAGS_EXPENSIVE_BACKGROUND_TIMER_THROTTLING_DESCRIPTION, kOsAll, 2041 IDS_FLAGS_EXPENSIVE_BACKGROUND_TIMER_THROTTLING_DESCRIPTION, kOsAll,
2031 FEATURE_VALUE_TYPE(features::kExpensiveBackgroundTimerThrottling)}, 2042 FEATURE_VALUE_TYPE(features::kExpensiveBackgroundTimerThrottling)},
2032 {"security-chip", IDS_FLAGS_SECURITY_CHIP_NAME, 2043 {"security-chip", IDS_FLAGS_SECURITY_CHIP_NAME,
2033 IDS_FLAGS_SECURITY_CHIP_DESCRIPTION, kOsDesktop, 2044 IDS_FLAGS_SECURITY_CHIP_DESCRIPTION, kOsDesktop,
2034 MULTI_VALUE_TYPE(kSecurityChipChoices)}, 2045 MULTI_VALUE_TYPE(kSecurityChipChoices)},
2035 {"security-chip-animation", IDS_FLAGS_SECURITY_CHIP_ANIMATION_NAME, 2046 {"security-chip-animation", IDS_FLAGS_SECURITY_CHIP_ANIMATION_NAME,
2036 IDS_FLAGS_SECURITY_CHIP_ANIMATION_DESCRIPTION, kOsDesktop, 2047 IDS_FLAGS_SECURITY_CHIP_ANIMATION_DESCRIPTION, kOsDesktop,
2037 MULTI_VALUE_TYPE(kSecurityChipAnimationChoices)}, 2048 MULTI_VALUE_TYPE(kSecurityChipAnimationChoices)},
2049 {"enable-default-media-session",
2050 IDS_FLAGS_ENABLE_DEFAULT_MEDIA_SESSION_NAME,
2051 IDS_FLAGS_ENABLE_DEFAULT_MEDIA_SESSION_DESCRIPTION, kOsDesktop,
2052 MULTI_VALUE_TYPE(kEnableDefaultMediaSessionChoices)},
2038 // NOTE: Adding new command-line switches requires adding corresponding 2053 // NOTE: Adding new command-line switches requires adding corresponding
2039 // entries to enum "LoginCustomFlags" in histograms.xml. See note in 2054 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2040 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. 2055 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2041 }; 2056 };
2042 2057
2043 class FlagsStateSingleton { 2058 class FlagsStateSingleton {
2044 public: 2059 public:
2045 FlagsStateSingleton() 2060 FlagsStateSingleton()
2046 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} 2061 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {}
2047 ~FlagsStateSingleton() {} 2062 ~FlagsStateSingleton() {}
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2236 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 2251 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2237 2252
2238 const FeatureEntry* GetFeatureEntries(size_t* count) { 2253 const FeatureEntry* GetFeatureEntries(size_t* count) {
2239 *count = arraysize(kFeatureEntries); 2254 *count = arraysize(kFeatureEntries);
2240 return kFeatureEntries; 2255 return kFeatureEntries;
2241 } 2256 }
2242 2257
2243 } // namespace testing 2258 } // namespace testing
2244 2259
2245 } // namespace about_flags 2260 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698