RuntimeEnabledFeatures.h [plain text]
#ifndef RuntimeEnabledFeatures_h
#define RuntimeEnabledFeatures_h
namespace WebCore {
class RuntimeEnabledFeatures {
public:
static void setLocalStorageEnabled(bool isEnabled) { isLocalStorageEnabled = isEnabled; }
static bool localStorageEnabled() { return isLocalStorageEnabled; }
static void setSessionStorageEnabled(bool isEnabled) { isSessionStorageEnabled = isEnabled; }
static bool sessionStorageEnabled() { return isSessionStorageEnabled; }
static void setWebkitNotificationsEnabled(bool isEnabled) { isWebkitNotificationsEnabled = isEnabled; }
static bool webkitNotificationsEnabled() { return isWebkitNotificationsEnabled; }
static void setApplicationCacheEnabled(bool isEnabled) { isApplicationCacheEnabled = isEnabled; }
static bool applicationCacheEnabled() { return isApplicationCacheEnabled; }
static void setGeolocationEnabled(bool isEnabled) { isGeolocationEnabled = isEnabled; }
static bool geolocationEnabled() { return isGeolocationEnabled; }
static void setIndexedDBEnabled(bool isEnabled) { isIndexedDBEnabled = isEnabled; }
static bool indexedDBEnabled() { return isIndexedDBEnabled; }
#if ENABLE(VIDEO)
static bool audioEnabled();
static bool htmlMediaElementEnabled();
static bool htmlAudioElementEnabled();
static bool htmlVideoElementEnabled();
static bool mediaErrorEnabled();
#endif
#if ENABLE(SHARED_WORKERS)
static bool sharedWorkerEnabled();
#endif
#if ENABLE(WEB_SOCKETS)
static bool webSocketEnabled();
#endif
#if ENABLE(DATABASE)
static bool openDatabaseEnabled();
#endif
#if ENABLE(3D_CANVAS)
static void setWebGLEnabled(bool isEnabled) { isWebGLEnabled = isEnabled; }
static bool webGLRenderingContextEnabled() { return isWebGLEnabled; }
static bool webGLArrayBufferEnabled() { return isWebGLEnabled; }
static bool webGLByteArrayEnabled() { return isWebGLEnabled; }
static bool webGLUnsignedByteArrayEnabled() { return isWebGLEnabled; }
static bool webGLShortArrayEnabled() { return isWebGLEnabled; }
static bool webGLUnsignedShortArrayEnabled() { return isWebGLEnabled; }
static bool webGLIntArrayEnabled() { return isWebGLEnabled; }
static bool webGLUnsignedIntArrayEnabled() { return isWebGLEnabled; }
static bool webGLFloatArrayEnabled() { return isWebGLEnabled; }
#endif
static void setPushStateEnabled(bool isEnabled) { isPushStateEnabled = isEnabled; }
static bool pushStateEnabled() { return isPushStateEnabled; }
static bool replaceStateEnabled() { return isPushStateEnabled; }
static bool touchEnabled() { return isTouchEnabled; }
static void setTouchEnabled(bool isEnabled) { isTouchEnabled = isEnabled; }
static bool ontouchstartEnabled() { return isTouchEnabled; }
static bool ontouchmoveEnabled() { return isTouchEnabled; }
static bool ontouchendEnabled() { return isTouchEnabled; }
static bool ontouchcancelEnabled() { return isTouchEnabled; }
static void setDeviceMotionEnabled(bool isEnabled) { isDeviceMotionEnabled = isEnabled; }
static bool deviceMotionEnabled() { return isDeviceMotionEnabled; }
static bool deviceMotionEventEnabled() { return isDeviceMotionEnabled; }
static bool ondevicemotionEnabled() { return isDeviceMotionEnabled; }
static void setDeviceOrientationEnabled(bool isEnabled) { isDeviceOrientationEnabled = isEnabled; }
static bool deviceOrientationEnabled() { return isDeviceOrientationEnabled; }
static bool deviceOrientationEventEnabled() { return isDeviceOrientationEnabled; }
static bool ondeviceorientationEnabled() { return isDeviceOrientationEnabled; }
private:
RuntimeEnabledFeatures() { }
static bool isLocalStorageEnabled;
static bool isSessionStorageEnabled;
static bool isWebkitNotificationsEnabled;
static bool isApplicationCacheEnabled;
static bool isGeolocationEnabled;
static bool isIndexedDBEnabled;
static bool isWebGLEnabled;
static bool isPushStateEnabled;
static bool isTouchEnabled;
static bool isDeviceMotionEnabled;
static bool isDeviceOrientationEnabled;
};
}
#endif // RuntimeEnabledFeatures_h