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

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

Issue 2837023002: Create autoplay policy flag and merge cross-origin autoplay blocking into it. (Closed)
Patch Set: fix tests Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/flag_descriptions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 {flag_descriptions::kEnableDefaultMediaSessionEnabled, 699 {flag_descriptions::kEnableDefaultMediaSessionEnabled,
700 switches::kEnableDefaultMediaSession, ""}, 700 switches::kEnableDefaultMediaSession, ""},
701 #if BUILDFLAG(ENABLE_PLUGINS) 701 #if BUILDFLAG(ENABLE_PLUGINS)
702 {flag_descriptions::kEnableDefaultMediaSessionEnabledDuckFlash, 702 {flag_descriptions::kEnableDefaultMediaSessionEnabledDuckFlash,
703 switches::kEnableDefaultMediaSession, 703 switches::kEnableDefaultMediaSession,
704 switches::kEnableDefaultMediaSessionDuckFlash}, 704 switches::kEnableDefaultMediaSessionDuckFlash},
705 #endif // BUILDFLAG(ENABLE_PLUGINS) 705 #endif // BUILDFLAG(ENABLE_PLUGINS)
706 }; 706 };
707 #endif // !defined(OS_ANDROID) 707 #endif // !defined(OS_ANDROID)
708 708
709 const FeatureEntry::Choice kAutoplayPolicyChoices[] = {
710 {flags_ui::kGenericExperimentChoiceDefault, "", ""},
711 {flag_descriptions::kAutoplayPolicyNoUserGestureRequired,
712 switches::kAutoplayPolicy,
713 switches::autoplay::kNoUserGestureRequiredPolicy},
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
709 const FeatureEntry::FeatureParam kNoStatePrefetchEnabled[] = { 724 const FeatureEntry::FeatureParam kNoStatePrefetchEnabled[] = {
710 {prerender::kNoStatePrefetchFeatureModeParameterName, 725 {prerender::kNoStatePrefetchFeatureModeParameterName,
711 prerender::kNoStatePrefetchFeatureModeParameterPrefetch}}; 726 prerender::kNoStatePrefetchFeatureModeParameterPrefetch}};
712 727
713 const FeatureEntry::FeatureParam kNoStatePrefetchPrerender[] = { 728 const FeatureEntry::FeatureParam kNoStatePrefetchPrerender[] = {
714 {prerender::kNoStatePrefetchFeatureModeParameterName, 729 {prerender::kNoStatePrefetchFeatureModeParameterName,
715 prerender::kNoStatePrefetchFeatureModeParameterPrerender}}; 730 prerender::kNoStatePrefetchFeatureModeParameterPrerender}};
716 731
717 const FeatureEntry::FeatureParam kNoStatePrefetchSimpleLoad[] = { 732 const FeatureEntry::FeatureParam kNoStatePrefetchSimpleLoad[] = {
718 {prerender::kNoStatePrefetchFeatureModeParameterName, 733 {prerender::kNoStatePrefetchFeatureModeParameterName,
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 flag_descriptions::kDefaultTileWidthDescription, kOsAll, 1441 flag_descriptions::kDefaultTileWidthDescription, kOsAll,
1427 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)}, 1442 MULTI_VALUE_TYPE(kDefaultTileWidthChoices)},
1428 {"default-tile-height", flag_descriptions::kDefaultTileHeightName, 1443 {"default-tile-height", flag_descriptions::kDefaultTileHeightName,
1429 flag_descriptions::kDefaultTileHeightDescription, kOsAll, 1444 flag_descriptions::kDefaultTileHeightDescription, kOsAll,
1430 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)}, 1445 MULTI_VALUE_TYPE(kDefaultTileHeightChoices)},
1431 {"disable-gesture-requirement-for-media-playback", 1446 {"disable-gesture-requirement-for-media-playback",
1432 flag_descriptions::kGestureRequirementForMediaPlaybackName, 1447 flag_descriptions::kGestureRequirementForMediaPlaybackName,
1433 flag_descriptions::kGestureRequirementForMediaPlaybackDescription, kOsAll, 1448 flag_descriptions::kGestureRequirementForMediaPlaybackDescription, kOsAll,
1434 SINGLE_DISABLE_VALUE_TYPE( 1449 SINGLE_DISABLE_VALUE_TYPE(
1435 switches::kDisableGestureRequirementForMediaPlayback)}, 1450 switches::kDisableGestureRequirementForMediaPlayback)},
1436 #if !defined(OS_ANDROID)
1437 {"cross-origin-media-playback-requires-user-gesture",
1438 flag_descriptions::kCrossOriginMediaPlaybackRequiresUserGestureName,
1439 flag_descriptions::kCrossOriginMediaPlaybackRequiresUserGestureDescription,
1440 kOsDesktop,
1441 FEATURE_VALUE_TYPE(
1442 features::kCrossOriginMediaPlaybackRequiresUserGesture)},
1443 #endif // !defined(OS_ANDROID)
1444
1445 #if defined(OS_CHROMEOS) 1451 #if defined(OS_CHROMEOS)
1446 {"enable-virtual-keyboard", flag_descriptions::kVirtualKeyboardName, 1452 {"enable-virtual-keyboard", flag_descriptions::kVirtualKeyboardName,
1447 flag_descriptions::kVirtualKeyboardDescription, kOsCrOS, 1453 flag_descriptions::kVirtualKeyboardDescription, kOsCrOS,
1448 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)}, 1454 SINGLE_VALUE_TYPE(keyboard::switches::kEnableVirtualKeyboard)},
1449 {"virtual-keyboard-overscroll", 1455 {"virtual-keyboard-overscroll",
1450 flag_descriptions::kVirtualKeyboardOverscrollName, 1456 flag_descriptions::kVirtualKeyboardOverscrollName,
1451 flag_descriptions::kVirtualKeyboardOverscrollDescription, kOsCrOS, 1457 flag_descriptions::kVirtualKeyboardOverscrollDescription, kOsCrOS,
1452 SINGLE_DISABLE_VALUE_TYPE( 1458 SINGLE_DISABLE_VALUE_TYPE(
1453 keyboard::switches::kDisableVirtualKeyboardOverscroll)}, 1459 keyboard::switches::kDisableVirtualKeyboardOverscroll)},
1454 {"input-view", flag_descriptions::kInputViewName, 1460 {"input-view", flag_descriptions::kInputViewName,
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
2752 flag_descriptions::kEnableIdleTimeSpellCheckingDescription, kOsAll, 2758 flag_descriptions::kEnableIdleTimeSpellCheckingDescription, kOsAll,
2753 FEATURE_VALUE_TYPE(features::kIdleTimeSpellChecking)}, 2759 FEATURE_VALUE_TYPE(features::kIdleTimeSpellChecking)},
2754 2760
2755 #if defined(OS_ANDROID) 2761 #if defined(OS_ANDROID)
2756 {"enable-clipboard-provider", 2762 {"enable-clipboard-provider",
2757 flag_descriptions::kEnableOmniboxClipboardProviderName, 2763 flag_descriptions::kEnableOmniboxClipboardProviderName,
2758 flag_descriptions::kEnableOmniboxClipboardProviderDescription, kOsAndroid, 2764 flag_descriptions::kEnableOmniboxClipboardProviderDescription, kOsAndroid,
2759 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProvider)}, 2765 FEATURE_VALUE_TYPE(omnibox::kEnableClipboardProvider)},
2760 #endif 2766 #endif
2761 2767
2768 {"autoplay-policy", flag_descriptions::kAutoplayPolicyName,
2769 flag_descriptions::kAutoplayPolicyDescription, kOsAll,
2770 MULTI_VALUE_TYPE(kAutoplayPolicyChoices)},
2771
2762 // NOTE: Adding new command-line switches requires adding corresponding 2772 // NOTE: Adding new command-line switches requires adding corresponding
2763 // entries to enum "LoginCustomFlags" in histograms.xml. See note in 2773 // entries to enum "LoginCustomFlags" in histograms.xml. See note in
2764 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test. 2774 // histograms.xml and don't forget to run AboutFlagsHistogramTest unit test.
2765 }; 2775 };
2766 2776
2767 class FlagsStateSingleton { 2777 class FlagsStateSingleton {
2768 public: 2778 public:
2769 FlagsStateSingleton() 2779 FlagsStateSingleton()
2770 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {} 2780 : flags_state_(kFeatureEntries, arraysize(kFeatureEntries)) {}
2771 ~FlagsStateSingleton() {} 2781 ~FlagsStateSingleton() {}
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2968 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; 2978 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0;
2969 2979
2970 const FeatureEntry* GetFeatureEntries(size_t* count) { 2980 const FeatureEntry* GetFeatureEntries(size_t* count) {
2971 *count = arraysize(kFeatureEntries); 2981 *count = arraysize(kFeatureEntries);
2972 return kFeatureEntries; 2982 return kFeatureEntries;
2973 } 2983 }
2974 2984
2975 } // namespace testing 2985 } // namespace testing
2976 2986
2977 } // namespace about_flags 2987 } // namespace about_flags
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/flag_descriptions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698