1 /* 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved. 3 * (C) 2006 Graham Dennis (graham.dennis@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&); standardFontFamily()70 const AtomicString& standardFontFamily() const { return m_standardFontFamily; } 71 72 void setFixedFontFamily(const AtomicString&); fixedFontFamily()73 const AtomicString& fixedFontFamily() const { return m_fixedFontFamily; } 74 75 #ifdef ANDROID_LAYOUT layoutAlgorithm()76 LayoutAlgorithm layoutAlgorithm() const { return m_layoutAlgorithm; } setLayoutAlgorithm(LayoutAlgorithm algorithm)77 void setLayoutAlgorithm(LayoutAlgorithm algorithm) { m_layoutAlgorithm = algorithm; } 78 useWideViewport()79 bool useWideViewport() const { return m_useWideViewport; } setUseWideViewport(bool use)80 void setUseWideViewport(bool use) { m_useWideViewport = use; } 81 #endif 82 83 void setSerifFontFamily(const AtomicString&); serifFontFamily()84 const AtomicString& serifFontFamily() const { return m_serifFontFamily; } 85 86 void setSansSerifFontFamily(const AtomicString&); sansSerifFontFamily()87 const AtomicString& sansSerifFontFamily() const { return m_sansSerifFontFamily; } 88 89 void setCursiveFontFamily(const AtomicString&); cursiveFontFamily()90 const AtomicString& cursiveFontFamily() const { return m_cursiveFontFamily; } 91 92 void setFantasyFontFamily(const AtomicString&); fantasyFontFamily()93 const AtomicString& fantasyFontFamily() const { return m_fantasyFontFamily; } 94 95 void setMinimumFontSize(int); minimumFontSize()96 int minimumFontSize() const { return m_minimumFontSize; } 97 98 void setMinimumLogicalFontSize(int); minimumLogicalFontSize()99 int minimumLogicalFontSize() const { return m_minimumLogicalFontSize; } 100 101 void setDefaultFontSize(int); defaultFontSize()102 int defaultFontSize() const { return m_defaultFontSize; } 103 104 void setDefaultFixedFontSize(int); defaultFixedFontSize()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); loadsImagesAutomatically()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); loadsSiteIconsIgnoringImageLoadingSetting()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. isJavaScriptEnabled()121 bool isJavaScriptEnabled() const { return m_isJavaScriptEnabled; } 122 123 void setWebSecurityEnabled(bool); isWebSecurityEnabled()124 bool isWebSecurityEnabled() const { return m_isWebSecurityEnabled; } 125 126 void setAllowUniversalAccessFromFileURLs(bool); allowUniversalAccessFromFileURLs()127 bool allowUniversalAccessFromFileURLs() const { return m_allowUniversalAccessFromFileURLs; } 128 129 void setAllowFileAccessFromFileURLs(bool); allowFileAccessFromFileURLs()130 bool allowFileAccessFromFileURLs() const { return m_allowFileAccessFromFileURLs; } 131 132 void setJavaScriptCanOpenWindowsAutomatically(bool); javaScriptCanOpenWindowsAutomatically()133 bool javaScriptCanOpenWindowsAutomatically() const { return m_javaScriptCanOpenWindowsAutomatically; } 134 135 void setJavaScriptCanAccessClipboard(bool); javaScriptCanAccessClipboard()136 bool javaScriptCanAccessClipboard() const { return m_javaScriptCanAccessClipboard; } 137 138 void setSpatialNavigationEnabled(bool); isSpatialNavigationEnabled()139 bool isSpatialNavigationEnabled() const { return m_isSpatialNavigationEnabled; } 140 141 void setJavaEnabled(bool); isJavaEnabled()142 bool isJavaEnabled() const { return m_isJavaEnabled; } 143 144 void setImagesEnabled(bool); areImagesEnabled()145 bool areImagesEnabled() const { return m_areImagesEnabled; } 146 147 void setMediaEnabled(bool); isMediaEnabled()148 bool isMediaEnabled() const { return m_isMediaEnabled; } 149 150 void setPluginsEnabled(bool); arePluginsEnabled()151 bool arePluginsEnabled() const { return m_arePluginsEnabled; } 152 153 #ifdef ANDROID_PLUGINS setPluginsOnDemand(bool onDemand)154 void setPluginsOnDemand(bool onDemand) { m_pluginsOnDemand = onDemand; } arePluginsOnDemand()155 bool arePluginsOnDemand() const { return m_pluginsOnDemand; } 156 #endif 157 158 void setLocalStorageEnabled(bool); localStorageEnabled()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); sessionStorageQuota()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); privateBrowsingEnabled()183 bool privateBrowsingEnabled() const { return m_privateBrowsingEnabled; } 184 185 void setCaretBrowsingEnabled(bool); caretBrowsingEnabled()186 bool caretBrowsingEnabled() const { return m_caretBrowsingEnabled; } 187 188 void setDefaultTextEncodingName(const String&); defaultTextEncodingName()189 const String& defaultTextEncodingName() const { return m_defaultTextEncodingName; } 190 191 void setUsesEncodingDetector(bool); usesEncodingDetector()192 bool usesEncodingDetector() const { return m_usesEncodingDetector; } 193 194 void setDNSPrefetchingEnabled(bool); dnsPrefetchingEnabled()195 bool dnsPrefetchingEnabled() const { return m_dnsPrefetchingEnabled; } 196 197 void setUserStyleSheetLocation(const KURL&); userStyleSheetLocation()198 const KURL& userStyleSheetLocation() const { return m_userStyleSheetLocation; } 199 200 void setShouldPrintBackgrounds(bool); shouldPrintBackgrounds()201 bool shouldPrintBackgrounds() const { return m_shouldPrintBackgrounds; } 202 203 void setTextAreasAreResizable(bool); textAreasAreResizable()204 bool textAreasAreResizable() const { return m_textAreasAreResizable; } 205 206 void setEditableLinkBehavior(EditableLinkBehavior); editableLinkBehavior()207 EditableLinkBehavior editableLinkBehavior() const { return m_editableLinkBehavior; } 208 209 void setTextDirectionSubmenuInclusionBehavior(TextDirectionSubmenuInclusionBehavior); textDirectionSubmenuInclusionBehavior()210 TextDirectionSubmenuInclusionBehavior textDirectionSubmenuInclusionBehavior() const { return m_textDirectionSubmenuInclusionBehavior; } 211 212 #if ENABLE(DASHBOARD_SUPPORT) 213 void setUsesDashboardBackwardCompatibilityMode(bool); usesDashboardBackwardCompatibilityMode()214 bool usesDashboardBackwardCompatibilityMode() const { return m_usesDashboardBackwardCompatibilityMode; } 215 #endif 216 217 void setNeedsAdobeFrameReloadingQuirk(bool); needsAcrobatFrameReloadingQuirk()218 bool needsAcrobatFrameReloadingQuirk() const { return m_needsAdobeFrameReloadingQuirk; } 219 220 void setNeedsKeyboardEventDisambiguationQuirks(bool); needsKeyboardEventDisambiguationQuirks()221 bool needsKeyboardEventDisambiguationQuirks() const { return m_needsKeyboardEventDisambiguationQuirks; } 222 223 void setTreatsAnyTextCSSLinkAsStylesheet(bool); treatsAnyTextCSSLinkAsStylesheet()224 bool treatsAnyTextCSSLinkAsStylesheet() const { return m_treatsAnyTextCSSLinkAsStylesheet; } 225 226 void setNeedsLeopardMailQuirks(bool); needsLeopardMailQuirks()227 bool needsLeopardMailQuirks() const { return m_needsLeopardMailQuirks; } 228 229 void setNeedsTigerMailQuirks(bool); needsTigerMailQuirks()230 bool needsTigerMailQuirks() const { return m_needsTigerMailQuirks; } 231 232 void setDOMPasteAllowed(bool); isDOMPasteAllowed()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); usesPageCache()242 bool usesPageCache() const { return m_usesPageCache; } 243 244 void setShrinksStandaloneImagesToFit(bool); shrinksStandaloneImagesToFit()245 bool shrinksStandaloneImagesToFit() const { return m_shrinksStandaloneImagesToFit; } 246 247 void setShowsURLsInToolTips(bool); showsURLsInToolTips()248 bool showsURLsInToolTips() const { return m_showsURLsInToolTips; } 249 250 void setFTPDirectoryTemplatePath(const String&); ftpDirectoryTemplatePath()251 const String& ftpDirectoryTemplatePath() const { return m_ftpDirectoryTemplatePath; } 252 253 void setForceFTPDirectoryListings(bool); forceFTPDirectoryListings()254 bool forceFTPDirectoryListings() const { return m_forceFTPDirectoryListings; } 255 256 void setDeveloperExtrasEnabled(bool); developerExtrasEnabled()257 bool developerExtrasEnabled() const { return m_developerExtrasEnabled; } 258 259 void setFrameFlatteningEnabled(bool); frameFlatteningEnabled()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); viewportWidth()267 int viewportWidth() const { return m_viewport_width; } 268 269 void setViewportHeight(int); viewportHeight()270 int viewportHeight() const { return m_viewport_height; } 271 272 void setViewportInitialScale(int); viewportInitialScale()273 int viewportInitialScale() const { return m_viewport_initial_scale; } 274 275 void setViewportMinimumScale(int); viewportMinimumScale()276 int viewportMinimumScale() const { return m_viewport_minimum_scale; } 277 278 void setViewportMaximumScale(int); viewportMaximumScale()279 int viewportMaximumScale() const { return m_viewport_maximum_scale; } 280 281 void setViewportUserScalable(bool); viewportUserScalable()282 bool viewportUserScalable() const { return m_viewport_user_scalable; } 283 284 void setViewportTargetDensityDpi(int); viewportTargetDensityDpi()285 int viewportTargetDensityDpi() const { return m_viewport_target_densitydpi; } 286 287 void setFormatDetectionAddress(bool); formatDetectionAddress()288 bool formatDetectionAddress() const { return m_format_detection_address; } 289 290 void setFormatDetectionEmail(bool); formatDetectionEmail()291 bool formatDetectionEmail() const { return m_format_detection_email; } 292 293 void setFormatDetectionTelephone(bool); formatDetectionTelephone()294 bool formatDetectionTelephone() const { return m_format_detection_telephone; } 295 setDefaultFormatDetection(bool flag)296 void setDefaultFormatDetection(bool flag) { m_default_format_detection = flag; } 297 #endif 298 #ifdef ANDROID_MULTIPLE_WINDOWS supportMultipleWindows()299 bool supportMultipleWindows() const { return m_supportMultipleWindows; } setSupportMultipleWindows(bool support)300 void setSupportMultipleWindows(bool support) { m_supportMultipleWindows = support; } 301 #endif 302 void setAuthorAndUserStylesEnabled(bool); authorAndUserStylesEnabled()303 bool authorAndUserStylesEnabled() const { return m_authorAndUserStylesEnabled; } 304 305 void setFontRenderingMode(FontRenderingMode mode); 306 FontRenderingMode fontRenderingMode() const; 307 308 void setNeedsSiteSpecificQuirks(bool); needsSiteSpecificQuirks()309 bool needsSiteSpecificQuirks() const { return m_needsSiteSpecificQuirks; } 310 311 #if ENABLE(WEB_ARCHIVE) 312 void setWebArchiveDebugModeEnabled(bool); webArchiveDebugModeEnabled()313 bool webArchiveDebugModeEnabled() const { return m_webArchiveDebugModeEnabled; } 314 #endif 315 316 void setLocalFileContentSniffingEnabled(bool); localFileContentSniffingEnabled()317 bool localFileContentSniffingEnabled() const { return m_localFileContentSniffingEnabled; } 318 319 void setLocalStorageDatabasePath(const String&); localStorageDatabasePath()320 const String& localStorageDatabasePath() const { return m_localStorageDatabasePath; } 321 322 void setApplicationChromeMode(bool); inApplicationChromeMode()323 bool inApplicationChromeMode() const { return m_inApplicationChromeMode; } 324 325 void setOfflineWebApplicationCacheEnabled(bool); offlineWebApplicationCacheEnabled()326 bool offlineWebApplicationCacheEnabled() const { return m_offlineWebApplicationCacheEnabled; } 327 328 void setShouldPaintCustomScrollbars(bool); shouldPaintCustomScrollbars()329 bool shouldPaintCustomScrollbars() const { return m_shouldPaintCustomScrollbars; } 330 331 void setEnforceCSSMIMETypeInNoQuirksMode(bool); enforceCSSMIMETypeInNoQuirksMode()332 bool enforceCSSMIMETypeInNoQuirksMode() { return m_enforceCSSMIMETypeInNoQuirksMode; } 333 setMaximumDecodedImageSize(size_t size)334 void setMaximumDecodedImageSize(size_t size) { m_maximumDecodedImageSize = size; } maximumDecodedImageSize()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); shouldPaintNativeControls()340 static bool shouldPaintNativeControls() { return gShouldPaintNativeControls; } 341 #endif 342 343 void setAllowScriptsToCloseWindows(bool); allowScriptsToCloseWindows()344 bool allowScriptsToCloseWindows() const { return m_allowScriptsToCloseWindows; } 345 setEditingBehaviorType(EditingBehaviorType behavior)346 void setEditingBehaviorType(EditingBehaviorType behavior) { m_editingBehaviorType = behavior; } editingBehaviorType()347 EditingBehaviorType editingBehaviorType() const { return static_cast<EditingBehaviorType>(m_editingBehaviorType); } 348 349 void setDownloadableBinaryFontsEnabled(bool); downloadableBinaryFontsEnabled()350 bool downloadableBinaryFontsEnabled() const { return m_downloadableBinaryFontsEnabled; } 351 352 void setXSSAuditorEnabled(bool); xssAuditorEnabled()353 bool xssAuditorEnabled() const { return m_xssAuditorEnabled; } 354 355 #if ENABLE(LINK_PREFETCH) 356 void setLinkPrefetchEnabled(bool); linkPrefetchEnabled()357 bool linkPrefetchEnabled() const { return m_linkPrefetchEnabled; } 358 #endif 359 360 void setCanvasUsesAcceleratedDrawing(bool); canvasUsesAcceleratedDrawing()361 bool canvasUsesAcceleratedDrawing() const { return m_canvasUsesAcceleratedDrawing; } 362 363 void setAcceleratedDrawingEnabled(bool); acceleratedDrawingEnabled()364 bool acceleratedDrawingEnabled() const { return m_acceleratedDrawingEnabled; } 365 366 void setAcceleratedCompositingEnabled(bool); acceleratedCompositingEnabled()367 bool acceleratedCompositingEnabled() const { return m_acceleratedCompositingEnabled; } 368 369 void setAcceleratedCompositingFor3DTransformsEnabled(bool); acceleratedCompositingFor3DTransformsEnabled()370 bool acceleratedCompositingFor3DTransformsEnabled() const { return m_acceleratedCompositingFor3DTransformsEnabled; } 371 372 void setAcceleratedCompositingForVideoEnabled(bool); acceleratedCompositingForVideoEnabled()373 bool acceleratedCompositingForVideoEnabled() const { return m_acceleratedCompositingForVideoEnabled; } 374 375 void setAcceleratedCompositingForPluginsEnabled(bool); acceleratedCompositingForPluginsEnabled()376 bool acceleratedCompositingForPluginsEnabled() const { return m_acceleratedCompositingForPluginsEnabled; } 377 378 void setAcceleratedCompositingForCanvasEnabled(bool); acceleratedCompositingForCanvasEnabled()379 bool acceleratedCompositingForCanvasEnabled() const { return m_acceleratedCompositingForCanvasEnabled; } 380 381 void setAcceleratedCompositingForAnimationEnabled(bool); acceleratedCompositingForAnimationEnabled()382 bool acceleratedCompositingForAnimationEnabled() const { return m_acceleratedCompositingForAnimationEnabled; } 383 384 void setShowDebugBorders(bool); showDebugBorders()385 bool showDebugBorders() const { return m_showDebugBorders; } 386 387 void setShowRepaintCounter(bool); showRepaintCounter()388 bool showRepaintCounter() const { return m_showRepaintCounter; } 389 390 void setExperimentalNotificationsEnabled(bool); experimentalNotificationsEnabled()391 bool experimentalNotificationsEnabled() const { return m_experimentalNotificationsEnabled; } 392 393 #if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX)) 394 static void setShouldUseHighResolutionTimers(bool); shouldUseHighResolutionTimers()395 static bool shouldUseHighResolutionTimers() { return gShouldUseHighResolutionTimers; } 396 #endif 397 398 void setPluginAllowedRunTime(unsigned); pluginAllowedRunTime()399 unsigned pluginAllowedRunTime() const { return m_pluginAllowedRunTime; } 400 401 void setWebAudioEnabled(bool); webAudioEnabled()402 bool webAudioEnabled() const { return m_webAudioEnabled; } 403 404 void setWebGLEnabled(bool); webGLEnabled()405 bool webGLEnabled() const { return m_webGLEnabled; } 406 407 void setOpenGLMultisamplingEnabled(bool); openGLMultisamplingEnabled()408 bool openGLMultisamplingEnabled() const { return m_openGLMultisamplingEnabled; } 409 410 void setAccelerated2dCanvasEnabled(bool); accelerated2dCanvasEnabled()411 bool accelerated2dCanvasEnabled() const { return m_acceleratedCanvas2dEnabled; } 412 413 void setLoadDeferringEnabled(bool); loadDeferringEnabled()414 bool loadDeferringEnabled() const { return m_loadDeferringEnabled; } 415 416 void setTiledBackingStoreEnabled(bool); tiledBackingStoreEnabled()417 bool tiledBackingStoreEnabled() const { return m_tiledBackingStoreEnabled; } 418 setPaginateDuringLayoutEnabled(bool flag)419 void setPaginateDuringLayoutEnabled(bool flag) { m_paginateDuringLayoutEnabled = flag; } paginateDuringLayoutEnabled()420 bool paginateDuringLayoutEnabled() const { return m_paginateDuringLayoutEnabled; } 421 422 #if ENABLE(FULLSCREEN_API) setFullScreenEnabled(bool flag)423 void setFullScreenEnabled(bool flag) { m_fullScreenAPIEnabled = flag; } fullScreenEnabled()424 bool fullScreenEnabled() const { return m_fullScreenAPIEnabled; } 425 #endif 426 setAsynchronousSpellCheckingEnabled(bool flag)427 void setAsynchronousSpellCheckingEnabled(bool flag) { m_asynchronousSpellCheckingEnabled = flag; } asynchronousSpellCheckingEnabled()428 bool asynchronousSpellCheckingEnabled() const { return m_asynchronousSpellCheckingEnabled; } 429 setMemoryInfoEnabled(bool flag)430 void setMemoryInfoEnabled(bool flag) { m_memoryInfoEnabled = flag; } memoryInfoEnabled()431 bool memoryInfoEnabled() const { return m_memoryInfoEnabled; } 432 433 // This setting will be removed when an HTML5 compatibility issue is 434 // resolved and WebKit implementation of interactive validation is 435 // completed. See http://webkit.org/b/40520, http://webkit.org/b/40747, 436 // and http://webkit.org/b/40908 setInteractiveFormValidationEnabled(bool flag)437 void setInteractiveFormValidationEnabled(bool flag) { m_interactiveFormValidation = flag; } interactiveFormValidationEnabled()438 bool interactiveFormValidationEnabled() const { return m_interactiveFormValidation; } 439 440 // Sets the maginication value for validation message timer. 441 // If the maginication value is N, a validation message disappears 442 // automatically after <message length> * N / 1000 seconds. If N is 443 // equal to or less than 0, a validation message doesn't disappears 444 // automaticaly. The default value is 50. setValidationMessageTimerMagnification(int newValue)445 void setValidationMessageTimerMagnification(int newValue) { m_validationMessageTimerMagnification = newValue; } validationMessageTimerMaginification()446 int validationMessageTimerMaginification() const { return m_validationMessageTimerMagnification; } 447 setUsePreHTML5ParserQuirks(bool flag)448 void setUsePreHTML5ParserQuirks(bool flag) { m_usePreHTML5ParserQuirks = flag; } usePreHTML5ParserQuirks()449 bool usePreHTML5ParserQuirks() const { return m_usePreHTML5ParserQuirks; } 450 setHyperlinkAuditingEnabled(bool flag)451 void setHyperlinkAuditingEnabled(bool flag) { m_hyperlinkAuditingEnabled = flag; } hyperlinkAuditingEnabled()452 bool hyperlinkAuditingEnabled() const { return m_hyperlinkAuditingEnabled; } 453 setCrossOriginCheckInGetMatchedCSSRulesDisabled(bool flag)454 void setCrossOriginCheckInGetMatchedCSSRulesDisabled(bool flag) { m_crossOriginCheckInGetMatchedCSSRulesDisabled = flag; } crossOriginCheckInGetMatchedCSSRulesDisabled()455 bool crossOriginCheckInGetMatchedCSSRulesDisabled() const { return m_crossOriginCheckInGetMatchedCSSRulesDisabled; } 456 setUseQuickLookResourceCachingQuirks(bool flag)457 void setUseQuickLookResourceCachingQuirks(bool flag) { m_useQuickLookResourceCachingQuirks = flag; } useQuickLookResourceCachingQuirks()458 bool useQuickLookResourceCachingQuirks() const { return m_useQuickLookResourceCachingQuirks; } 459 setForceCompositingMode(bool flag)460 void setForceCompositingMode(bool flag) { m_forceCompositingMode = flag; } forceCompositingMode()461 bool forceCompositingMode() { return m_forceCompositingMode; } 462 setShouldInjectUserScriptsInInitialEmptyDocument(bool flag)463 void setShouldInjectUserScriptsInInitialEmptyDocument(bool flag) { m_shouldInjectUserScriptsInInitialEmptyDocument = flag; } shouldInjectUserScriptsInInitialEmptyDocument()464 bool shouldInjectUserScriptsInInitialEmptyDocument() { return m_shouldInjectUserScriptsInInitialEmptyDocument; } 465 setPasswordEchoEnabled(bool flag)466 void setPasswordEchoEnabled(bool flag) { m_passwordEchoEnabled = flag; } passwordEchoEnabled()467 bool passwordEchoEnabled() const { return m_passwordEchoEnabled; } 468 setPasswordEchoDurationInSeconds(double durationInSeconds)469 void setPasswordEchoDurationInSeconds(double durationInSeconds) { m_passwordEchoDurationInSeconds = durationInSeconds; } passwordEchoDurationInSeconds()470 double passwordEchoDurationInSeconds() const { return m_passwordEchoDurationInSeconds; } 471 472 #if ENABLE(WEB_AUTOFILL) setAutoFillEnabled(bool flag)473 void setAutoFillEnabled(bool flag) { m_autoFillEnabled = flag; } autoFillEnabled()474 bool autoFillEnabled() { return m_autoFillEnabled; } 475 #endif 476 477 #ifdef ANDROID_BLOCK_NETWORK_IMAGE 478 void setBlockNetworkImage(bool); blockNetworkImage()479 bool blockNetworkImage() const { return m_blockNetworkImage; } 480 #endif 481 setMediaPlaybackRequiresUserGesture(bool flag)482 void setMediaPlaybackRequiresUserGesture(bool flag) { m_mediaPlaybackRequiresUserGesture = flag; }; mediaPlaybackRequiresUserGesture()483 bool mediaPlaybackRequiresUserGesture() const { return m_mediaPlaybackRequiresUserGesture; } 484 setMediaPlaybackAllowsInline(bool flag)485 void setMediaPlaybackAllowsInline(bool flag) { m_mediaPlaybackAllowsInline = flag; }; mediaPlaybackAllowsInline()486 bool mediaPlaybackAllowsInline() const { return m_mediaPlaybackAllowsInline; } 487 488 private: 489 Page* m_page; 490 491 String m_defaultTextEncodingName; 492 String m_ftpDirectoryTemplatePath; 493 String m_localStorageDatabasePath; 494 KURL m_userStyleSheetLocation; 495 AtomicString m_standardFontFamily; 496 AtomicString m_fixedFontFamily; 497 AtomicString m_serifFontFamily; 498 AtomicString m_sansSerifFontFamily; 499 AtomicString m_cursiveFontFamily; 500 AtomicString m_fantasyFontFamily; 501 EditableLinkBehavior m_editableLinkBehavior; 502 TextDirectionSubmenuInclusionBehavior m_textDirectionSubmenuInclusionBehavior; 503 int m_minimumFontSize; 504 int m_minimumLogicalFontSize; 505 int m_defaultFontSize; 506 int m_defaultFixedFontSize; 507 int m_validationMessageTimerMagnification; 508 size_t m_maximumDecodedImageSize; 509 #if ENABLE(DOM_STORAGE) 510 unsigned m_sessionStorageQuota; 511 #endif 512 unsigned m_pluginAllowedRunTime; 513 unsigned m_editingBehaviorType; 514 #ifdef ANDROID_META_SUPPORT 515 // range is from 200 to 10,000. 0 is a special value means device-width. 516 // default is -1, which means undefined. 517 int m_viewport_width; 518 // range is from 223 to 10,000. 0 is a special value means device-height 519 // default is -1, which means undefined. 520 int m_viewport_height; 521 // range is from 1 to 1000 in percent. default is 0, which means undefined. 522 int m_viewport_initial_scale; 523 // range is from 1 to 1000 in percent. default is 0, which means undefined. 524 int m_viewport_minimum_scale; 525 // range is from 1 to 1000 in percent. default is 0, which means undefined. 526 int m_viewport_maximum_scale; 527 #endif 528 #ifdef ANDROID_LAYOUT 529 LayoutAlgorithm m_layoutAlgorithm; 530 #endif 531 double m_passwordEchoDurationInSeconds; 532 533 bool m_isSpatialNavigationEnabled : 1; 534 bool m_isJavaEnabled : 1; 535 bool m_loadsImagesAutomatically : 1; 536 bool m_loadsSiteIconsIgnoringImageLoadingSetting : 1; 537 bool m_privateBrowsingEnabled : 1; 538 bool m_caretBrowsingEnabled : 1; 539 bool m_areImagesEnabled : 1; 540 bool m_isMediaEnabled : 1; 541 bool m_arePluginsEnabled : 1; 542 bool m_localStorageEnabled : 1; 543 bool m_isJavaScriptEnabled : 1; 544 bool m_isWebSecurityEnabled : 1; 545 bool m_allowUniversalAccessFromFileURLs: 1; 546 bool m_allowFileAccessFromFileURLs: 1; 547 bool m_javaScriptCanOpenWindowsAutomatically : 1; 548 bool m_javaScriptCanAccessClipboard : 1; 549 bool m_shouldPrintBackgrounds : 1; 550 bool m_textAreasAreResizable : 1; 551 #if ENABLE(DASHBOARD_SUPPORT) 552 bool m_usesDashboardBackwardCompatibilityMode : 1; 553 #endif 554 bool m_needsAdobeFrameReloadingQuirk : 1; 555 bool m_needsKeyboardEventDisambiguationQuirks : 1; 556 bool m_treatsAnyTextCSSLinkAsStylesheet : 1; 557 bool m_needsLeopardMailQuirks : 1; 558 bool m_needsTigerMailQuirks : 1; 559 bool m_isDOMPasteAllowed : 1; 560 bool m_shrinksStandaloneImagesToFit : 1; 561 bool m_usesPageCache: 1; 562 bool m_showsURLsInToolTips : 1; 563 bool m_forceFTPDirectoryListings : 1; 564 bool m_developerExtrasEnabled : 1; 565 bool m_authorAndUserStylesEnabled : 1; 566 bool m_needsSiteSpecificQuirks : 1; 567 unsigned m_fontRenderingMode : 1; 568 bool m_frameFlatteningEnabled : 1; 569 bool m_webArchiveDebugModeEnabled : 1; 570 bool m_localFileContentSniffingEnabled : 1; 571 bool m_inApplicationChromeMode : 1; 572 bool m_offlineWebApplicationCacheEnabled : 1; 573 bool m_shouldPaintCustomScrollbars : 1; 574 bool m_enforceCSSMIMETypeInNoQuirksMode : 1; 575 bool m_usesEncodingDetector : 1; 576 bool m_allowScriptsToCloseWindows : 1; 577 bool m_canvasUsesAcceleratedDrawing : 1; 578 bool m_acceleratedDrawingEnabled : 1; 579 bool m_downloadableBinaryFontsEnabled : 1; 580 bool m_xssAuditorEnabled : 1; 581 #if ENABLE(LINK_PREFETCH) 582 bool m_linkPrefetchEnabled : 1; 583 #endif 584 bool m_acceleratedCompositingEnabled : 1; 585 bool m_acceleratedCompositingFor3DTransformsEnabled : 1; 586 bool m_acceleratedCompositingForVideoEnabled : 1; 587 bool m_acceleratedCompositingForPluginsEnabled : 1; 588 bool m_acceleratedCompositingForCanvasEnabled : 1; 589 bool m_acceleratedCompositingForAnimationEnabled : 1; 590 bool m_showDebugBorders : 1; 591 bool m_showRepaintCounter : 1; 592 bool m_experimentalNotificationsEnabled : 1; 593 bool m_webGLEnabled : 1; 594 bool m_openGLMultisamplingEnabled : 1; 595 bool m_webAudioEnabled : 1; 596 bool m_acceleratedCanvas2dEnabled : 1; 597 bool m_loadDeferringEnabled : 1; 598 bool m_tiledBackingStoreEnabled : 1; 599 bool m_paginateDuringLayoutEnabled : 1; 600 bool m_dnsPrefetchingEnabled : 1; 601 #if ENABLE(FULLSCREEN_API) 602 bool m_fullScreenAPIEnabled : 1; 603 #endif 604 bool m_asynchronousSpellCheckingEnabled: 1; 605 bool m_memoryInfoEnabled: 1; 606 bool m_interactiveFormValidation: 1; 607 bool m_usePreHTML5ParserQuirks: 1; 608 bool m_hyperlinkAuditingEnabled : 1; 609 bool m_crossOriginCheckInGetMatchedCSSRulesDisabled : 1; 610 bool m_useQuickLookResourceCachingQuirks : 1; 611 bool m_forceCompositingMode : 1; 612 bool m_shouldInjectUserScriptsInInitialEmptyDocument : 1; 613 #ifdef ANDROID_META_SUPPORT 614 // default is yes 615 bool m_viewport_user_scalable : 1; 616 // range is from 70 to 400. 0 is a special value means device-dpi 617 // default is -1, which means undefined. 618 int m_viewport_target_densitydpi; 619 // default is yes 620 bool m_format_detection_telephone : 1; 621 // default is yes 622 bool m_format_detection_address : 1; 623 // default is yes 624 bool m_format_detection_email : 1; 625 bool m_default_format_detection : 1; 626 #endif 627 #ifdef ANDROID_LAYOUT 628 bool m_useWideViewport : 1; 629 #endif 630 #ifdef ANDROID_MULTIPLE_WINDOWS 631 bool m_supportMultipleWindows : 1; 632 #endif 633 #ifdef ANDROID_BLOCK_NETWORK_IMAGE 634 bool m_blockNetworkImage : 1; 635 #endif 636 #if ENABLE(WEB_AUTOFILL) 637 bool m_autoFillEnabled: 1; 638 #endif 639 #ifdef ANDROID_PLUGINS 640 bool m_pluginsOnDemand : 1; 641 #endif 642 bool m_mediaPlaybackRequiresUserGesture : 1; 643 bool m_mediaPlaybackAllowsInline : 1; 644 bool m_passwordEchoEnabled : 1; 645 646 #if USE(SAFARI_THEME) 647 static bool gShouldPaintNativeControls; 648 #endif 649 #if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX)) 650 static bool gShouldUseHighResolutionTimers; 651 #endif 652 }; 653 654 } // namespace WebCore 655 656 #endif // Settings_h 657