1 /* 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 #ifndef WebRuntimeFeatures_h 32 #define WebRuntimeFeatures_h 33 34 #include "../platform/WebCommon.h" 35 36 namespace blink { 37 38 // This class is used to enable runtime features of Blink. 39 // All features are disabled by default. 40 // Most clients should call enableStableFeatures() to enable 41 // features Blink has made API commitments to. 42 class WebRuntimeFeatures { 43 public: 44 BLINK_EXPORT static void enableStableFeatures(bool); 45 BLINK_EXPORT static void enableExperimentalFeatures(bool); 46 BLINK_EXPORT static void enableTestOnlyFeatures(bool); 47 48 BLINK_EXPORT static void enableApplicationCache(bool); 49 BLINK_EXPORT static bool isApplicationCacheEnabled(); 50 51 BLINK_EXPORT static void enableDatabase(bool); 52 BLINK_EXPORT static bool isDatabaseEnabled(); 53 54 BLINK_EXPORT static void enableDeviceMotion(bool); 55 BLINK_EXPORT static bool isDeviceMotionEnabled(); 56 57 BLINK_EXPORT static void enableDeviceOrientation(bool); 58 BLINK_EXPORT static bool isDeviceOrientationEnabled(); 59 60 BLINK_EXPORT static void enableDialogElement(bool); 61 BLINK_EXPORT static bool isDialogElementEnabled(); 62 63 BLINK_EXPORT static void enableEncryptedMedia(bool); 64 BLINK_EXPORT static bool isEncryptedMediaEnabled(); 65 66 BLINK_EXPORT static void enablePrefixedEncryptedMedia(bool); 67 BLINK_EXPORT static bool isPrefixedEncryptedMediaEnabled(); 68 69 BLINK_EXPORT static void enableDirectWrite(bool); 70 BLINK_EXPORT static bool isDirectWriteEnabled(); 71 72 BLINK_EXPORT static void enableExperimentalCanvasFeatures(bool); 73 BLINK_EXPORT static bool isExperimentalCanvasFeaturesEnabled(); 74 75 BLINK_EXPORT static void enableFastTextAutosizing(bool); 76 BLINK_EXPORT static bool isFastTextAutosizingEnabled(); 77 78 BLINK_EXPORT static void enableFileSystem(bool); 79 BLINK_EXPORT static bool isFileSystemEnabled(); 80 81 BLINK_EXPORT static void enableFullscreen(bool); 82 BLINK_EXPORT static bool isFullscreenEnabled(); 83 84 BLINK_EXPORT static void enableGamepad(bool); 85 BLINK_EXPORT static bool isGamepadEnabled(); 86 87 BLINK_EXPORT static void enableGeolocation(bool); 88 BLINK_EXPORT static bool isGeolocationEnabled(); 89 90 BLINK_EXPORT static void enableLazyLayout(bool); 91 92 BLINK_EXPORT static void enableLocalStorage(bool); 93 BLINK_EXPORT static bool isLocalStorageEnabled(); 94 95 BLINK_EXPORT static void enableMediaPlayer(bool); 96 BLINK_EXPORT static bool isMediaPlayerEnabled(); 97 98 BLINK_EXPORT static void enableWebKitMediaSource(bool); 99 BLINK_EXPORT static bool isWebKitMediaSourceEnabled(); 100 101 BLINK_EXPORT static void enableMediaSource(bool); 102 BLINK_EXPORT static bool isMediaSourceEnabled(); 103 104 BLINK_EXPORT static void enableMediaStream(bool); 105 BLINK_EXPORT static bool isMediaStreamEnabled(); 106 107 BLINK_EXPORT static void enableNotifications(bool); 108 BLINK_EXPORT static bool isNotificationsEnabled(); 109 110 BLINK_EXPORT static void enableNavigatorContentUtils(bool); 111 BLINK_EXPORT static bool isNavigatorContentUtilsEnabled(); 112 113 BLINK_EXPORT static void enablePagePopup(bool); 114 BLINK_EXPORT static bool isPagePopupEnabled(); 115 116 BLINK_EXPORT static void enablePeerConnection(bool); 117 BLINK_EXPORT static bool isPeerConnectionEnabled(); 118 119 BLINK_EXPORT static void enableRequestAutocomplete(bool); 120 BLINK_EXPORT static bool isRequestAutocompleteEnabled(); 121 122 BLINK_EXPORT static void enableScriptedSpeech(bool); 123 BLINK_EXPORT static bool isScriptedSpeechEnabled(); 124 125 BLINK_EXPORT static void enableServiceWorker(bool); 126 BLINK_EXPORT static bool isServiceWorkerEnabled(); 127 128 BLINK_EXPORT static void enableSessionStorage(bool); 129 BLINK_EXPORT static bool isSessionStorageEnabled(); 130 131 BLINK_EXPORT static void enableSpeechInput(bool); 132 BLINK_EXPORT static bool isSpeechInputEnabled(); 133 134 BLINK_EXPORT static void enableSpeechSynthesis(bool); 135 BLINK_EXPORT static bool isSpeechSynthesisEnabled(); 136 137 BLINK_EXPORT static void enableTouch(bool); 138 BLINK_EXPORT static bool isTouchEnabled(); 139 140 BLINK_EXPORT static void enableWebAnimationsCSS(bool); 141 BLINK_EXPORT static void enableWebAnimationsSVG(bool); 142 143 BLINK_EXPORT static void enableWebAudio(bool); 144 BLINK_EXPORT static bool isWebAudioEnabled(); 145 146 BLINK_EXPORT static void enableWebGLDraftExtensions(bool); 147 BLINK_EXPORT static bool isWebGLDraftExtensionsEnabled(); 148 149 BLINK_EXPORT static void enableWebMIDI(bool); 150 BLINK_EXPORT static bool isWebMIDIEnabled(); 151 152 BLINK_EXPORT static void enableDataListElement(bool); 153 BLINK_EXPORT static bool isDataListElementEnabled(); 154 155 BLINK_EXPORT static void enableHTMLImports(bool); 156 BLINK_EXPORT static bool isHTMLImportsEnabled(); 157 158 BLINK_EXPORT static void enableXSLT(bool); 159 160 BLINK_EXPORT static void enableEmbedderCustomElements(bool); 161 162 BLINK_EXPORT static void enableOverlayScrollbars(bool); 163 164 BLINK_EXPORT static void enableInputModeAttribute(bool); 165 166 BLINK_EXPORT static void enableOverlayFullscreenVideo(bool); 167 168 BLINK_EXPORT static void enableSharedWorker(bool); 169 170 BLINK_EXPORT static void enableRepaintAfterLayout(bool); 171 172 private: 173 WebRuntimeFeatures(); 174 }; 175 176 } // namespace blink 177 178 #endif 179