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

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: linker errors on win/mac... 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
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 #include "wtf/text/WTFString.h"
philipj_slow 2015/09/02 09:24:11 Looks like this can be forward declared.
liberato (no reviews please) 2015/09/04 06:49:45 Done.
9
10 namespace blink {
11
12 // This must be kept in sync with WebSettings::AutoplayExperimentMode.
13 // See WebSettings.h for documentation.
14 class AutoplayExperimentConfig {
15 public:
16 enum Mode {
17 // Do not enable the autoplay experiment.
18 Off = 0,
19 // Enable gestureless autoplay.
20 Enabled = 1 << 0,
21 // Restrict gestureless autoplay to media that is visible in
22 // the viewport.
23 IfViewport = 1 << 1,
24 // Restrict gestureless autoplay to audio-less or muted media.
25 IfMuted = 1 << 2,
26 // Restrict gestureless autoplay to sites which contain the
27 // viewport tag.
28 IfMobile = 1 << 3,
29 // If gestureless autoplay is allowed, then mute the media before
30 // starting to play.
31 PlayMuted = 1 << 4,
32 };
33
34 static Mode fromString(const String& token);
35 };
36
37 inline AutoplayExperimentConfig::Mode& operator|=(AutoplayExperimentConfig::Mode & a, const AutoplayExperimentConfig::Mode& b)
38 {
39 a = static_cast<AutoplayExperimentConfig::Mode>(
40 static_cast<int>(a) | static_cast<int>(b));
41 return a;
42 }
43
44 } // namespace blink
45
46 #endif // AutoplayExperimentConfig_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698