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

Unified Diff: content/child/runtime_features.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/public/common/content_features.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/runtime_features.cc
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
index ab8970952844ceb7d591792a01e32ebcf13ed779..f22e021185df813815ae2f957a358487fb1e4760 100644
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -15,6 +15,7 @@
#include "content/common/content_switches_internal.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
+#include "media/base/media_switches.h"
#include "services/device/public/cpp/device_features.h"
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "ui/gl/gl_switches.h"
@@ -49,10 +50,6 @@ static void SetRuntimeFeatureDefaultsForPlatform() {
WebRuntimeFeatures::EnableMediaControlsOverlayPlayButton(true);
#else // defined(OS_ANDROID)
WebRuntimeFeatures::EnableNavigatorContentUtils(true);
- if (base::FeatureList::IsEnabled(
- features::kCrossOriginMediaPlaybackRequiresUserGesture)) {
- WebRuntimeFeatures::EnableAutoplayMutedVideos(true);
- }
#endif // defined(OS_ANDROID)
#if defined(OS_ANDROID) || defined(USE_AURA)
@@ -383,6 +380,13 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (base::FeatureList::IsEnabled(features::kIdleTimeSpellChecking))
WebRuntimeFeatures::EnableFeatureFromString("IdleTimeSpellChecking", true);
+#if !defined(OS_ANDROID)
+ if (command_line.GetSwitchValueASCII(switches::kAutoplayPolicy) ==
+ switches::autoplay::kCrossOriginUserGestureRequiredPolicy) {
+ WebRuntimeFeatures::EnableAutoplayMutedVideos(true);
+ }
+#endif
+
// Enable explicitly enabled features, and then disable explicitly disabled
// ones.
if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) {
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/public/common/content_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698