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

Unified Diff: third_party/WebKit/Source/core/html/AutoplayExperimentHelper.h

Issue 1921073002: Add partial viewport visibility check to autoplay experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/AutoplayExperimentHelper.h
diff --git a/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.h b/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.h
index 80ff901621221f833846f7dee80cf01e139d50bc..890ee365413ab35a9c84b85443d6548aa9953af0 100644
--- a/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.h
+++ b/third_party/WebKit/Source/core/html/AutoplayExperimentHelper.h
@@ -164,24 +164,27 @@ public:
enum Mode {
// Do not enable the autoplay experiment.
- ExperimentOff = 0,
+ ExperimentOff = 0,
// Enable gestureless autoplay for video elements.
- ForVideo = 1 << 0,
+ ForVideo = 1 << 0,
// Enable gestureless autoplay for audio elements.
- ForAudio = 1 << 1,
+ ForAudio = 1 << 1,
// Restrict gestureless autoplay to media that is in a visible page.
- IfPageVisible = 1 << 2,
- // Restrict gestureless autoplay to media that is visible in
+ IfPageVisible = 1 << 2,
+ // Restrict gestureless autoplay to media that is entirely visible in
// the viewport.
- IfViewport = 1 << 3,
+ IfViewport = 1 << 3,
+ // Restrict gestureless autoplay to media that is partially visible in
+ // the viewport.
+ IfPartialViewport = 1 << 4,
// Restrict gestureless autoplay to audio-less or muted media.
- IfMuted = 1 << 4,
+ IfMuted = 1 << 5,
// Restrict gestureless autoplay to sites which contain the
// viewport tag.
- IfMobile = 1 << 5,
+ IfMobile = 1 << 6,
// If gestureless autoplay is allowed, then mute the media before
// starting to play.
- PlayMuted = 1 << 6,
+ PlayMuted = 1 << 7,
};
DEFINE_INLINE_TRACE() { visitor->trace(m_client); }
@@ -250,6 +253,10 @@ private:
// (as in, "The user really didn't want to play this").
bool isBailout() const;
+ // Returns true if and only if the experiment requires some sort of viewport
+ // visibility check for autoplay.
+ bool requiresViewportVisibility() const;
+
Member<Client> m_client;
Mode m_mode;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/AutoplayExperimentHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698