| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2009 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 "RuntimeEnabledFeatures.h" | |
| 33 | |
| 34 #include "DatabaseManager.h" | |
| 35 #include "MediaPlayer.h" | |
| 36 #include "SharedWorkerRepository.h" | |
| 37 #include "WebSocket.h" | |
| 38 | |
| 39 #if ENABLE(FILE_SYSTEM) | |
| 40 #include "AsyncFileSystem.h" | |
| 41 #endif | |
| 42 | |
| 43 namespace WebCore { | |
| 44 | |
| 45 bool RuntimeEnabledFeatures::isLocalStorageEnabled = true; | |
| 46 bool RuntimeEnabledFeatures::isSessionStorageEnabled = true; | |
| 47 bool RuntimeEnabledFeatures::isWebkitNotificationsEnabled = false; | |
| 48 bool RuntimeEnabledFeatures::isApplicationCacheEnabled = true; | |
| 49 bool RuntimeEnabledFeatures::isDataTransferItemsEnabled = true; | |
| 50 bool RuntimeEnabledFeatures::isGeolocationEnabled = true; | |
| 51 bool RuntimeEnabledFeatures::isIndexedDBEnabled = false; | |
| 52 bool RuntimeEnabledFeatures::isWebAudioEnabled = false; | |
| 53 bool RuntimeEnabledFeatures::isTouchEnabled = true; | |
| 54 bool RuntimeEnabledFeatures::isDeviceMotionEnabled = true; | |
| 55 bool RuntimeEnabledFeatures::isDeviceOrientationEnabled = true; | |
| 56 bool RuntimeEnabledFeatures::isSpeechInputEnabled = true; | |
| 57 bool RuntimeEnabledFeatures::isCanvasPathEnabled = false; | |
| 58 bool RuntimeEnabledFeatures::isCSSExclusionsEnabled = false; | |
| 59 bool RuntimeEnabledFeatures::isCSSRegionsEnabled = false; | |
| 60 bool RuntimeEnabledFeatures::isCSSCompositingEnabled = false; | |
| 61 bool RuntimeEnabledFeatures::isLangAttributeAwareFormControlUIEnabled = false; | |
| 62 | |
| 63 #if ENABLE(SCRIPTED_SPEECH) | |
| 64 bool RuntimeEnabledFeatures::isScriptedSpeechEnabled = false; | |
| 65 #endif | |
| 66 | |
| 67 #if ENABLE(MEDIA_STREAM) | |
| 68 bool RuntimeEnabledFeatures::isMediaStreamEnabled = true; | |
| 69 bool RuntimeEnabledFeatures::isPeerConnectionEnabled = true; | |
| 70 #endif | |
| 71 | |
| 72 #if ENABLE(GAMEPAD) | |
| 73 bool RuntimeEnabledFeatures::isGamepadEnabled = false; | |
| 74 #endif | |
| 75 | |
| 76 #if ENABLE(FILE_SYSTEM) | |
| 77 bool RuntimeEnabledFeatures::isFileSystemEnabled = false; | |
| 78 | |
| 79 bool RuntimeEnabledFeatures::fileSystemEnabled() | |
| 80 { | |
| 81 return isFileSystemEnabled && AsyncFileSystem::isAvailable(); | |
| 82 } | |
| 83 #endif | |
| 84 | |
| 85 #if ENABLE(JAVASCRIPT_I18N_API) | |
| 86 bool RuntimeEnabledFeatures::isJavaScriptI18NAPIEnabled = false; | |
| 87 | |
| 88 bool RuntimeEnabledFeatures::javaScriptI18NAPIEnabled() | |
| 89 { | |
| 90 return isJavaScriptI18NAPIEnabled; | |
| 91 } | |
| 92 #endif | |
| 93 | |
| 94 #if ENABLE(VIDEO) | |
| 95 | |
| 96 bool RuntimeEnabledFeatures::audioEnabled() | |
| 97 { | |
| 98 return MediaPlayer::isAvailable(); | |
| 99 } | |
| 100 | |
| 101 bool RuntimeEnabledFeatures::htmlMediaElementEnabled() | |
| 102 { | |
| 103 return MediaPlayer::isAvailable(); | |
| 104 } | |
| 105 | |
| 106 bool RuntimeEnabledFeatures::htmlAudioElementEnabled() | |
| 107 { | |
| 108 return MediaPlayer::isAvailable(); | |
| 109 } | |
| 110 | |
| 111 bool RuntimeEnabledFeatures::htmlVideoElementEnabled() | |
| 112 { | |
| 113 return MediaPlayer::isAvailable(); | |
| 114 } | |
| 115 | |
| 116 bool RuntimeEnabledFeatures::htmlSourceElementEnabled() | |
| 117 { | |
| 118 return MediaPlayer::isAvailable(); | |
| 119 } | |
| 120 | |
| 121 bool RuntimeEnabledFeatures::mediaControllerEnabled() | |
| 122 { | |
| 123 return MediaPlayer::isAvailable(); | |
| 124 } | |
| 125 | |
| 126 bool RuntimeEnabledFeatures::mediaErrorEnabled() | |
| 127 { | |
| 128 return MediaPlayer::isAvailable(); | |
| 129 } | |
| 130 | |
| 131 bool RuntimeEnabledFeatures::timeRangesEnabled() | |
| 132 { | |
| 133 return MediaPlayer::isAvailable(); | |
| 134 } | |
| 135 | |
| 136 #endif | |
| 137 | |
| 138 #if ENABLE(SHARED_WORKERS) | |
| 139 bool RuntimeEnabledFeatures::sharedWorkerEnabled() | |
| 140 { | |
| 141 return SharedWorkerRepository::isAvailable(); | |
| 142 } | |
| 143 #endif | |
| 144 | |
| 145 #if ENABLE(WEB_SOCKETS) | |
| 146 bool RuntimeEnabledFeatures::webSocketEnabled() | |
| 147 { | |
| 148 return WebSocket::isAvailable(); | |
| 149 } | |
| 150 #endif | |
| 151 | |
| 152 #if ENABLE(SQL_DATABASE) | |
| 153 bool RuntimeEnabledFeatures::openDatabaseEnabled() | |
| 154 { | |
| 155 return DatabaseManager::manager().isAvailable(); | |
| 156 } | |
| 157 | |
| 158 bool RuntimeEnabledFeatures::openDatabaseSyncEnabled() | |
| 159 { | |
| 160 return DatabaseManager::manager().isAvailable(); | |
| 161 } | |
| 162 #endif | |
| 163 | |
| 164 #if ENABLE(QUOTA) | |
| 165 bool RuntimeEnabledFeatures::isQuotaEnabled = false; | |
| 166 #endif | |
| 167 | |
| 168 bool RuntimeEnabledFeatures::isFullScreenAPIEnabled = true; | |
| 169 | |
| 170 bool RuntimeEnabledFeatures::isMediaSourceEnabled = false; | |
| 171 | |
| 172 #if ENABLE(VIDEO_TRACK) | |
| 173 #if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(CHROMIUM) || PLATFORM(BLACKBERRY)
|| PLATFORM(WIN) | |
| 174 bool RuntimeEnabledFeatures::isVideoTrackEnabled = true; | |
| 175 #else | |
| 176 bool RuntimeEnabledFeatures::isVideoTrackEnabled = false; | |
| 177 #endif | |
| 178 #endif | |
| 179 | |
| 180 #if ENABLE(ENCRYPTED_MEDIA) | |
| 181 bool RuntimeEnabledFeatures::isEncryptedMediaEnabled = false; | |
| 182 #endif | |
| 183 | |
| 184 #if ENABLE(SHADOW_DOM) | |
| 185 bool RuntimeEnabledFeatures::isShadowDOMEnabled = false; | |
| 186 | |
| 187 bool RuntimeEnabledFeatures::isAuthorShadowDOMForAnyElementEnabled = false; | |
| 188 #endif | |
| 189 | |
| 190 #if ENABLE(CUSTOM_ELEMENTS) | |
| 191 bool RuntimeEnabledFeatures::isCustomDOMElementsEnabled = false; | |
| 192 #endif | |
| 193 | |
| 194 #if ENABLE(STYLE_SCOPED) | |
| 195 bool RuntimeEnabledFeatures::isStyleScopedEnabled = false; | |
| 196 #endif | |
| 197 | |
| 198 #if ENABLE(INPUT_TYPE_DATE) | |
| 199 bool RuntimeEnabledFeatures::isInputTypeDateEnabled = true; | |
| 200 #endif | |
| 201 | |
| 202 #if ENABLE(INPUT_TYPE_DATETIME_INCOMPLETE) | |
| 203 bool RuntimeEnabledFeatures::isInputTypeDateTimeEnabled = false; | |
| 204 #endif | |
| 205 | |
| 206 #if ENABLE(INPUT_TYPE_DATETIMELOCAL) | |
| 207 bool RuntimeEnabledFeatures::isInputTypeDateTimeLocalEnabled = true; | |
| 208 #endif | |
| 209 | |
| 210 #if ENABLE(INPUT_TYPE_MONTH) | |
| 211 bool RuntimeEnabledFeatures::isInputTypeMonthEnabled = true; | |
| 212 #endif | |
| 213 | |
| 214 #if ENABLE(INPUT_TYPE_TIME) | |
| 215 bool RuntimeEnabledFeatures::isInputTypeTimeEnabled = true; | |
| 216 #endif | |
| 217 | |
| 218 #if ENABLE(INPUT_TYPE_WEEK) | |
| 219 bool RuntimeEnabledFeatures::isInputTypeWeekEnabled = true; | |
| 220 #endif | |
| 221 | |
| 222 #if ENABLE(DIALOG_ELEMENT) | |
| 223 bool RuntimeEnabledFeatures::isDialogElementEnabled = false; | |
| 224 #endif | |
| 225 | |
| 226 #if ENABLE(REQUEST_AUTOCOMPLETE) | |
| 227 bool RuntimeEnabledFeatures::isRequestAutocompleteEnabled = false; | |
| 228 #endif | |
| 229 | |
| 230 bool RuntimeEnabledFeatures::areExperimentalContentSecurityPolicyFeaturesEnabled
= false; | |
| 231 | |
| 232 bool RuntimeEnabledFeatures::areSeamlessIFramesEnabled = false; | |
| 233 | |
| 234 #if ENABLE(FONT_LOAD_EVENTS) | |
| 235 bool RuntimeEnabledFeatures::isFontLoadEventsEnabled = false; | |
| 236 #endif | |
| 237 | |
| 238 } // namespace WebCore | |
| OLD | NEW |