Home | History | Annotate | Download | only in web
      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 WebKit {
     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     WEBKIT_EXPORT static void enableStableFeatures(bool);
     45     WEBKIT_EXPORT static void enableExperimentalFeatures(bool);
     46     WEBKIT_EXPORT static void enableTestOnlyFeatures(bool);
     47 
     48     WEBKIT_EXPORT static void enableApplicationCache(bool);
     49     WEBKIT_EXPORT static bool isApplicationCacheEnabled();
     50 
     51     WEBKIT_EXPORT static void enableDatabase(bool);
     52     WEBKIT_EXPORT static bool isDatabaseEnabled();
     53 
     54     WEBKIT_EXPORT static void enableDeviceMotion(bool);
     55     WEBKIT_EXPORT static bool isDeviceMotionEnabled();
     56 
     57     WEBKIT_EXPORT static void enableDeviceOrientation(bool);
     58     WEBKIT_EXPORT static bool isDeviceOrientationEnabled();
     59 
     60     WEBKIT_EXPORT static void enableEncryptedMedia(bool);
     61     WEBKIT_EXPORT static bool isEncryptedMediaEnabled();
     62 
     63     WEBKIT_EXPORT static void enableLegacyEncryptedMedia(bool);
     64     WEBKIT_EXPORT static bool isLegacyEncryptedMediaEnabled();
     65 
     66     WEBKIT_EXPORT static void enableExperimentalCanvasFeatures(bool);
     67     WEBKIT_EXPORT static bool isExperimentalCanvasFeaturesEnabled();
     68 
     69     WEBKIT_EXPORT static void enableFileSystem(bool);
     70     WEBKIT_EXPORT static bool isFileSystemEnabled();
     71 
     72     WEBKIT_EXPORT static void enableFullscreen(bool);
     73     WEBKIT_EXPORT static bool isFullscreenEnabled();
     74 
     75     WEBKIT_EXPORT static void enableGamepad(bool);
     76     WEBKIT_EXPORT static bool isGamepadEnabled();
     77 
     78     WEBKIT_EXPORT static void enableGeolocation(bool);
     79     WEBKIT_EXPORT static bool isGeolocationEnabled();
     80 
     81     WEBKIT_EXPORT static void enableLazyLayout(bool);
     82     WEBKIT_EXPORT static bool isLazyLayoutEnabled();
     83 
     84     WEBKIT_EXPORT static void enableLocalStorage(bool);
     85     WEBKIT_EXPORT static bool isLocalStorageEnabled();
     86 
     87     WEBKIT_EXPORT static void enableMediaPlayer(bool);
     88     WEBKIT_EXPORT static bool isMediaPlayerEnabled();
     89 
     90     WEBKIT_EXPORT static void enableWebKitMediaSource(bool);
     91     WEBKIT_EXPORT static bool isWebKitMediaSourceEnabled();
     92 
     93     WEBKIT_EXPORT static void enableMediaStream(bool);
     94     WEBKIT_EXPORT static bool isMediaStreamEnabled();
     95 
     96     WEBKIT_EXPORT static void enableNotifications(bool);
     97     WEBKIT_EXPORT static bool isNotificationsEnabled();
     98 
     99     WEBKIT_EXPORT static void enablePagePopup(bool);
    100     WEBKIT_EXPORT static bool isPagePopupEnabled();
    101 
    102     WEBKIT_EXPORT static void enablePeerConnection(bool);
    103     WEBKIT_EXPORT static bool isPeerConnectionEnabled();
    104 
    105     WEBKIT_EXPORT static void enableRequestAutocomplete(bool);
    106     WEBKIT_EXPORT static bool isRequestAutocompleteEnabled();
    107 
    108     WEBKIT_EXPORT static void enableScriptedSpeech(bool);
    109     WEBKIT_EXPORT static bool isScriptedSpeechEnabled();
    110 
    111     WEBKIT_EXPORT static void enableSessionStorage(bool);
    112     WEBKIT_EXPORT static bool isSessionStorageEnabled();
    113 
    114     WEBKIT_EXPORT static void enableSpeechInput(bool);
    115     WEBKIT_EXPORT static bool isSpeechInputEnabled();
    116 
    117     WEBKIT_EXPORT static void enableSpeechSynthesis(bool);
    118     WEBKIT_EXPORT static bool isSpeechSynthesisEnabled();
    119 
    120     WEBKIT_EXPORT static void enableTouch(bool);
    121     WEBKIT_EXPORT static bool isTouchEnabled();
    122 
    123     WEBKIT_EXPORT static void enableWebAnimationsCSS();
    124     WEBKIT_EXPORT static void enableWebAnimationsSVG();
    125 
    126     WEBKIT_EXPORT static void enableWebAudio(bool);
    127     WEBKIT_EXPORT static bool isWebAudioEnabled();
    128 
    129     WEBKIT_EXPORT static void enableWebGLDraftExtensions(bool);
    130     WEBKIT_EXPORT static bool isWebGLDraftExtensionsEnabled();
    131 
    132     WEBKIT_EXPORT static void enableWebMIDI(bool);
    133     WEBKIT_EXPORT static bool isWebMIDIEnabled();
    134 
    135     WEBKIT_EXPORT static void enableDataListElement(bool);
    136     WEBKIT_EXPORT static bool isDataListElementEnabled();
    137 
    138     WEBKIT_EXPORT static void enableHTMLImports(bool);
    139     WEBKIT_EXPORT static bool isHTMLImportsEnabled();
    140 
    141     // FIXME: Remove this when embedders switch to enableEmbedderCustomElements.
    142     WEBKIT_EXPORT static void enableCustomElements(bool);
    143     WEBKIT_EXPORT static void enableEmbedderCustomElements(bool);
    144 
    145     WEBKIT_EXPORT static void enableOverlayScrollbars(bool);
    146 
    147 private:
    148     WebRuntimeFeatures();
    149 };
    150 
    151 } // namespace WebKit
    152 
    153 #endif
    154