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

Unified Diff: content/browser/renderer_host/render_view_host_impl.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_process_host_impl.cc ('k') | content/child/runtime_features.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index ba2cd466fac859fa0d813af358d4637fbb16d2d9..db981b63dbf96e5b1ed0ecef3245acdfa099c79e 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -439,16 +439,19 @@ WebPreferences RenderViewHostImpl::ComputeWebkitPrefs() {
// On Android, user gestures are normally required, unless that requirement
// is disabled with a command-line switch or the equivalent field trial is
// is set to "Enabled".
- prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch(
- switches::kDisableGestureRequirementForMediaPlayback);
+ prefs.user_gesture_required_for_media_playback =
+ !command_line.HasSwitch(
+ switches::kDisableGestureRequirementForMediaPlayback) &&
+ command_line.GetSwitchValueASCII(switches::kAutoplayPolicy) !=
+ switches::autoplay::kNoUserGestureRequiredPolicy;
prefs.progress_bar_completion = GetProgressBarCompletionPolicy();
prefs.use_solid_color_scrollbars = true;
#else // defined(OS_ANDROID)
prefs.cross_origin_media_playback_requires_user_gesture =
- base::FeatureList::GetInstance()->IsEnabled(
- features::kCrossOriginMediaPlaybackRequiresUserGesture);
+ command_line.GetSwitchValueASCII(switches::kAutoplayPolicy) ==
+ switches::autoplay::kCrossOriginUserGestureRequiredPolicy;
#endif // defined(OS_ANDROID)
const std::string touch_enabled_switch =
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/child/runtime_features.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698