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

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

Issue 144663006: Remove the user gesture restriction for HTMLMediaElement::load() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: keep removeBehaviorsRestrictionsAfterFirstUserGesture() Created 6 years, 10 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 | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 27582a4472f0a3fb9c1148a5b579b22293ac332f..a7a101e20cf6f196a68de024d6b0d6b2e47470bc 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -296,7 +296,6 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
, m_sentEndEvent(false)
, m_pausedInternal(false)
, m_closedCaptionsVisible(false)
- , m_loadInitiatedByUserGesture(false)
, m_completelyLoaded(false)
, m_havePreparedToPlay(false)
, m_tracksAreReady(true)
@@ -316,13 +315,10 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
ScriptWrappable::init(this);
if (document.settings()) {
- if (document.settings()->mediaPlaybackRequiresUserGesture()) {
+ if (document.settings()->mediaPlaybackRequiresUserGesture())
addBehaviorRestriction(RequireUserGestureForPlayRestriction);
- addBehaviorRestriction(RequireUserGestureForLoadRestriction);
- }
- if (document.settings()->mediaFullscreenRequiresUserGesture()) {
+ if (document.settings()->mediaFullscreenRequiresUserGesture())
addBehaviorRestriction(RequireUserGestureForFullscreenRestriction);
- }
}
// We must always have a ShadowRoot so children like <source> will not render
@@ -629,12 +625,9 @@ void HTMLMediaElement::load()
if (document().settings() && !document().settings()->mediaEnabled())
return;
- if (userGestureRequiredForLoad() && !UserGestureIndicator::processingUserGesture())
- return;
-
- m_loadInitiatedByUserGesture = UserGestureIndicator::processingUserGesture();
- if (m_loadInitiatedByUserGesture)
+ if (UserGestureIndicator::processingUserGesture())
removeBehaviorsRestrictionsAfterFirstUserGesture();
+
prepareForLoad();
loadInternal();
prepareToPlay();
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698