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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 {flag_descriptions::kEnableDefaultMediaSessionEnabled, | 700 {flag_descriptions::kEnableDefaultMediaSessionEnabled, |
701 switches::kEnableDefaultMediaSession, ""}, | 701 switches::kEnableDefaultMediaSession, ""}, |
702 #if BUILDFLAG(ENABLE_PLUGINS) | 702 #if BUILDFLAG(ENABLE_PLUGINS) |
703 {flag_descriptions::kEnableDefaultMediaSessionEnabledDuckFlash, | 703 {flag_descriptions::kEnableDefaultMediaSessionEnabledDuckFlash, |
704 switches::kEnableDefaultMediaSession, | 704 switches::kEnableDefaultMediaSession, |
705 switches::kEnableDefaultMediaSessionDuckFlash}, | 705 switches::kEnableDefaultMediaSessionDuckFlash}, |
706 #endif // BUILDFLAG(ENABLE_PLUGINS) | 706 #endif // BUILDFLAG(ENABLE_PLUGINS) |
707 }; | 707 }; |
708 #endif // !defined(OS_ANDROID) | 708 #endif // !defined(OS_ANDROID) |
709 | 709 |
| 710 const FeatureEntry::Choice kAutoplayPolicyChoices[] = { |
| 711 {flags_ui::kGenericExperimentChoiceDefault, "", ""}, |
| 712 {flag_descriptions::kAutoplayPolicyNoRestrictions, |
| 713 switches::kAutoplayPolicy, switches::autoplay::kNoRestrictionsPolicy}, |
| 714 #if defined(OS_ANDROID) |
| 715 {flag_descriptions::kAutoplayPolicyUserGestureRequired, |
| 716 switches::kAutoplayPolicy, switches::autoplay::kUserGestureRequiredPolicy}, |
| 717 #else |
| 718 {flag_descriptions::kAutoplayPolicyCrossOriginUserGestureRequired, |
| 719 switches::kAutoplayPolicy, |
| 720 switches::autoplay::kCrossOriginUserGestureRequiredPolicy}, |
| 721 #endif |
| 722 }; |
| 723 |
710 const FeatureEntry::FeatureParam kNoStatePrefetchEnabled[] = { | 724 const FeatureEntry::FeatureParam kNoStatePrefetchEnabled[] = { |
711 {prerender::kNoStatePrefetchFeatureModeParameterName, | 725 {prerender::kNoStatePrefetchFeatureModeParameterName, |
712 prerender::kNoStatePrefetchFeatureModeParameterPrefetch}}; | 726 prerender::kNoStatePrefetchFeatureModeParameterPrefetch}}; |
713 | 727 |
714 const FeatureEntry::FeatureParam kNoStatePrefetchPrerender[] = { | 728 const FeatureEntry::FeatureParam kNoStatePrefetchPrerender[] = { |
715 {prerender::kNoStatePrefetchFeatureModeParameterName, | 729 {prerender::kNoStatePrefetchFeatureModeParameterName, |
716 prerender::kNoStatePrefetchFeatureModeParameterPrerender}}; | 730 prerender::kNoStatePrefetchFeatureModeParameterPrerender}}; |
717 | 731 |
718 const FeatureEntry::FeatureParam kNoStatePrefetchSimpleLoad[] = { | 732 const FeatureEntry::FeatureParam kNoStatePrefetchSimpleLoad[] = { |
719 {prerender::kNoStatePrefetchFeatureModeParameterName, | 733 {prerender::kNoStatePrefetchFeatureModeParameterName, |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1427 flag_descriptions::kDefaultTileWidthDescription, kOsAll, | 1441 flag_descriptions::kDefaultTileWidthDescription, kOsAll, |
1428 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)}, | 1442 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)}, |
1429 {"default-tile-height", flag_descriptions::kDefaultTileHeightName, | 1443 {"default-tile-height", flag_descriptions::kDefaultTileHeightName, |
1430 flag_descriptions::kDefaultTileHeightDescription, kOsAll, | 1444 flag_descriptions::kDefaultTileHeightDescription, kOsAll, |
1431 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)}, | 1445 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)}, |
1432 {"disable-gesture-requirement-for-media-playback", | 1446 {"disable-gesture-requirement-for-media-playback", |
1433 flag_descriptions::kGestureRequirementForMediaPlaybackName, | 1447 flag_descriptions::kGestureRequirementForMediaPlaybackName, |
1434 flag_descriptions::kGestureRequirementForMediaPlaybackDescription, kOsAll, | 1448 flag_descriptions::kGestureRequirementForMediaPlaybackDescription, kOsAll, |
1435 SINGLE_DISABLE_VALUE_TYPE( | 1449 SINGLE_DISABLE_VALUE_TYPE( |
1436 switches::kDisableGestureRequirementForMediaPlayback)}, | 1450 switches::kDisableGestureRequirementForMediaPlayback)}, |
1437 #if !defined(OS_ANDROID) | |
1438 {"cross-origin-media-playback-requires-user-gesture", | |
1439 flag_descriptions::kCrossOriginMediaPlaybackRequiresUserGestureName, | |
1440 flag_descriptions::kCrossOriginMediaPlaybackRequiresUserGestureDescription, | |
1441 kOsDesktop, | |
1442 FEATURE_VALUE_TYPE( | |
1443 features::kCrossOriginMediaPlaybackRequiresUserGesture)}, | |
1444 #endif // !defined(OS_ANDROID) | |
1445 | |
1446 #if defined(OS_CHROMEOS) | 1451 #if defined(OS_CHROMEOS) |
1447 {"enable-virtual-keyboard", flag_descriptions::kVirtualKeyboardName, | 1452 {"enable-virtual-keyboard", flag_descriptions::kVirtualKeyboardName, |
1448 flag_descriptions::kVirtualKeyboardDescription, kOsCrOS, | 1453 flag_descriptions::kVirtualKeyboardDescription, kOsCrOS, |
1449 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)}, | 1454 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)}, |
1450 {"virtual-keyboard-overscroll", | 1455 {"virtual-keyboard-overscroll", |
1451 flag_descriptions::kVirtualKeyboardOverscrollName, | 1456 flag_descriptions::kVirtualKeyboardOverscrollName, |
1452 flag_descriptions::kVirtualKeyboardOverscrollDescription, kOsCrOS, | 1457 flag_descriptions::kVirtualKeyboardOverscrollDescription, kOsCrOS, |
1453 SINGLE_DISABLE_VALUE_TYPE( | 1458 SINGLE_DISABLE_VALUE_TYPE( |
1454 keyboard::switches::kDisableVirtualKeyboardOverscroll)}, | 1459 keyboard::switches::kDisableVirtualKeyboardOverscroll)}, |
1455 {"input-view", flag_descriptions::kInputViewName, | 1460 {"input-view", flag_descriptions::kInputViewName, |
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2746 {"enable-webnfc", flag_descriptions::kEnableWebNfcName, | 2751 {"enable-webnfc", flag_descriptions::kEnableWebNfcName, |
2747 flag_descriptions::kEnableWebNfcDescription, kOsAndroid, | 2752 flag_descriptions::kEnableWebNfcDescription, kOsAndroid, |
2748 FEATURE_VALUE_TYPE(features::kWebNfc)}, | 2753 FEATURE_VALUE_TYPE(features::kWebNfc)}, |
2749 #endif | 2754 #endif |
2750 | 2755 |
2751 {"enable-idle-time-spell-checking", | 2756 {"enable-idle-time-spell-checking", |
2752 flag_descriptions::kEnableIdleTimeSpellCheckingName, | 2757 flag_descriptions::kEnableIdleTimeSpellCheckingName, |
2753 flag_descriptions::kEnableIdleTimeSpellCheckingDescription, kOsAll, | 2758 flag_descriptions::kEnableIdleTimeSpellCheckingDescription, kOsAll, |
2754 FEATURE_VALUE_TYPE(features::kIdleTimeSpellChecking)}, | 2759 FEATURE_VALUE_TYPE(features::kIdleTimeSpellChecking)}, |
2755 | 2760 |
| 2761 {"autoplay-policy", flag_descriptions::kAutoplayPolicyName, |
| 2762 flag_descriptions::kAutoplayPolicyDescription, kOsAll, |
| 2763 MULTI_VALUE_TYPE(kAutoplayPolicyChoices)}, |
| 2764 |
2756 // NOTE: Adding new command-line switches requires adding corresponding | 2765 // NOTE: Adding new command-line switches requires adding corresponding |
2757 // entries to enum "LoginCustomFlags" in histograms.xml. See note in | 2766 // entries to enum "LoginCustomFlags" in histograms.xml. See note in |
2758 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. | 2767 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. |
2759 }; | 2768 }; |
2760 | 2769 |
2761 class FlagsStateSingleton { | 2770 class FlagsStateSingleton { |
2762 public: | 2771 public: |
2763 FlagsStateSingleton() | 2772 FlagsStateSingleton() |
2764 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} | 2773 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} |
2765 ~FlagsStateSingleton() {} | 2774 ~FlagsStateSingleton() {} |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2962 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; | 2971 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; |
2963 | 2972 |
2964 const FeatureEntry* GetFeatureEntries(size_t* count) { | 2973 const FeatureEntry* GetFeatureEntries(size_t* count) { |
2965 *count = arraysize(kFeatureEntries); | 2974 *count = arraysize(kFeatureEntries); |
2966 return kFeatureEntries; | 2975 return kFeatureEntries; |
2967 } | 2976 } |
2968 | 2977 |
2969 } // namespace testing | 2978 } // namespace testing |
2970 | 2979 |
2971 } // namespace about_flags | 2980 } // namespace about_flags |
OLD | NEW |