blob: 6de690fc60b13da18f52abb6916bfd3be3f1a37d [file] [log] [blame]
Ben Murdoche69819b2013-07-17 14:56:49 +01001/*
2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include "config.h"
32#include "WebRuntimeFeatures.h"
33
34#include "RuntimeEnabledFeatures.h"
35#include "WebMediaPlayerClientImpl.h"
Ben Murdoche69819b2013-07-17 14:56:49 +010036
37using namespace WebCore;
38
Torne (Richard Coles)51b29062013-11-28 11:56:03 +000039namespace blink {
Ben Murdoche69819b2013-07-17 14:56:49 +010040
Ben Murdoche69819b2013-07-17 14:56:49 +010041void WebRuntimeFeatures::enableExperimentalFeatures(bool enable)
42{
43 RuntimeEnabledFeatures::setExperimentalFeaturesEnabled(enable);
44}
45
Torne (Richard Coles)d5428f32014-03-18 10:21:16 +000046void WebRuntimeFeatures::enableBleedingEdgeFastPaths(bool enable)
47{
48 ASSERT(enable);
49 RuntimeEnabledFeatures::setBleedingEdgeFastPathsEnabled(enable);
50 RuntimeEnabledFeatures::setSubpixelFontScalingEnabled(enable || RuntimeEnabledFeatures::subpixelFontScalingEnabled());
51 RuntimeEnabledFeatures::setCSSWillChangeEnabled(enable);
Ben Murdoch07a852d2014-03-31 11:51:52 +010052 RuntimeEnabledFeatures::setWebAnimationsAPIEnabled(enable);
Torne (Richard Coles)d5428f32014-03-18 10:21:16 +000053}
54
Ben Murdoche69819b2013-07-17 14:56:49 +010055void WebRuntimeFeatures::enableTestOnlyFeatures(bool enable)
56{
57 RuntimeEnabledFeatures::setTestFeaturesEnabled(enable);
58}
59
60void WebRuntimeFeatures::enableApplicationCache(bool enable)
61{
62 RuntimeEnabledFeatures::setApplicationCacheEnabled(enable);
63}
64
Ben Murdoche69819b2013-07-17 14:56:49 +010065void WebRuntimeFeatures::enableDatabase(bool enable)
66{
67 RuntimeEnabledFeatures::setDatabaseEnabled(enable);
68}
69
Torne (Richard Coles)e1f1df52013-08-23 16:39:30 +010070void WebRuntimeFeatures::enableDialogElement(bool enable)
71{
72 RuntimeEnabledFeatures::setDialogElementEnabled(enable);
73}
74
Ben Murdoche69819b2013-07-17 14:56:49 +010075void WebRuntimeFeatures::enableEncryptedMedia(bool enable)
76{
77 RuntimeEnabledFeatures::setEncryptedMediaEnabled(enable);
78 // FIXME: Hack to allow MediaKeyError to be enabled for either version.
79 RuntimeEnabledFeatures::setEncryptedMediaAnyVersionEnabled(
80 RuntimeEnabledFeatures::encryptedMediaEnabled()
Torne (Richard Coles)06f816c2013-09-26 13:25:12 +010081 || RuntimeEnabledFeatures::prefixedEncryptedMediaEnabled());
Ben Murdoche69819b2013-07-17 14:56:49 +010082}
83
84bool WebRuntimeFeatures::isEncryptedMediaEnabled()
85{
86 return RuntimeEnabledFeatures::encryptedMediaEnabled();
87}
88
Torne (Richard Coles)06f816c2013-09-26 13:25:12 +010089void WebRuntimeFeatures::enablePrefixedEncryptedMedia(bool enable)
90{
91 RuntimeEnabledFeatures::setPrefixedEncryptedMediaEnabled(enable);
92 // FIXME: Hack to allow MediaKeyError to be enabled for either version.
93 RuntimeEnabledFeatures::setEncryptedMediaAnyVersionEnabled(
94 RuntimeEnabledFeatures::encryptedMediaEnabled()
95 || RuntimeEnabledFeatures::prefixedEncryptedMediaEnabled());
Ben Murdoche69819b2013-07-17 14:56:49 +010096}
97
Torne (Richard Coles)06f816c2013-09-26 13:25:12 +010098bool WebRuntimeFeatures::isPrefixedEncryptedMediaEnabled()
99{
100 return RuntimeEnabledFeatures::prefixedEncryptedMediaEnabled();
Ben Murdoche69819b2013-07-17 14:56:49 +0100101}
102
103void WebRuntimeFeatures::enableExperimentalCanvasFeatures(bool enable)
104{
105 RuntimeEnabledFeatures::setExperimentalCanvasFeaturesEnabled(enable);
106}
107
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100108void WebRuntimeFeatures::enableFastTextAutosizing(bool enable)
109{
110 RuntimeEnabledFeatures::setFastTextAutosizingEnabled(enable);
111}
112
Ben Murdoche69819b2013-07-17 14:56:49 +0100113void WebRuntimeFeatures::enableFileSystem(bool enable)
114{
115 RuntimeEnabledFeatures::setFileSystemEnabled(enable);
116}
117
Ben Murdoche69819b2013-07-17 14:56:49 +0100118void WebRuntimeFeatures::enableGamepad(bool enable)
119{
120 RuntimeEnabledFeatures::setGamepadEnabled(enable);
121}
122
Ben Murdoche69819b2013-07-17 14:56:49 +0100123void WebRuntimeFeatures::enableLazyLayout(bool enable)
124{
Torne (Richard Coles)e1f1df52013-08-23 16:39:30 +0100125 // FIXME: Remove this once Chromium stops calling this.
Ben Murdoche69819b2013-07-17 14:56:49 +0100126}
127
128void WebRuntimeFeatures::enableLocalStorage(bool enable)
129{
130 RuntimeEnabledFeatures::setLocalStorageEnabled(enable);
131}
132
Ben Murdoche69819b2013-07-17 14:56:49 +0100133void WebRuntimeFeatures::enableMediaPlayer(bool enable)
134{
135 RuntimeEnabledFeatures::setMediaEnabled(enable);
136}
137
Ben Murdoche69819b2013-07-17 14:56:49 +0100138void WebRuntimeFeatures::enableWebKitMediaSource(bool enable)
139{
140 RuntimeEnabledFeatures::setWebKitMediaSourceEnabled(enable);
141}
142
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100143void WebRuntimeFeatures::enableMediaSource(bool enable)
144{
145 RuntimeEnabledFeatures::setMediaSourceEnabled(enable);
146}
147
Ben Murdoche69819b2013-07-17 14:56:49 +0100148void WebRuntimeFeatures::enableMediaStream(bool enable)
149{
150 RuntimeEnabledFeatures::setMediaStreamEnabled(enable);
151}
152
Ben Murdoche69819b2013-07-17 14:56:49 +0100153void WebRuntimeFeatures::enableNotifications(bool enable)
154{
Ben Murdoche69819b2013-07-17 14:56:49 +0100155 RuntimeEnabledFeatures::setNotificationsEnabled(enable);
Ben Murdoche69819b2013-07-17 14:56:49 +0100156}
157
Torne (Richard Coles)a854de02013-12-18 16:25:25 +0000158void WebRuntimeFeatures::enableNavigatorContentUtils(bool enable)
159{
160 RuntimeEnabledFeatures::setNavigatorContentUtilsEnabled(enable);
161}
162
Torne (Richard Coles)09380292014-02-21 12:17:33 +0000163void WebRuntimeFeatures::enableOrientationEvent(bool enable)
Torne (Richard Coles)a854de02013-12-18 16:25:25 +0000164{
Torne (Richard Coles)09380292014-02-21 12:17:33 +0000165 RuntimeEnabledFeatures::setOrientationEventEnabled(enable);
Torne (Richard Coles)a854de02013-12-18 16:25:25 +0000166}
167
Ben Murdoche69819b2013-07-17 14:56:49 +0100168void WebRuntimeFeatures::enablePagePopup(bool enable)
169{
170 RuntimeEnabledFeatures::setPagePopupEnabled(enable);
171}
172
Ben Murdoche69819b2013-07-17 14:56:49 +0100173void WebRuntimeFeatures::enablePeerConnection(bool enable)
174{
175 RuntimeEnabledFeatures::setPeerConnectionEnabled(enable);
176}
177
Ben Murdoche69819b2013-07-17 14:56:49 +0100178void WebRuntimeFeatures::enableRequestAutocomplete(bool enable)
179{
180 RuntimeEnabledFeatures::setRequestAutocompleteEnabled(enable);
181}
182
Ben Murdoche69819b2013-07-17 14:56:49 +0100183void WebRuntimeFeatures::enableScriptedSpeech(bool enable)
184{
185 RuntimeEnabledFeatures::setScriptedSpeechEnabled(enable);
186}
187
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100188void WebRuntimeFeatures::enableServiceWorker(bool enable)
189{
190 RuntimeEnabledFeatures::setServiceWorkerEnabled(enable);
191}
192
Ben Murdoche69819b2013-07-17 14:56:49 +0100193void WebRuntimeFeatures::enableSessionStorage(bool enable)
194{
195 RuntimeEnabledFeatures::setSessionStorageEnabled(enable);
196}
197
Ben Murdoche69819b2013-07-17 14:56:49 +0100198void WebRuntimeFeatures::enableSpeechInput(bool enable)
199{
200 RuntimeEnabledFeatures::setSpeechInputEnabled(enable);
201}
202
Ben Murdoche69819b2013-07-17 14:56:49 +0100203void WebRuntimeFeatures::enableSpeechSynthesis(bool enable)
204{
205 RuntimeEnabledFeatures::setSpeechSynthesisEnabled(enable);
206}
207
Ben Murdoche69819b2013-07-17 14:56:49 +0100208void WebRuntimeFeatures::enableTouch(bool enable)
209{
210 RuntimeEnabledFeatures::setTouchEnabled(enable);
211}
212
Torne (Richard Coles)09380292014-02-21 12:17:33 +0000213void WebRuntimeFeatures::enableTouchIconLoading(bool enable)
Ben Murdoche69819b2013-07-17 14:56:49 +0100214{
Torne (Richard Coles)09380292014-02-21 12:17:33 +0000215 RuntimeEnabledFeatures::setTouchIconLoadingEnabled(enable);
Ben Murdoche69819b2013-07-17 14:56:49 +0100216}
217
Torne (Richard Coles)51b29062013-11-28 11:56:03 +0000218void WebRuntimeFeatures::enableWebAnimationsCSS(bool enable)
Ben Murdoche69819b2013-07-17 14:56:49 +0100219{
Torne (Richard Coles)09380292014-02-21 12:17:33 +0000220 // FIXME: Remove this method once the runtime flags are removed from Chromium.
221 ASSERT(enable);
Ben Murdoche69819b2013-07-17 14:56:49 +0100222}
223
Torne (Richard Coles)51b29062013-11-28 11:56:03 +0000224void WebRuntimeFeatures::enableWebAnimationsSVG(bool enable)
Ben Murdoche69819b2013-07-17 14:56:49 +0100225{
Torne (Richard Coles)51b29062013-11-28 11:56:03 +0000226 RuntimeEnabledFeatures::setWebAnimationsSVGEnabled(enable);
Ben Murdoche69819b2013-07-17 14:56:49 +0100227}
228
229void WebRuntimeFeatures::enableWebAudio(bool enable)
230{
231 RuntimeEnabledFeatures::setWebAudioEnabled(enable);
232}
233
Ben Murdoche69819b2013-07-17 14:56:49 +0100234void WebRuntimeFeatures::enableWebGLDraftExtensions(bool enable)
235{
236 RuntimeEnabledFeatures::setWebGLDraftExtensionsEnabled(enable);
237}
238
Ben Murdoche69819b2013-07-17 14:56:49 +0100239void WebRuntimeFeatures::enableWebMIDI(bool enable)
240{
241 return RuntimeEnabledFeatures::setWebMIDIEnabled(enable);
242}
243
Ben Murdoch1fad5ca2013-08-07 11:05:11 +0100244void WebRuntimeFeatures::enableHTMLImports(bool enable)
245{
246 RuntimeEnabledFeatures::setHTMLImportsEnabled(enable);
247}
248
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100249void WebRuntimeFeatures::enableXSLT(bool enable)
250{
251 RuntimeEnabledFeatures::setXSLTEnabled(enable);
252}
253
Ben Murdoch3c9e4ae2013-08-12 14:20:44 +0100254void WebRuntimeFeatures::enableOverlayScrollbars(bool enable)
255{
256 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(enable);
257}
258
Torne (Richard Coles)06f816c2013-09-26 13:25:12 +0100259void WebRuntimeFeatures::enableOverlayFullscreenVideo(bool enable)
260{
261 RuntimeEnabledFeatures::setOverlayFullscreenVideoEnabled(enable);
262}
263
Torne (Richard Coles)f79f16f2013-10-31 11:16:44 +0000264void WebRuntimeFeatures::enableSharedWorker(bool enable)
265{
266 RuntimeEnabledFeatures::setSharedWorkerEnabled(enable);
267}
268
Torne (Richard Coles)19cde672013-11-06 12:28:04 +0000269void WebRuntimeFeatures::enableRepaintAfterLayout(bool enable)
270{
271 RuntimeEnabledFeatures::setRepaintAfterLayoutEnabled(enable);
272}
273
Torne (Richard Coles)09380292014-02-21 12:17:33 +0000274void WebRuntimeFeatures::enableExperimentalWebSocket(bool enable)
275{
276 RuntimeEnabledFeatures::setExperimentalWebSocketEnabled(enable);
277}
278
279void WebRuntimeFeatures::enableTargetedStyleRecalc(bool enable)
280{
281 RuntimeEnabledFeatures::setTargetedStyleRecalcEnabled(enable);
282}
283
Ben Murdoch07a852d2014-03-31 11:51:52 +0100284void WebRuntimeFeatures::enablePreciseMemoryInfo(bool enable)
285{
286 RuntimeEnabledFeatures::setPreciseMemoryInfoEnabled(enable);
287}
288
Torne (Richard Coles)51b29062013-11-28 11:56:03 +0000289} // namespace blink