2 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
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
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.
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.
32 #include "WebRuntimeFeatures.h"
34 #include "RuntimeEnabledFeatures.h"
35 #include "WebMediaPlayerClientImpl.h"
37 using namespace WebCore;
41 void WebRuntimeFeatures::enableStableFeatures(bool enable)
43 // FIXME: This entire method should be removed once it is no longer called by Chromium.
47 void WebRuntimeFeatures::enableExperimentalFeatures(bool enable)
49 RuntimeEnabledFeatures::setExperimentalFeaturesEnabled(enable);
52 void WebRuntimeFeatures::enableTestOnlyFeatures(bool enable)
54 RuntimeEnabledFeatures::setTestFeaturesEnabled(enable);
57 void WebRuntimeFeatures::enableApplicationCache(bool enable)
59 RuntimeEnabledFeatures::setApplicationCacheEnabled(enable);
62 void WebRuntimeFeatures::enableDatabase(bool enable)
64 RuntimeEnabledFeatures::setDatabaseEnabled(enable);
67 void WebRuntimeFeatures::enableDeviceMotion(bool enable)
69 RuntimeEnabledFeatures::setDeviceMotionEnabled(enable);
72 void WebRuntimeFeatures::enableDeviceOrientation(bool enable)
74 RuntimeEnabledFeatures::setDeviceOrientationEnabled(enable);
77 void WebRuntimeFeatures::enableDialogElement(bool enable)
79 RuntimeEnabledFeatures::setDialogElementEnabled(enable);
82 void WebRuntimeFeatures::enableEncryptedMedia(bool enable)
84 RuntimeEnabledFeatures::setEncryptedMediaEnabled(enable);
85 // FIXME: Hack to allow MediaKeyError to be enabled for either version.
86 RuntimeEnabledFeatures::setEncryptedMediaAnyVersionEnabled(
87 RuntimeEnabledFeatures::encryptedMediaEnabled()
88 || RuntimeEnabledFeatures::prefixedEncryptedMediaEnabled());
91 bool WebRuntimeFeatures::isEncryptedMediaEnabled()
93 return RuntimeEnabledFeatures::encryptedMediaEnabled();
96 void WebRuntimeFeatures::enablePrefixedEncryptedMedia(bool enable)
98 RuntimeEnabledFeatures::setPrefixedEncryptedMediaEnabled(enable);
99 // FIXME: Hack to allow MediaKeyError to be enabled for either version.
100 RuntimeEnabledFeatures::setEncryptedMediaAnyVersionEnabled(
101 RuntimeEnabledFeatures::encryptedMediaEnabled()
102 || RuntimeEnabledFeatures::prefixedEncryptedMediaEnabled());
105 bool WebRuntimeFeatures::isPrefixedEncryptedMediaEnabled()
107 return RuntimeEnabledFeatures::prefixedEncryptedMediaEnabled();
110 void WebRuntimeFeatures::enableDirectWrite(bool enable)
112 RuntimeEnabledFeatures::setDirectWriteEnabled(enable);
113 RuntimeEnabledFeatures::setSubpixelFontScalingEnabled(enable || RuntimeEnabledFeatures::subpixelFontScalingEnabled());
116 void WebRuntimeFeatures::enableExperimentalCanvasFeatures(bool enable)
118 RuntimeEnabledFeatures::setExperimentalCanvasFeaturesEnabled(enable);
121 void WebRuntimeFeatures::enableFastTextAutosizing(bool enable)
123 RuntimeEnabledFeatures::setFastTextAutosizingEnabled(enable);
126 void WebRuntimeFeatures::enableFileSystem(bool enable)
128 RuntimeEnabledFeatures::setFileSystemEnabled(enable);
131 void WebRuntimeFeatures::enableFullscreen(bool enable)
133 RuntimeEnabledFeatures::setFullscreenEnabled(enable);
136 void WebRuntimeFeatures::enableGamepad(bool enable)
138 RuntimeEnabledFeatures::setGamepadEnabled(enable);
141 void WebRuntimeFeatures::enableGeolocation(bool enable)
143 RuntimeEnabledFeatures::setGeolocationEnabled(enable);
146 void WebRuntimeFeatures::enableLazyLayout(bool enable)
148 // FIXME: Remove this once Chromium stops calling this.
151 void WebRuntimeFeatures::enableLocalStorage(bool enable)
153 RuntimeEnabledFeatures::setLocalStorageEnabled(enable);
156 void WebRuntimeFeatures::enableMediaPlayer(bool enable)
158 RuntimeEnabledFeatures::setMediaEnabled(enable);
161 void WebRuntimeFeatures::enableWebKitMediaSource(bool enable)
163 RuntimeEnabledFeatures::setWebKitMediaSourceEnabled(enable);
166 void WebRuntimeFeatures::enableMediaSource(bool enable)
168 RuntimeEnabledFeatures::setMediaSourceEnabled(enable);
171 void WebRuntimeFeatures::enableMediaStream(bool enable)
173 RuntimeEnabledFeatures::setMediaStreamEnabled(enable);
176 void WebRuntimeFeatures::enableNotifications(bool enable)
178 RuntimeEnabledFeatures::setNotificationsEnabled(enable);
181 void WebRuntimeFeatures::enableNavigatorContentUtils(bool enable)
183 RuntimeEnabledFeatures::setNavigatorContentUtilsEnabled(enable);
186 void WebRuntimeFeatures::enableOrientationEvent(bool enable)
188 RuntimeEnabledFeatures::setOrientationEventEnabled(enable);
191 void WebRuntimeFeatures::enablePagePopup(bool enable)
193 RuntimeEnabledFeatures::setPagePopupEnabled(enable);
196 void WebRuntimeFeatures::enablePeerConnection(bool enable)
198 RuntimeEnabledFeatures::setPeerConnectionEnabled(enable);
201 void WebRuntimeFeatures::enableRequestAutocomplete(bool enable)
203 RuntimeEnabledFeatures::setRequestAutocompleteEnabled(enable);
206 void WebRuntimeFeatures::enableScriptedSpeech(bool enable)
208 RuntimeEnabledFeatures::setScriptedSpeechEnabled(enable);
211 void WebRuntimeFeatures::enableServiceWorker(bool enable)
213 RuntimeEnabledFeatures::setServiceWorkerEnabled(enable);
216 void WebRuntimeFeatures::enableSessionStorage(bool enable)
218 RuntimeEnabledFeatures::setSessionStorageEnabled(enable);
221 void WebRuntimeFeatures::enableSpeechInput(bool enable)
223 RuntimeEnabledFeatures::setSpeechInputEnabled(enable);
226 void WebRuntimeFeatures::enableSpeechSynthesis(bool enable)
228 RuntimeEnabledFeatures::setSpeechSynthesisEnabled(enable);
231 void WebRuntimeFeatures::enableTouch(bool enable)
233 RuntimeEnabledFeatures::setTouchEnabled(enable);
236 void WebRuntimeFeatures::enableTouchIconLoading(bool enable)
238 RuntimeEnabledFeatures::setTouchIconLoadingEnabled(enable);
241 void WebRuntimeFeatures::enableWebAnimationsCSS(bool enable)
243 // FIXME: Remove this method once the runtime flags are removed from Chromium.
247 void WebRuntimeFeatures::enableWebAnimationsSVG(bool enable)
249 RuntimeEnabledFeatures::setWebAnimationsSVGEnabled(enable);
252 void WebRuntimeFeatures::enableWebAudio(bool enable)
254 RuntimeEnabledFeatures::setWebAudioEnabled(enable);
257 void WebRuntimeFeatures::enableWebGLDraftExtensions(bool enable)
259 RuntimeEnabledFeatures::setWebGLDraftExtensionsEnabled(enable);
262 void WebRuntimeFeatures::enableWebMIDI(bool enable)
264 return RuntimeEnabledFeatures::setWebMIDIEnabled(enable);
267 void WebRuntimeFeatures::enableHTMLImports(bool enable)
269 RuntimeEnabledFeatures::setHTMLImportsEnabled(enable);
272 void WebRuntimeFeatures::enableXSLT(bool enable)
274 RuntimeEnabledFeatures::setXSLTEnabled(enable);
277 void WebRuntimeFeatures::enableOverlayScrollbars(bool enable)
279 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(enable);
282 void WebRuntimeFeatures::enableInputModeAttribute(bool enable)
284 RuntimeEnabledFeatures::setInputModeAttributeEnabled(enable);
287 void WebRuntimeFeatures::enableOverlayFullscreenVideo(bool enable)
289 RuntimeEnabledFeatures::setOverlayFullscreenVideoEnabled(enable);
292 void WebRuntimeFeatures::enableSharedWorker(bool enable)
294 RuntimeEnabledFeatures::setSharedWorkerEnabled(enable);
297 void WebRuntimeFeatures::enableRepaintAfterLayout(bool enable)
299 RuntimeEnabledFeatures::setRepaintAfterLayoutEnabled(enable);
302 void WebRuntimeFeatures::enableExperimentalWebSocket(bool enable)
304 RuntimeEnabledFeatures::setExperimentalWebSocketEnabled(enable);
307 void WebRuntimeFeatures::enableTargetedStyleRecalc(bool enable)
309 RuntimeEnabledFeatures::setTargetedStyleRecalcEnabled(enable);