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

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 1850903002: Enable user gesture requirement for autoplay experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased. Created 4 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 | « third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index 8beea08cbcdda8e7b55f8d57890f68315abf9bed..afcea26b5abf13f34f7beed38feb0d64132182b2 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -441,8 +441,12 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement(%p)", this);
- if (document.settings() && document.settings()->mediaPlaybackRequiresUserGesture())
+ // If any experiment is enabled, then we want to enable a user gesture by
+ // default, otherwise the experiment does nothing.
+ if ((document.settings() && document.settings()->mediaPlaybackRequiresUserGesture())
+ || m_autoplayHelper->isExperimentEnabled()) {
m_userGestureRequiredForPlay = true;
+ }
setHasCustomStyleCallbacks();
addElementToDocumentMap(this, &document);
« no previous file with comments | « third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698