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

Side by Side Diff: Source/core/html/AutoplayExperimentConfig.h

Issue 1179223002: Implement autoplay gesture override experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased. Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « Source/core/frame/Settings.in ('k') | Source/core/html/AutoplayExperimentConfig.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef AutoplayExperimentConfig_h
6 #define AutoplayExperimentConfig_h
7
8 namespace WTF {
9 class String;
10 }
11
12 namespace blink {
13
14 class AutoplayExperimentConfig {
15 public:
16 // Experiment configuration bits. These maybe combined. For example,
17 // ForVideo|IfMuted will override the user gesture requirement for
18 // playing video that has no audio or is muted. ForVideo, by itself,
19 // will entirely override the user gesture requirement for all video
20 // elements, but not for audio elements.
21 enum Mode {
22 // Do not enable the autoplay experiment.
23 Off = 0,
24 // Enable gestureless autoplay for video elements.
25 ForVideo = 1 << 0,
26 // Enable gestureless autoplay for audio elements.
27 ForAudio = 1 << 1,
28 // Restrict gestureless autoplay to audio-less or muted media.
29 IfMuted = 1 << 2,
30 // Restrict gestureless autoplay to sites which contain the
31 // viewport tag.
32 IfMobile = 1 << 3,
33 // If gestureless autoplay is allowed, then mute the media before
34 // starting to play.
35 PlayMuted = 1 << 4,
36 };
37
38 static Mode fromString(const WTF::String& token);
39 };
40
41 inline AutoplayExperimentConfig::Mode& operator|=(AutoplayExperimentConfig::Mode & a, const AutoplayExperimentConfig::Mode& b)
42 {
43 a = static_cast<AutoplayExperimentConfig::Mode>(
44 static_cast<int>(a) | static_cast<int>(b));
45 return a;
46 }
47
48 } // namespace blink
49
50 #endif // AutoplayExperimentConfig_h
OLDNEW
« no previous file with comments | « Source/core/frame/Settings.in ('k') | Source/core/html/AutoplayExperimentConfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698