Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / core / html / AutoplayExperimentConfig.cpp
blob8af7d9fb1b9c8b70131707e39e787cd88ef52db9
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.
5 #include "config.h"
6 #include "core/html/AutoplayExperimentConfig.h"
8 #include "wtf/text/WTFString.h"
10 namespace blink {
12 AutoplayExperimentConfig::Mode AutoplayExperimentConfig::fromString(const String& mode)
14 AutoplayExperimentConfig::Mode value = AutoplayExperimentConfig::Mode::Off;
15 if (mode.contains("-forvideo"))
16 value |= AutoplayExperimentConfig::Mode::ForVideo;
17 if (mode.contains("-foraudio"))
18 value |= AutoplayExperimentConfig::Mode::ForAudio;
19 if (mode.contains("-ifmuted"))
20 value |= AutoplayExperimentConfig::Mode::IfMuted;
21 if (mode.contains("-ifmobile"))
22 value |= AutoplayExperimentConfig::Mode::IfMobile;
23 if (mode.contains("-playmuted"))
24 value |= AutoplayExperimentConfig::Mode::PlayMuted;
26 return value;
29 } // namespace blink