Home | History | Annotate | Download | only in page
      1 /*
      2  * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
      3  *           (C) 2006 Graham Dennis (graham.dennis (at) gmail.com)
      4  *
      5  * Redistribution and use in source and binary forms, with or without
      6  * modification, are permitted provided that the following conditions
      7  * are met:
      8  * 1. Redistributions of source code must retain the above copyright
      9  *    notice, this list of conditions and the following disclaimer.
     10  * 2. Redistributions in binary form must reproduce the above copyright
     11  *    notice, this list of conditions and the following disclaimer in the
     12  *    documentation and/or other materials provided with the distribution.
     13  *
     14  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
     15  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     17  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
     18  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     19  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     20  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
     21  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
     22  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     24  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     25  */
     26 
     27 #ifndef Settings_h
     28 #define Settings_h
     29 
     30 #include "EditingBehaviorTypes.h"
     31 #include "FontRenderingMode.h"
     32 #include "KURL.h"
     33 #include <wtf/text/AtomicString.h>
     34 
     35 namespace WebCore {
     36 
     37     class Page;
     38 
     39     enum EditableLinkBehavior {
     40         EditableLinkDefaultBehavior,
     41         EditableLinkAlwaysLive,
     42         EditableLinkOnlyLiveWithShiftKey,
     43         EditableLinkLiveWhenNotFocused,
     44         EditableLinkNeverLive
     45     };
     46 
     47     enum TextDirectionSubmenuInclusionBehavior {
     48         TextDirectionSubmenuNeverIncluded,
     49         TextDirectionSubmenuAutomaticallyIncluded,
     50         TextDirectionSubmenuAlwaysIncluded
     51     };
     52 
     53     class Settings {
     54         WTF_MAKE_NONCOPYABLE(Settings); WTF_MAKE_FAST_ALLOCATED;
     55     public:
     56         Settings(Page*);
     57 
     58 #ifdef ANDROID_LAYOUT
     59         // FIXME: How do we determine the margins other than guessing?
     60         #define ANDROID_SSR_MARGIN_PADDING  3
     61         #define ANDROID_FCTS_MARGIN_PADDING  10
     62 
     63         enum LayoutAlgorithm {
     64             kLayoutNormal,
     65             kLayoutSSR,
     66             kLayoutFitColumnToScreen
     67         };
     68 #endif
     69         void setStandardFontFamily(const AtomicString&);
     70         const AtomicString& standardFontFamily() const { return m_standardFontFamily; }
     71 
     72         void setFixedFontFamily(const AtomicString&);
     73         const AtomicString& fixedFontFamily() const { return m_fixedFontFamily; }
     74 
     75 #ifdef ANDROID_LAYOUT
     76         LayoutAlgorithm layoutAlgorithm() const { return m_layoutAlgorithm; }
     77         void setLayoutAlgorithm(LayoutAlgorithm algorithm) { m_layoutAlgorithm = algorithm; }
     78 
     79         bool useWideViewport() const { return m_useWideViewport; }
     80         void setUseWideViewport(bool use) { m_useWideViewport = use; }
     81 #endif
     82 
     83         void setSerifFontFamily(const AtomicString&);
     84         const AtomicString& serifFontFamily() const { return m_serifFontFamily; }
     85 
     86         void setSansSerifFontFamily(const AtomicString&);
     87         const AtomicString& sansSerifFontFamily() const { return m_sansSerifFontFamily; }
     88 
     89         void setCursiveFontFamily(const AtomicString&);
     90         const AtomicString& cursiveFontFamily() const { return m_cursiveFontFamily; }
     91 
     92         void setFantasyFontFamily(const AtomicString&);
     93         const AtomicString& fantasyFontFamily() const { return m_fantasyFontFamily; }
     94 
     95         void setMinimumFontSize(int);
     96         int minimumFontSize() const { return m_minimumFontSize; }
     97 
     98         void setMinimumLogicalFontSize(int);
     99         int minimumLogicalFontSize() const { return m_minimumLogicalFontSize; }
    100 
    101         void setDefaultFontSize(int);
    102         int defaultFontSize() const { return m_defaultFontSize; }
    103 
    104         void setDefaultFixedFontSize(int);
    105         int defaultFixedFontSize() const { return m_defaultFixedFontSize; }
    106 
    107         // Unlike areImagesEnabled, this only suppresses the network load of
    108         // the image URL.  A cached image will still be rendered if requested.
    109         void setLoadsImagesAutomatically(bool);
    110         bool loadsImagesAutomatically() const { return m_loadsImagesAutomatically; }
    111 
    112         // This setting only affects site icon image loading if loadsImagesAutomatically setting is false and this setting is true.
    113         // All other permutations still heed loadsImagesAutomatically setting.
    114         void setLoadsSiteIconsIgnoringImageLoadingSetting(bool);
    115         bool loadsSiteIconsIgnoringImageLoadingSetting() const { return m_loadsSiteIconsIgnoringImageLoadingSetting; }
    116 
    117         void setJavaScriptEnabled(bool);
    118         // Instead of calling isJavaScriptEnabled directly, please consider calling
    119         // ScriptController::canExecuteScripts, which takes things like the
    120         // HTML sandbox attribute into account.
    121         bool isJavaScriptEnabled() const { return m_isJavaScriptEnabled; }
    122 
    123         void setWebSecurityEnabled(bool);
    124         bool isWebSecurityEnabled() const { return m_isWebSecurityEnabled; }
    125 
    126         void setAllowUniversalAccessFromFileURLs(bool);
    127         bool allowUniversalAccessFromFileURLs() const { return m_allowUniversalAccessFromFileURLs; }
    128 
    129         void setAllowFileAccessFromFileURLs(bool);
    130         bool allowFileAccessFromFileURLs() const { return m_allowFileAccessFromFileURLs; }
    131 
    132         void setJavaScriptCanOpenWindowsAutomatically(bool);
    133         bool javaScriptCanOpenWindowsAutomatically() const { return m_javaScriptCanOpenWindowsAutomatically; }
    134 
    135         void setJavaScriptCanAccessClipboard(bool);
    136         bool javaScriptCanAccessClipboard() const { return m_javaScriptCanAccessClipboard; }
    137 
    138         void setSpatialNavigationEnabled(bool);
    139         bool isSpatialNavigationEnabled() const { return m_isSpatialNavigationEnabled; }
    140 
    141         void setJavaEnabled(bool);
    142         bool isJavaEnabled() const { return m_isJavaEnabled; }
    143 
    144         void setImagesEnabled(bool);
    145         bool areImagesEnabled() const { return m_areImagesEnabled; }
    146 
    147         void setMediaEnabled(bool);
    148         bool isMediaEnabled() const { return m_isMediaEnabled; }
    149 
    150         void setPluginsEnabled(bool);
    151         bool arePluginsEnabled() const { return m_arePluginsEnabled; }
    152 
    153 #ifdef ANDROID_PLUGINS
    154         void setPluginsOnDemand(bool onDemand) { m_pluginsOnDemand = onDemand; }
    155         bool arePluginsOnDemand() const { return m_pluginsOnDemand; }
    156 #endif
    157 
    158         void setLocalStorageEnabled(bool);
    159         bool localStorageEnabled() const { return m_localStorageEnabled; }
    160 
    161 #if ENABLE(DOM_STORAGE)
    162         // Allow clients concerned with memory consumption to set a quota on session storage
    163         // since the memory used won't be released until the Page is destroyed.
    164         // Default is noQuota.
    165         void setSessionStorageQuota(unsigned);
    166         unsigned sessionStorageQuota() const { return m_sessionStorageQuota; }
    167 #endif
    168 
    169         // When this option is set, WebCore will avoid storing any record of browsing activity
    170         // that may persist on disk or remain displayed when the option is reset.
    171         // This option does not affect the storage of such information in RAM.
    172         // The following functions respect this setting:
    173         //  - HTML5/DOM Storage
    174         //  - Icon Database
    175         //  - Console Messages
    176         //  - MemoryCache
    177         //  - Application Cache
    178         //  - Back/Forward Page History
    179         //  - Page Search Results
    180         //  - HTTP Cookies
    181         //  - Plug-ins (that support NPNVprivateModeBool)
    182         void setPrivateBrowsingEnabled(bool);
    183         bool privateBrowsingEnabled() const { return m_privateBrowsingEnabled; }
    184 
    185         void setCaretBrowsingEnabled(bool);
    186         bool caretBrowsingEnabled() const { return m_caretBrowsingEnabled; }
    187 
    188         void setDefaultTextEncodingName(const String&);
    189         const String& defaultTextEncodingName() const { return m_defaultTextEncodingName; }
    190 
    191         void setUsesEncodingDetector(bool);
    192         bool usesEncodingDetector() const { return m_usesEncodingDetector; }
    193 
    194         void setDNSPrefetchingEnabled(bool);
    195         bool dnsPrefetchingEnabled() const { return m_dnsPrefetchingEnabled; }
    196 
    197         void setUserStyleSheetLocation(const KURL&);
    198         const KURL& userStyleSheetLocation() const { return m_userStyleSheetLocation; }
    199 
    200         void setShouldPrintBackgrounds(bool);
    201         bool shouldPrintBackgrounds() const { return m_shouldPrintBackgrounds; }
    202 
    203         void setTextAreasAreResizable(bool);
    204         bool textAreasAreResizable() const { return m_textAreasAreResizable; }
    205 
    206         void setEditableLinkBehavior(EditableLinkBehavior);
    207         EditableLinkBehavior editableLinkBehavior() const { return m_editableLinkBehavior; }
    208 
    209         void setTextDirectionSubmenuInclusionBehavior(TextDirectionSubmenuInclusionBehavior);
    210         TextDirectionSubmenuInclusionBehavior textDirectionSubmenuInclusionBehavior() const { return m_textDirectionSubmenuInclusionBehavior; }
    211 
    212 #if ENABLE(DASHBOARD_SUPPORT)
    213         void setUsesDashboardBackwardCompatibilityMode(bool);
    214         bool usesDashboardBackwardCompatibilityMode() const { return m_usesDashboardBackwardCompatibilityMode; }
    215 #endif
    216 
    217         void setNeedsAdobeFrameReloadingQuirk(bool);
    218         bool needsAcrobatFrameReloadingQuirk() const { return m_needsAdobeFrameReloadingQuirk; }
    219 
    220         void setNeedsKeyboardEventDisambiguationQuirks(bool);
    221         bool needsKeyboardEventDisambiguationQuirks() const { return m_needsKeyboardEventDisambiguationQuirks; }
    222 
    223         void setTreatsAnyTextCSSLinkAsStylesheet(bool);
    224         bool treatsAnyTextCSSLinkAsStylesheet() const { return m_treatsAnyTextCSSLinkAsStylesheet; }
    225 
    226         void setNeedsLeopardMailQuirks(bool);
    227         bool needsLeopardMailQuirks() const { return m_needsLeopardMailQuirks; }
    228 
    229         void setNeedsTigerMailQuirks(bool);
    230         bool needsTigerMailQuirks() const { return m_needsTigerMailQuirks; }
    231 
    232         void setDOMPasteAllowed(bool);
    233         bool isDOMPasteAllowed() const { return m_isDOMPasteAllowed; }
    234 
    235         static void setDefaultMinDOMTimerInterval(double); // Interval specified in seconds.
    236         static double defaultMinDOMTimerInterval();
    237 
    238         void setMinDOMTimerInterval(double); // Per-page; initialized to default value.
    239         double minDOMTimerInterval();
    240 
    241         void setUsesPageCache(bool);
    242         bool usesPageCache() const { return m_usesPageCache; }
    243 
    244         void setShrinksStandaloneImagesToFit(bool);
    245         bool shrinksStandaloneImagesToFit() const { return m_shrinksStandaloneImagesToFit; }
    246 
    247         void setShowsURLsInToolTips(bool);
    248         bool showsURLsInToolTips() const { return m_showsURLsInToolTips; }
    249 
    250         void setFTPDirectoryTemplatePath(const String&);
    251         const String& ftpDirectoryTemplatePath() const { return m_ftpDirectoryTemplatePath; }
    252 
    253         void setForceFTPDirectoryListings(bool);
    254         bool forceFTPDirectoryListings() const { return m_forceFTPDirectoryListings; }
    255 
    256         void setDeveloperExtrasEnabled(bool);
    257         bool developerExtrasEnabled() const { return m_developerExtrasEnabled; }
    258 
    259         void setFrameFlatteningEnabled(bool);
    260         bool frameFlatteningEnabled() const { return m_frameFlatteningEnabled; }
    261 
    262 #ifdef ANDROID_META_SUPPORT
    263         void resetMetadataSettings();
    264         void setMetadataSettings(const String& key, const String& value);
    265 
    266         void setViewportWidth(int);
    267         int viewportWidth() const { return m_viewport_width; }
    268 
    269         void setViewportHeight(int);
    270         int viewportHeight() const { return m_viewport_height; }
    271 
    272         void setViewportInitialScale(int);
    273         int viewportInitialScale() const { return m_viewport_initial_scale; }
    274 
    275         void setViewportMinimumScale(int);
    276         int viewportMinimumScale() const { return m_viewport_minimum_scale; }
    277 
    278         void setViewportMaximumScale(int);
    279         int viewportMaximumScale() const { return m_viewport_maximum_scale; }
    280 
    281         void setViewportUserScalable(bool);
    282         bool viewportUserScalable() const { return m_viewport_user_scalable; }
    283 
    284         void setViewportTargetDensityDpi(int);
    285         int viewportTargetDensityDpi() const { return m_viewport_target_densitydpi; }
    286 
    287         void setFormatDetectionAddress(bool);
    288         bool formatDetectionAddress() const { return m_format_detection_address; }
    289 
    290         void setFormatDetectionEmail(bool);
    291         bool formatDetectionEmail() const { return m_format_detection_email; }
    292 
    293         void setFormatDetectionTelephone(bool);
    294         bool formatDetectionTelephone() const { return m_format_detection_telephone; }
    295 
    296         void setDefaultFormatDetection(bool flag) { m_default_format_detection = flag; }
    297 #endif
    298 #ifdef ANDROID_MULTIPLE_WINDOWS
    299         bool supportMultipleWindows() const { return m_supportMultipleWindows; }
    300         void setSupportMultipleWindows(bool support) { m_supportMultipleWindows = support; }
    301 #endif
    302         void setAuthorAndUserStylesEnabled(bool);
    303         bool authorAndUserStylesEnabled() const { return m_authorAndUserStylesEnabled; }
    304 
    305         void setFontRenderingMode(FontRenderingMode mode);
    306         FontRenderingMode fontRenderingMode() const;
    307 
    308         void setNeedsSiteSpecificQuirks(bool);
    309         bool needsSiteSpecificQuirks() const { return m_needsSiteSpecificQuirks; }
    310 
    311 #if ENABLE(WEB_ARCHIVE)
    312         void setWebArchiveDebugModeEnabled(bool);
    313         bool webArchiveDebugModeEnabled() const { return m_webArchiveDebugModeEnabled; }
    314 #endif
    315 
    316         void setLocalFileContentSniffingEnabled(bool);
    317         bool localFileContentSniffingEnabled() const { return m_localFileContentSniffingEnabled; }
    318 
    319         void setLocalStorageDatabasePath(const String&);
    320         const String& localStorageDatabasePath() const { return m_localStorageDatabasePath; }
    321 
    322         void setApplicationChromeMode(bool);
    323         bool inApplicationChromeMode() const { return m_inApplicationChromeMode; }
    324 
    325         void setOfflineWebApplicationCacheEnabled(bool);
    326         bool offlineWebApplicationCacheEnabled() const { return m_offlineWebApplicationCacheEnabled; }
    327 
    328         void setShouldPaintCustomScrollbars(bool);
    329         bool shouldPaintCustomScrollbars() const { return m_shouldPaintCustomScrollbars; }
    330 
    331         void setEnforceCSSMIMETypeInNoQuirksMode(bool);
    332         bool enforceCSSMIMETypeInNoQuirksMode() { return m_enforceCSSMIMETypeInNoQuirksMode; }
    333 
    334         void setMaximumDecodedImageSize(size_t size) { m_maximumDecodedImageSize = size; }
    335         size_t maximumDecodedImageSize() const { return m_maximumDecodedImageSize; }
    336 
    337 #if USE(SAFARI_THEME)
    338         // Windows debugging pref (global) for switching between the Aqua look and a native windows look.
    339         static void setShouldPaintNativeControls(bool);
    340         static bool shouldPaintNativeControls() { return gShouldPaintNativeControls; }
    341 #endif
    342 
    343         void setAllowScriptsToCloseWindows(bool);
    344         bool allowScriptsToCloseWindows() const { return m_allowScriptsToCloseWindows; }
    345 
    346         void setEditingBehaviorType(EditingBehaviorType behavior) { m_editingBehaviorType = behavior; }
    347         EditingBehaviorType editingBehaviorType() const { return static_cast<EditingBehaviorType>(m_editingBehaviorType); }
    348 
    349         void setDownloadableBinaryFontsEnabled(bool);
    350         bool downloadableBinaryFontsEnabled() const { return m_downloadableBinaryFontsEnabled; }
    351 
    352         void setXSSAuditorEnabled(bool);
    353         bool xssAuditorEnabled() const { return m_xssAuditorEnabled; }
    354 
    355         void setCanvasUsesAcceleratedDrawing(bool);
    356         bool canvasUsesAcceleratedDrawing() const { return m_canvasUsesAcceleratedDrawing; }
    357 
    358         void setAcceleratedDrawingEnabled(bool);
    359         bool acceleratedDrawingEnabled() const { return m_acceleratedDrawingEnabled; }
    360 
    361         void setAcceleratedCompositingEnabled(bool);
    362         bool acceleratedCompositingEnabled() const { return m_acceleratedCompositingEnabled; }
    363 
    364         void setAcceleratedCompositingFor3DTransformsEnabled(bool);
    365         bool acceleratedCompositingFor3DTransformsEnabled() const { return m_acceleratedCompositingFor3DTransformsEnabled; }
    366 
    367         void setAcceleratedCompositingForVideoEnabled(bool);
    368         bool acceleratedCompositingForVideoEnabled() const { return m_acceleratedCompositingForVideoEnabled; }
    369 
    370         void setAcceleratedCompositingForPluginsEnabled(bool);
    371         bool acceleratedCompositingForPluginsEnabled() const { return m_acceleratedCompositingForPluginsEnabled; }
    372 
    373         void setAcceleratedCompositingForCanvasEnabled(bool);
    374         bool acceleratedCompositingForCanvasEnabled() const { return m_acceleratedCompositingForCanvasEnabled; }
    375 
    376         void setAcceleratedCompositingForAnimationEnabled(bool);
    377         bool acceleratedCompositingForAnimationEnabled() const { return m_acceleratedCompositingForAnimationEnabled; }
    378 
    379         void setShowDebugBorders(bool);
    380         bool showDebugBorders() const { return m_showDebugBorders; }
    381 
    382         void setShowRepaintCounter(bool);
    383         bool showRepaintCounter() const { return m_showRepaintCounter; }
    384 
    385         void setExperimentalNotificationsEnabled(bool);
    386         bool experimentalNotificationsEnabled() const { return m_experimentalNotificationsEnabled; }
    387 
    388 #if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
    389         static void setShouldUseHighResolutionTimers(bool);
    390         static bool shouldUseHighResolutionTimers() { return gShouldUseHighResolutionTimers; }
    391 #endif
    392 
    393         void setPluginAllowedRunTime(unsigned);
    394         unsigned pluginAllowedRunTime() const { return m_pluginAllowedRunTime; }
    395 
    396         void setWebAudioEnabled(bool);
    397         bool webAudioEnabled() const { return m_webAudioEnabled; }
    398 
    399         void setWebGLEnabled(bool);
    400         bool webGLEnabled() const { return m_webGLEnabled; }
    401 
    402         void setOpenGLMultisamplingEnabled(bool);
    403         bool openGLMultisamplingEnabled() const { return m_openGLMultisamplingEnabled; }
    404 
    405         void setAccelerated2dCanvasEnabled(bool);
    406         bool accelerated2dCanvasEnabled() const { return m_acceleratedCanvas2dEnabled; }
    407 
    408         void setLoadDeferringEnabled(bool);
    409         bool loadDeferringEnabled() const { return m_loadDeferringEnabled; }
    410 
    411         void setTiledBackingStoreEnabled(bool);
    412         bool tiledBackingStoreEnabled() const { return m_tiledBackingStoreEnabled; }
    413 
    414         void setPaginateDuringLayoutEnabled(bool flag) { m_paginateDuringLayoutEnabled = flag; }
    415         bool paginateDuringLayoutEnabled() const { return m_paginateDuringLayoutEnabled; }
    416 
    417 #if ENABLE(FULLSCREEN_API)
    418         void setFullScreenEnabled(bool flag) { m_fullScreenAPIEnabled = flag; }
    419         bool fullScreenEnabled() const  { return m_fullScreenAPIEnabled; }
    420 #endif
    421 
    422         void setAsynchronousSpellCheckingEnabled(bool flag) { m_asynchronousSpellCheckingEnabled = flag; }
    423         bool asynchronousSpellCheckingEnabled() const  { return m_asynchronousSpellCheckingEnabled; }
    424 
    425         void setMemoryInfoEnabled(bool flag) { m_memoryInfoEnabled = flag; }
    426         bool memoryInfoEnabled() const { return m_memoryInfoEnabled; }
    427 
    428         // This setting will be removed when an HTML5 compatibility issue is
    429         // resolved and WebKit implementation of interactive validation is
    430         // completed. See http://webkit.org/b/40520, http://webkit.org/b/40747,
    431         // and http://webkit.org/b/40908
    432         void setInteractiveFormValidationEnabled(bool flag) { m_interactiveFormValidation = flag; }
    433         bool interactiveFormValidationEnabled() const { return m_interactiveFormValidation; }
    434 
    435         // Sets the maginication value for validation message timer.
    436         // If the maginication value is N, a validation message disappears
    437         // automatically after <message length> * N / 1000 seconds. If N is
    438         // equal to or less than 0, a validation message doesn't disappears
    439         // automaticaly. The default value is 50.
    440         void setValidationMessageTimerMagnification(int newValue) { m_validationMessageTimerMagnification = newValue; }
    441         int validationMessageTimerMaginification() const { return m_validationMessageTimerMagnification; }
    442 
    443         void setUsePreHTML5ParserQuirks(bool flag) { m_usePreHTML5ParserQuirks = flag; }
    444         bool usePreHTML5ParserQuirks() const { return m_usePreHTML5ParserQuirks; }
    445 
    446         void setHyperlinkAuditingEnabled(bool flag) { m_hyperlinkAuditingEnabled = flag; }
    447         bool hyperlinkAuditingEnabled() const { return m_hyperlinkAuditingEnabled; }
    448 
    449         void setCrossOriginCheckInGetMatchedCSSRulesDisabled(bool flag) { m_crossOriginCheckInGetMatchedCSSRulesDisabled = flag; }
    450         bool crossOriginCheckInGetMatchedCSSRulesDisabled() const { return m_crossOriginCheckInGetMatchedCSSRulesDisabled; }
    451 
    452         void setUseQuickLookResourceCachingQuirks(bool flag) { m_useQuickLookResourceCachingQuirks = flag; }
    453         bool useQuickLookResourceCachingQuirks() const { return m_useQuickLookResourceCachingQuirks; }
    454 
    455         void setForceCompositingMode(bool flag) { m_forceCompositingMode = flag; }
    456         bool forceCompositingMode() { return m_forceCompositingMode; }
    457 
    458         void setShouldInjectUserScriptsInInitialEmptyDocument(bool flag) { m_shouldInjectUserScriptsInInitialEmptyDocument = flag; }
    459         bool shouldInjectUserScriptsInInitialEmptyDocument() { return m_shouldInjectUserScriptsInInitialEmptyDocument; }
    460 
    461 #if ENABLE(WEB_AUTOFILL)
    462         void setAutoFillEnabled(bool flag) { m_autoFillEnabled = flag; }
    463         bool autoFillEnabled() { return m_autoFillEnabled; }
    464 #endif
    465 
    466 #ifdef ANDROID_BLOCK_NETWORK_IMAGE
    467         void setBlockNetworkImage(bool);
    468         bool blockNetworkImage() const { return m_blockNetworkImage; }
    469 #endif
    470 
    471     private:
    472         Page* m_page;
    473 
    474         String m_defaultTextEncodingName;
    475         String m_ftpDirectoryTemplatePath;
    476         String m_localStorageDatabasePath;
    477         KURL m_userStyleSheetLocation;
    478         AtomicString m_standardFontFamily;
    479         AtomicString m_fixedFontFamily;
    480         AtomicString m_serifFontFamily;
    481         AtomicString m_sansSerifFontFamily;
    482         AtomicString m_cursiveFontFamily;
    483         AtomicString m_fantasyFontFamily;
    484         EditableLinkBehavior m_editableLinkBehavior;
    485         TextDirectionSubmenuInclusionBehavior m_textDirectionSubmenuInclusionBehavior;
    486         int m_minimumFontSize;
    487         int m_minimumLogicalFontSize;
    488         int m_defaultFontSize;
    489         int m_defaultFixedFontSize;
    490         int m_validationMessageTimerMagnification;
    491         size_t m_maximumDecodedImageSize;
    492 #if ENABLE(DOM_STORAGE)
    493         unsigned m_sessionStorageQuota;
    494 #endif
    495         unsigned m_pluginAllowedRunTime;
    496         unsigned m_editingBehaviorType;
    497 #ifdef ANDROID_META_SUPPORT
    498         // range is from 200 to 10,000. 0 is a special value means device-width.
    499         // default is -1, which means undefined.
    500         int m_viewport_width;
    501         // range is from 223 to 10,000. 0 is a special value means device-height
    502         // default is -1, which means undefined.
    503         int m_viewport_height;
    504         // range is from 1 to 1000 in percent. default is 0, which means undefined.
    505         int m_viewport_initial_scale;
    506         // range is from 1 to 1000 in percent. default is 0, which means undefined.
    507         int m_viewport_minimum_scale;
    508         // range is from 1 to 1000 in percent. default is 0, which means undefined.
    509         int m_viewport_maximum_scale;
    510 #endif
    511 #ifdef ANDROID_LAYOUT
    512         LayoutAlgorithm m_layoutAlgorithm;
    513 #endif
    514         bool m_isSpatialNavigationEnabled : 1;
    515         bool m_isJavaEnabled : 1;
    516         bool m_loadsImagesAutomatically : 1;
    517         bool m_loadsSiteIconsIgnoringImageLoadingSetting : 1;
    518         bool m_privateBrowsingEnabled : 1;
    519         bool m_caretBrowsingEnabled : 1;
    520         bool m_areImagesEnabled : 1;
    521         bool m_isMediaEnabled : 1;
    522         bool m_arePluginsEnabled : 1;
    523         bool m_localStorageEnabled : 1;
    524         bool m_isJavaScriptEnabled : 1;
    525         bool m_isWebSecurityEnabled : 1;
    526         bool m_allowUniversalAccessFromFileURLs: 1;
    527         bool m_allowFileAccessFromFileURLs: 1;
    528         bool m_javaScriptCanOpenWindowsAutomatically : 1;
    529         bool m_javaScriptCanAccessClipboard : 1;
    530         bool m_shouldPrintBackgrounds : 1;
    531         bool m_textAreasAreResizable : 1;
    532 #if ENABLE(DASHBOARD_SUPPORT)
    533         bool m_usesDashboardBackwardCompatibilityMode : 1;
    534 #endif
    535         bool m_needsAdobeFrameReloadingQuirk : 1;
    536         bool m_needsKeyboardEventDisambiguationQuirks : 1;
    537         bool m_treatsAnyTextCSSLinkAsStylesheet : 1;
    538         bool m_needsLeopardMailQuirks : 1;
    539         bool m_needsTigerMailQuirks : 1;
    540         bool m_isDOMPasteAllowed : 1;
    541         bool m_shrinksStandaloneImagesToFit : 1;
    542         bool m_usesPageCache: 1;
    543         bool m_showsURLsInToolTips : 1;
    544         bool m_forceFTPDirectoryListings : 1;
    545         bool m_developerExtrasEnabled : 1;
    546         bool m_authorAndUserStylesEnabled : 1;
    547         bool m_needsSiteSpecificQuirks : 1;
    548         unsigned m_fontRenderingMode : 1;
    549         bool m_frameFlatteningEnabled : 1;
    550         bool m_webArchiveDebugModeEnabled : 1;
    551         bool m_localFileContentSniffingEnabled : 1;
    552         bool m_inApplicationChromeMode : 1;
    553         bool m_offlineWebApplicationCacheEnabled : 1;
    554         bool m_shouldPaintCustomScrollbars : 1;
    555         bool m_enforceCSSMIMETypeInNoQuirksMode : 1;
    556         bool m_usesEncodingDetector : 1;
    557         bool m_allowScriptsToCloseWindows : 1;
    558         bool m_canvasUsesAcceleratedDrawing : 1;
    559         bool m_acceleratedDrawingEnabled : 1;
    560         bool m_downloadableBinaryFontsEnabled : 1;
    561         bool m_xssAuditorEnabled : 1;
    562         bool m_acceleratedCompositingEnabled : 1;
    563         bool m_acceleratedCompositingFor3DTransformsEnabled : 1;
    564         bool m_acceleratedCompositingForVideoEnabled : 1;
    565         bool m_acceleratedCompositingForPluginsEnabled : 1;
    566         bool m_acceleratedCompositingForCanvasEnabled : 1;
    567         bool m_acceleratedCompositingForAnimationEnabled : 1;
    568         bool m_showDebugBorders : 1;
    569         bool m_showRepaintCounter : 1;
    570         bool m_experimentalNotificationsEnabled : 1;
    571         bool m_webGLEnabled : 1;
    572         bool m_openGLMultisamplingEnabled : 1;
    573         bool m_webAudioEnabled : 1;
    574         bool m_acceleratedCanvas2dEnabled : 1;
    575         bool m_loadDeferringEnabled : 1;
    576         bool m_tiledBackingStoreEnabled : 1;
    577         bool m_paginateDuringLayoutEnabled : 1;
    578         bool m_dnsPrefetchingEnabled : 1;
    579 #if ENABLE(FULLSCREEN_API)
    580         bool m_fullScreenAPIEnabled : 1;
    581 #endif
    582         bool m_asynchronousSpellCheckingEnabled: 1;
    583         bool m_memoryInfoEnabled: 1;
    584         bool m_interactiveFormValidation: 1;
    585         bool m_usePreHTML5ParserQuirks: 1;
    586         bool m_hyperlinkAuditingEnabled : 1;
    587         bool m_crossOriginCheckInGetMatchedCSSRulesDisabled : 1;
    588         bool m_useQuickLookResourceCachingQuirks : 1;
    589         bool m_forceCompositingMode : 1;
    590         bool m_shouldInjectUserScriptsInInitialEmptyDocument : 1;
    591 #ifdef ANDROID_META_SUPPORT
    592         // default is yes
    593         bool m_viewport_user_scalable : 1;
    594         // range is from 70 to 400. 0 is a special value means device-dpi
    595         // default is -1, which means undefined.
    596         int m_viewport_target_densitydpi;
    597         // default is yes
    598         bool m_format_detection_telephone : 1;
    599         // default is yes
    600         bool m_format_detection_address : 1;
    601         // default is yes
    602         bool m_format_detection_email : 1;
    603         bool m_default_format_detection : 1;
    604 #endif
    605 #ifdef ANDROID_LAYOUT
    606         bool m_useWideViewport : 1;
    607 #endif
    608 #ifdef ANDROID_MULTIPLE_WINDOWS
    609         bool m_supportMultipleWindows : 1;
    610 #endif
    611 #ifdef ANDROID_BLOCK_NETWORK_IMAGE
    612         bool m_blockNetworkImage : 1;
    613 #endif
    614 #if ENABLE(WEB_AUTOFILL)
    615         bool m_autoFillEnabled: 1;
    616 #endif
    617 #ifdef ANDROID_PLUGINS
    618         bool m_pluginsOnDemand : 1;
    619 #endif
    620 
    621 #if USE(SAFARI_THEME)
    622         static bool gShouldPaintNativeControls;
    623 #endif
    624 #if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
    625         static bool gShouldUseHighResolutionTimers;
    626 #endif
    627     };
    628 
    629 } // namespace WebCore
    630 
    631 #endif // Settings_h
    632