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         void setStandardFontFamily(const AtomicString&);
standardFontFamily()59         const AtomicString& standardFontFamily() const { return m_standardFontFamily; }
60 
61         void setFixedFontFamily(const AtomicString&);
fixedFontFamily()62         const AtomicString& fixedFontFamily() const { return m_fixedFontFamily; }
63 
64         void setSerifFontFamily(const AtomicString&);
serifFontFamily()65         const AtomicString& serifFontFamily() const { return m_serifFontFamily; }
66 
67         void setSansSerifFontFamily(const AtomicString&);
sansSerifFontFamily()68         const AtomicString& sansSerifFontFamily() const { return m_sansSerifFontFamily; }
69 
70         void setCursiveFontFamily(const AtomicString&);
cursiveFontFamily()71         const AtomicString& cursiveFontFamily() const { return m_cursiveFontFamily; }
72 
73         void setFantasyFontFamily(const AtomicString&);
fantasyFontFamily()74         const AtomicString& fantasyFontFamily() const { return m_fantasyFontFamily; }
75 
76         void setMinimumFontSize(int);
minimumFontSize()77         int minimumFontSize() const { return m_minimumFontSize; }
78 
79         void setMinimumLogicalFontSize(int);
minimumLogicalFontSize()80         int minimumLogicalFontSize() const { return m_minimumLogicalFontSize; }
81 
82         void setDefaultFontSize(int);
defaultFontSize()83         int defaultFontSize() const { return m_defaultFontSize; }
84 
85         void setDefaultFixedFontSize(int);
defaultFixedFontSize()86         int defaultFixedFontSize() const { return m_defaultFixedFontSize; }
87 
88         // Unlike areImagesEnabled, this only suppresses the network load of
89         // the image URL.  A cached image will still be rendered if requested.
90         void setLoadsImagesAutomatically(bool);
loadsImagesAutomatically()91         bool loadsImagesAutomatically() const { return m_loadsImagesAutomatically; }
92 
93         // This setting only affects site icon image loading if loadsImagesAutomatically setting is false and this setting is true.
94         // All other permutations still heed loadsImagesAutomatically setting.
95         void setLoadsSiteIconsIgnoringImageLoadingSetting(bool);
loadsSiteIconsIgnoringImageLoadingSetting()96         bool loadsSiteIconsIgnoringImageLoadingSetting() const { return m_loadsSiteIconsIgnoringImageLoadingSetting; }
97 
98         void setJavaScriptEnabled(bool);
99         // Instead of calling isJavaScriptEnabled directly, please consider calling
100         // ScriptController::canExecuteScripts, which takes things like the
101         // HTML sandbox attribute into account.
isJavaScriptEnabled()102         bool isJavaScriptEnabled() const { return m_isJavaScriptEnabled; }
103 
104         void setWebSecurityEnabled(bool);
isWebSecurityEnabled()105         bool isWebSecurityEnabled() const { return m_isWebSecurityEnabled; }
106 
107         void setAllowUniversalAccessFromFileURLs(bool);
allowUniversalAccessFromFileURLs()108         bool allowUniversalAccessFromFileURLs() const { return m_allowUniversalAccessFromFileURLs; }
109 
110         void setAllowFileAccessFromFileURLs(bool);
allowFileAccessFromFileURLs()111         bool allowFileAccessFromFileURLs() const { return m_allowFileAccessFromFileURLs; }
112 
113         void setJavaScriptCanOpenWindowsAutomatically(bool);
javaScriptCanOpenWindowsAutomatically()114         bool javaScriptCanOpenWindowsAutomatically() const { return m_javaScriptCanOpenWindowsAutomatically; }
115 
116         void setJavaScriptCanAccessClipboard(bool);
javaScriptCanAccessClipboard()117         bool javaScriptCanAccessClipboard() const { return m_javaScriptCanAccessClipboard; }
118 
119         void setSpatialNavigationEnabled(bool);
isSpatialNavigationEnabled()120         bool isSpatialNavigationEnabled() const { return m_isSpatialNavigationEnabled; }
121 
122         void setJavaEnabled(bool);
isJavaEnabled()123         bool isJavaEnabled() const { return m_isJavaEnabled; }
124 
125         void setImagesEnabled(bool);
areImagesEnabled()126         bool areImagesEnabled() const { return m_areImagesEnabled; }
127 
128         void setMediaEnabled(bool);
isMediaEnabled()129         bool isMediaEnabled() const { return m_isMediaEnabled; }
130 
131         void setPluginsEnabled(bool);
arePluginsEnabled()132         bool arePluginsEnabled() const { return m_arePluginsEnabled; }
133 
134         void setLocalStorageEnabled(bool);
localStorageEnabled()135         bool localStorageEnabled() const { return m_localStorageEnabled; }
136 
137 #if ENABLE(DOM_STORAGE)
138         // Allow clients concerned with memory consumption to set a quota on session storage
139         // since the memory used won't be released until the Page is destroyed.
140         // Default is noQuota.
141         void setSessionStorageQuota(unsigned);
sessionStorageQuota()142         unsigned sessionStorageQuota() const { return m_sessionStorageQuota; }
143 #endif
144 
145         // When this option is set, WebCore will avoid storing any record of browsing activity
146         // that may persist on disk or remain displayed when the option is reset.
147         // This option does not affect the storage of such information in RAM.
148         // The following functions respect this setting:
149         //  - HTML5/DOM Storage
150         //  - Icon Database
151         //  - Console Messages
152         //  - MemoryCache
153         //  - Application Cache
154         //  - Back/Forward Page History
155         //  - Page Search Results
156         //  - HTTP Cookies
157         //  - Plug-ins (that support NPNVprivateModeBool)
158         void setPrivateBrowsingEnabled(bool);
privateBrowsingEnabled()159         bool privateBrowsingEnabled() const { return m_privateBrowsingEnabled; }
160 
161         void setCaretBrowsingEnabled(bool);
caretBrowsingEnabled()162         bool caretBrowsingEnabled() const { return m_caretBrowsingEnabled; }
163 
164         void setDefaultTextEncodingName(const String&);
defaultTextEncodingName()165         const String& defaultTextEncodingName() const { return m_defaultTextEncodingName; }
166 
167         void setUsesEncodingDetector(bool);
usesEncodingDetector()168         bool usesEncodingDetector() const { return m_usesEncodingDetector; }
169 
170         void setDNSPrefetchingEnabled(bool);
dnsPrefetchingEnabled()171         bool dnsPrefetchingEnabled() const { return m_dnsPrefetchingEnabled; }
172 
173         void setUserStyleSheetLocation(const KURL&);
userStyleSheetLocation()174         const KURL& userStyleSheetLocation() const { return m_userStyleSheetLocation; }
175 
176         void setShouldPrintBackgrounds(bool);
shouldPrintBackgrounds()177         bool shouldPrintBackgrounds() const { return m_shouldPrintBackgrounds; }
178 
179         void setTextAreasAreResizable(bool);
textAreasAreResizable()180         bool textAreasAreResizable() const { return m_textAreasAreResizable; }
181 
182         void setEditableLinkBehavior(EditableLinkBehavior);
editableLinkBehavior()183         EditableLinkBehavior editableLinkBehavior() const { return m_editableLinkBehavior; }
184 
185         void setTextDirectionSubmenuInclusionBehavior(TextDirectionSubmenuInclusionBehavior);
textDirectionSubmenuInclusionBehavior()186         TextDirectionSubmenuInclusionBehavior textDirectionSubmenuInclusionBehavior() const { return m_textDirectionSubmenuInclusionBehavior; }
187 
188 #if ENABLE(DASHBOARD_SUPPORT)
189         void setUsesDashboardBackwardCompatibilityMode(bool);
usesDashboardBackwardCompatibilityMode()190         bool usesDashboardBackwardCompatibilityMode() const { return m_usesDashboardBackwardCompatibilityMode; }
191 #endif
192 
193         void setNeedsAdobeFrameReloadingQuirk(bool);
needsAcrobatFrameReloadingQuirk()194         bool needsAcrobatFrameReloadingQuirk() const { return m_needsAdobeFrameReloadingQuirk; }
195 
196         void setNeedsKeyboardEventDisambiguationQuirks(bool);
needsKeyboardEventDisambiguationQuirks()197         bool needsKeyboardEventDisambiguationQuirks() const { return m_needsKeyboardEventDisambiguationQuirks; }
198 
199         void setTreatsAnyTextCSSLinkAsStylesheet(bool);
treatsAnyTextCSSLinkAsStylesheet()200         bool treatsAnyTextCSSLinkAsStylesheet() const { return m_treatsAnyTextCSSLinkAsStylesheet; }
201 
202         void setNeedsLeopardMailQuirks(bool);
needsLeopardMailQuirks()203         bool needsLeopardMailQuirks() const { return m_needsLeopardMailQuirks; }
204 
205         void setNeedsTigerMailQuirks(bool);
needsTigerMailQuirks()206         bool needsTigerMailQuirks() const { return m_needsTigerMailQuirks; }
207 
208         void setDOMPasteAllowed(bool);
isDOMPasteAllowed()209         bool isDOMPasteAllowed() const { return m_isDOMPasteAllowed; }
210 
211         static void setDefaultMinDOMTimerInterval(double); // Interval specified in seconds.
212         static double defaultMinDOMTimerInterval();
213 
214         void setMinDOMTimerInterval(double); // Per-page; initialized to default value.
215         double minDOMTimerInterval();
216 
217         void setUsesPageCache(bool);
usesPageCache()218         bool usesPageCache() const { return m_usesPageCache; }
219 
220         void setShrinksStandaloneImagesToFit(bool);
shrinksStandaloneImagesToFit()221         bool shrinksStandaloneImagesToFit() const { return m_shrinksStandaloneImagesToFit; }
222 
223         void setShowsURLsInToolTips(bool);
showsURLsInToolTips()224         bool showsURLsInToolTips() const { return m_showsURLsInToolTips; }
225 
226         void setFTPDirectoryTemplatePath(const String&);
ftpDirectoryTemplatePath()227         const String& ftpDirectoryTemplatePath() const { return m_ftpDirectoryTemplatePath; }
228 
229         void setForceFTPDirectoryListings(bool);
forceFTPDirectoryListings()230         bool forceFTPDirectoryListings() const { return m_forceFTPDirectoryListings; }
231 
232         void setDeveloperExtrasEnabled(bool);
developerExtrasEnabled()233         bool developerExtrasEnabled() const { return m_developerExtrasEnabled; }
234 
235         void setFrameFlatteningEnabled(bool);
frameFlatteningEnabled()236         bool frameFlatteningEnabled() const { return m_frameFlatteningEnabled; }
237 
238         void setAuthorAndUserStylesEnabled(bool);
authorAndUserStylesEnabled()239         bool authorAndUserStylesEnabled() const { return m_authorAndUserStylesEnabled; }
240 
241         void setFontRenderingMode(FontRenderingMode mode);
242         FontRenderingMode fontRenderingMode() const;
243 
244         void setNeedsSiteSpecificQuirks(bool);
needsSiteSpecificQuirks()245         bool needsSiteSpecificQuirks() const { return m_needsSiteSpecificQuirks; }
246 
247 #if ENABLE(WEB_ARCHIVE)
248         void setWebArchiveDebugModeEnabled(bool);
webArchiveDebugModeEnabled()249         bool webArchiveDebugModeEnabled() const { return m_webArchiveDebugModeEnabled; }
250 #endif
251 
252         void setLocalFileContentSniffingEnabled(bool);
localFileContentSniffingEnabled()253         bool localFileContentSniffingEnabled() const { return m_localFileContentSniffingEnabled; }
254 
255         void setLocalStorageDatabasePath(const String&);
localStorageDatabasePath()256         const String& localStorageDatabasePath() const { return m_localStorageDatabasePath; }
257 
258         void setApplicationChromeMode(bool);
inApplicationChromeMode()259         bool inApplicationChromeMode() const { return m_inApplicationChromeMode; }
260 
261         void setPrintingMediaType(const String&);
printingMediaType()262         const String& printingMediaType() const { return m_printingMediaType; }
263 
264         void setOfflineWebApplicationCacheEnabled(bool);
offlineWebApplicationCacheEnabled()265         bool offlineWebApplicationCacheEnabled() const { return m_offlineWebApplicationCacheEnabled; }
266 
267         void setShouldPaintCustomScrollbars(bool);
shouldPaintCustomScrollbars()268         bool shouldPaintCustomScrollbars() const { return m_shouldPaintCustomScrollbars; }
269 
270         void setEnforceCSSMIMETypeInNoQuirksMode(bool);
enforceCSSMIMETypeInNoQuirksMode()271         bool enforceCSSMIMETypeInNoQuirksMode() { return m_enforceCSSMIMETypeInNoQuirksMode; }
272 
setMaximumDecodedImageSize(size_t size)273         void setMaximumDecodedImageSize(size_t size) { m_maximumDecodedImageSize = size; }
maximumDecodedImageSize()274         size_t maximumDecodedImageSize() const { return m_maximumDecodedImageSize; }
275 
276 #if USE(SAFARI_THEME)
277         // Windows debugging pref (global) for switching between the Aqua look and a native windows look.
278         static void setShouldPaintNativeControls(bool);
shouldPaintNativeControls()279         static bool shouldPaintNativeControls() { return gShouldPaintNativeControls; }
280 #endif
281 
282         void setAllowScriptsToCloseWindows(bool);
allowScriptsToCloseWindows()283         bool allowScriptsToCloseWindows() const { return m_allowScriptsToCloseWindows; }
284 
setEditingBehaviorType(EditingBehaviorType behavior)285         void setEditingBehaviorType(EditingBehaviorType behavior) { m_editingBehaviorType = behavior; }
editingBehaviorType()286         EditingBehaviorType editingBehaviorType() const { return static_cast<EditingBehaviorType>(m_editingBehaviorType); }
287 
288         void setDownloadableBinaryFontsEnabled(bool);
downloadableBinaryFontsEnabled()289         bool downloadableBinaryFontsEnabled() const { return m_downloadableBinaryFontsEnabled; }
290 
291         void setXSSAuditorEnabled(bool);
xssAuditorEnabled()292         bool xssAuditorEnabled() const { return m_xssAuditorEnabled; }
293 
294         void setCanvasUsesAcceleratedDrawing(bool);
canvasUsesAcceleratedDrawing()295         bool canvasUsesAcceleratedDrawing() const { return m_canvasUsesAcceleratedDrawing; }
296 
297         void setAcceleratedDrawingEnabled(bool);
acceleratedDrawingEnabled()298         bool acceleratedDrawingEnabled() const { return m_acceleratedDrawingEnabled; }
299 
300         void setAcceleratedCompositingEnabled(bool);
acceleratedCompositingEnabled()301         bool acceleratedCompositingEnabled() const { return m_acceleratedCompositingEnabled; }
302 
303         void setAcceleratedCompositingFor3DTransformsEnabled(bool);
acceleratedCompositingFor3DTransformsEnabled()304         bool acceleratedCompositingFor3DTransformsEnabled() const { return m_acceleratedCompositingFor3DTransformsEnabled; }
305 
306         void setAcceleratedCompositingForVideoEnabled(bool);
acceleratedCompositingForVideoEnabled()307         bool acceleratedCompositingForVideoEnabled() const { return m_acceleratedCompositingForVideoEnabled; }
308 
309         void setAcceleratedCompositingForPluginsEnabled(bool);
acceleratedCompositingForPluginsEnabled()310         bool acceleratedCompositingForPluginsEnabled() const { return m_acceleratedCompositingForPluginsEnabled; }
311 
312         void setAcceleratedCompositingForCanvasEnabled(bool);
acceleratedCompositingForCanvasEnabled()313         bool acceleratedCompositingForCanvasEnabled() const { return m_acceleratedCompositingForCanvasEnabled; }
314 
315         void setAcceleratedCompositingForAnimationEnabled(bool);
acceleratedCompositingForAnimationEnabled()316         bool acceleratedCompositingForAnimationEnabled() const { return m_acceleratedCompositingForAnimationEnabled; }
317 
318         void setShowDebugBorders(bool);
showDebugBorders()319         bool showDebugBorders() const { return m_showDebugBorders; }
320 
321         void setShowRepaintCounter(bool);
showRepaintCounter()322         bool showRepaintCounter() const { return m_showRepaintCounter; }
323 
324         void setExperimentalNotificationsEnabled(bool);
experimentalNotificationsEnabled()325         bool experimentalNotificationsEnabled() const { return m_experimentalNotificationsEnabled; }
326 
327 #if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
328         static void setShouldUseHighResolutionTimers(bool);
shouldUseHighResolutionTimers()329         static bool shouldUseHighResolutionTimers() { return gShouldUseHighResolutionTimers; }
330 #endif
331 
332         void setPluginAllowedRunTime(unsigned);
pluginAllowedRunTime()333         unsigned pluginAllowedRunTime() const { return m_pluginAllowedRunTime; }
334 
335         void setWebAudioEnabled(bool);
webAudioEnabled()336         bool webAudioEnabled() const { return m_webAudioEnabled; }
337 
338         void setWebGLEnabled(bool);
webGLEnabled()339         bool webGLEnabled() const { return m_webGLEnabled; }
340 
341         void setOpenGLMultisamplingEnabled(bool);
openGLMultisamplingEnabled()342         bool openGLMultisamplingEnabled() const { return m_openGLMultisamplingEnabled; }
343 
344         void setAccelerated2dCanvasEnabled(bool);
accelerated2dCanvasEnabled()345         bool accelerated2dCanvasEnabled() const { return m_acceleratedCanvas2dEnabled; }
346 
347         void setLegacyAccelerated2dCanvasEnabled(bool);
legacyAccelerated2dCanvasEnabled()348         bool legacyAccelerated2dCanvasEnabled() const { return m_legacyAcceleratedCanvas2dEnabled; }
349 
350         void setLoadDeferringEnabled(bool);
loadDeferringEnabled()351         bool loadDeferringEnabled() const { return m_loadDeferringEnabled; }
352 
353         void setTiledBackingStoreEnabled(bool);
tiledBackingStoreEnabled()354         bool tiledBackingStoreEnabled() const { return m_tiledBackingStoreEnabled; }
355 
356         void setPrintingMinimumShrinkFactor(float);
printingMinimumShrinkFactor()357         float printingMinimumShrinkFactor() const { return m_printingMinimumShrinkFactor; }
358 
359         void setPrintingMaximumShrinkFactor(float);
printingMaximumShrinkFactor()360         float printingMaximumShrinkFactor() const { return m_printingMaximumShrinkFactor; }
361 
setPaginateDuringLayoutEnabled(bool flag)362         void setPaginateDuringLayoutEnabled(bool flag) { m_paginateDuringLayoutEnabled = flag; }
paginateDuringLayoutEnabled()363         bool paginateDuringLayoutEnabled() const { return m_paginateDuringLayoutEnabled; }
364 
365 #if ENABLE(FULLSCREEN_API)
setFullScreenEnabled(bool flag)366         void setFullScreenEnabled(bool flag) { m_fullScreenAPIEnabled = flag; }
fullScreenEnabled()367         bool fullScreenEnabled() const  { return m_fullScreenAPIEnabled; }
368 #endif
369 
370 #if USE(AVFOUNDATION)
setAVFoundationEnabled(bool flag)371         static void setAVFoundationEnabled(bool flag) { gAVFoundationEnabled = flag; }
isAVFoundationEnabled()372         static bool isAVFoundationEnabled() { return gAVFoundationEnabled; }
373 #endif
374 
setAsynchronousSpellCheckingEnabled(bool flag)375         void setAsynchronousSpellCheckingEnabled(bool flag) { m_asynchronousSpellCheckingEnabled = flag; }
asynchronousSpellCheckingEnabled()376         bool asynchronousSpellCheckingEnabled() const  { return m_asynchronousSpellCheckingEnabled; }
377 
setMemoryInfoEnabled(bool flag)378         void setMemoryInfoEnabled(bool flag) { m_memoryInfoEnabled = flag; }
memoryInfoEnabled()379         bool memoryInfoEnabled() const { return m_memoryInfoEnabled; }
380 
381         // This setting will be removed when an HTML5 compatibility issue is
382         // resolved and WebKit implementation of interactive validation is
383         // completed. See http://webkit.org/b/40520, http://webkit.org/b/40747,
384         // and http://webkit.org/b/40908
setInteractiveFormValidationEnabled(bool flag)385         void setInteractiveFormValidationEnabled(bool flag) { m_interactiveFormValidation = flag; }
interactiveFormValidationEnabled()386         bool interactiveFormValidationEnabled() const { return m_interactiveFormValidation; }
387 
388         // Sets the maginication value for validation message timer.
389         // If the maginication value is N, a validation message disappears
390         // automatically after <message length> * N / 1000 seconds. If N is
391         // equal to or less than 0, a validation message doesn't disappears
392         // automaticaly. The default value is 50.
setValidationMessageTimerMagnification(int newValue)393         void setValidationMessageTimerMagnification(int newValue) { m_validationMessageTimerMagnification = newValue; }
validationMessageTimerMaginification()394         int validationMessageTimerMaginification() const { return m_validationMessageTimerMagnification; }
395 
setUsePreHTML5ParserQuirks(bool flag)396         void setUsePreHTML5ParserQuirks(bool flag) { m_usePreHTML5ParserQuirks = flag; }
usePreHTML5ParserQuirks()397         bool usePreHTML5ParserQuirks() const { return m_usePreHTML5ParserQuirks; }
398 
setHyperlinkAuditingEnabled(bool flag)399         void setHyperlinkAuditingEnabled(bool flag) { m_hyperlinkAuditingEnabled = flag; }
hyperlinkAuditingEnabled()400         bool hyperlinkAuditingEnabled() const { return m_hyperlinkAuditingEnabled; }
401 
setCrossOriginCheckInGetMatchedCSSRulesDisabled(bool flag)402         void setCrossOriginCheckInGetMatchedCSSRulesDisabled(bool flag) { m_crossOriginCheckInGetMatchedCSSRulesDisabled = flag; }
crossOriginCheckInGetMatchedCSSRulesDisabled()403         bool crossOriginCheckInGetMatchedCSSRulesDisabled() const { return m_crossOriginCheckInGetMatchedCSSRulesDisabled; }
404 
setUseQuickLookResourceCachingQuirks(bool flag)405         void setUseQuickLookResourceCachingQuirks(bool flag) { m_useQuickLookResourceCachingQuirks = flag; }
useQuickLookResourceCachingQuirks()406         bool useQuickLookResourceCachingQuirks() const { return m_useQuickLookResourceCachingQuirks; }
407 
setForceCompositingMode(bool flag)408         void setForceCompositingMode(bool flag) { m_forceCompositingMode = flag; }
forceCompositingMode()409         bool forceCompositingMode() { return m_forceCompositingMode; }
410 
setShouldInjectUserScriptsInInitialEmptyDocument(bool flag)411         void setShouldInjectUserScriptsInInitialEmptyDocument(bool flag) { m_shouldInjectUserScriptsInInitialEmptyDocument = flag; }
shouldInjectUserScriptsInInitialEmptyDocument()412         bool shouldInjectUserScriptsInInitialEmptyDocument() { return m_shouldInjectUserScriptsInInitialEmptyDocument; }
413 
setAllowDisplayOfInsecureContent(bool flag)414         void setAllowDisplayOfInsecureContent(bool flag) { m_allowDisplayOfInsecureContent = flag; }
allowDisplayOfInsecureContent()415         bool allowDisplayOfInsecureContent() const { return m_allowDisplayOfInsecureContent; }
setAllowRunningOfInsecureContent(bool flag)416         void setAllowRunningOfInsecureContent(bool flag) { m_allowRunningOfInsecureContent = flag; }
allowRunningOfInsecureContent()417         bool allowRunningOfInsecureContent() const { return m_allowRunningOfInsecureContent; }
418 
setPasswordEchoEnabled(bool flag)419         void setPasswordEchoEnabled(bool flag) { m_passwordEchoEnabled = flag; }
passwordEchoEnabled()420         bool passwordEchoEnabled() const { return m_passwordEchoEnabled; }
421 
setPasswordEchoDurationInSeconds(double durationInSeconds)422         void setPasswordEchoDurationInSeconds(double durationInSeconds) { m_passwordEchoDurationInSeconds = durationInSeconds; }
passwordEchoDurationInSeconds()423         double passwordEchoDurationInSeconds() const { return m_passwordEchoDurationInSeconds; }
424 
425     private:
426         Page* m_page;
427 
428         String m_defaultTextEncodingName;
429         String m_ftpDirectoryTemplatePath;
430         String m_localStorageDatabasePath;
431         String m_printingMediaType;
432         KURL m_userStyleSheetLocation;
433         AtomicString m_standardFontFamily;
434         AtomicString m_fixedFontFamily;
435         AtomicString m_serifFontFamily;
436         AtomicString m_sansSerifFontFamily;
437         AtomicString m_cursiveFontFamily;
438         AtomicString m_fantasyFontFamily;
439         EditableLinkBehavior m_editableLinkBehavior;
440         TextDirectionSubmenuInclusionBehavior m_textDirectionSubmenuInclusionBehavior;
441         double m_passwordEchoDurationInSeconds;
442         float m_printingMinimumShrinkFactor;
443         float m_printingMaximumShrinkFactor;
444         int m_minimumFontSize;
445         int m_minimumLogicalFontSize;
446         int m_defaultFontSize;
447         int m_defaultFixedFontSize;
448         int m_validationMessageTimerMagnification;
449         size_t m_maximumDecodedImageSize;
450 #if ENABLE(DOM_STORAGE)
451         unsigned m_sessionStorageQuota;
452 #endif
453         unsigned m_pluginAllowedRunTime;
454         unsigned m_editingBehaviorType;
455         bool m_isSpatialNavigationEnabled : 1;
456         bool m_isJavaEnabled : 1;
457         bool m_loadsImagesAutomatically : 1;
458         bool m_loadsSiteIconsIgnoringImageLoadingSetting : 1;
459         bool m_privateBrowsingEnabled : 1;
460         bool m_caretBrowsingEnabled : 1;
461         bool m_areImagesEnabled : 1;
462         bool m_isMediaEnabled : 1;
463         bool m_arePluginsEnabled : 1;
464         bool m_localStorageEnabled : 1;
465         bool m_isJavaScriptEnabled : 1;
466         bool m_isWebSecurityEnabled : 1;
467         bool m_allowUniversalAccessFromFileURLs: 1;
468         bool m_allowFileAccessFromFileURLs: 1;
469         bool m_javaScriptCanOpenWindowsAutomatically : 1;
470         bool m_javaScriptCanAccessClipboard : 1;
471         bool m_shouldPrintBackgrounds : 1;
472         bool m_textAreasAreResizable : 1;
473 #if ENABLE(DASHBOARD_SUPPORT)
474         bool m_usesDashboardBackwardCompatibilityMode : 1;
475 #endif
476         bool m_needsAdobeFrameReloadingQuirk : 1;
477         bool m_needsKeyboardEventDisambiguationQuirks : 1;
478         bool m_treatsAnyTextCSSLinkAsStylesheet : 1;
479         bool m_needsLeopardMailQuirks : 1;
480         bool m_needsTigerMailQuirks : 1;
481         bool m_isDOMPasteAllowed : 1;
482         bool m_shrinksStandaloneImagesToFit : 1;
483         bool m_usesPageCache: 1;
484         bool m_showsURLsInToolTips : 1;
485         bool m_forceFTPDirectoryListings : 1;
486         bool m_developerExtrasEnabled : 1;
487         bool m_authorAndUserStylesEnabled : 1;
488         bool m_needsSiteSpecificQuirks : 1;
489         unsigned m_fontRenderingMode : 1;
490         bool m_frameFlatteningEnabled : 1;
491         bool m_webArchiveDebugModeEnabled : 1;
492         bool m_localFileContentSniffingEnabled : 1;
493         bool m_inApplicationChromeMode : 1;
494         bool m_offlineWebApplicationCacheEnabled : 1;
495         bool m_shouldPaintCustomScrollbars : 1;
496         bool m_enforceCSSMIMETypeInNoQuirksMode : 1;
497         bool m_usesEncodingDetector : 1;
498         bool m_allowScriptsToCloseWindows : 1;
499         bool m_canvasUsesAcceleratedDrawing : 1;
500         bool m_acceleratedDrawingEnabled : 1;
501         bool m_downloadableBinaryFontsEnabled : 1;
502         bool m_xssAuditorEnabled : 1;
503         bool m_acceleratedCompositingEnabled : 1;
504         bool m_acceleratedCompositingFor3DTransformsEnabled : 1;
505         bool m_acceleratedCompositingForVideoEnabled : 1;
506         bool m_acceleratedCompositingForPluginsEnabled : 1;
507         bool m_acceleratedCompositingForCanvasEnabled : 1;
508         bool m_acceleratedCompositingForAnimationEnabled : 1;
509         bool m_showDebugBorders : 1;
510         bool m_showRepaintCounter : 1;
511         bool m_experimentalNotificationsEnabled : 1;
512         bool m_webGLEnabled : 1;
513         bool m_openGLMultisamplingEnabled : 1;
514         bool m_webAudioEnabled : 1;
515         bool m_acceleratedCanvas2dEnabled : 1;
516         bool m_legacyAcceleratedCanvas2dEnabled : 1;
517         bool m_loadDeferringEnabled : 1;
518         bool m_tiledBackingStoreEnabled : 1;
519         bool m_paginateDuringLayoutEnabled : 1;
520         bool m_dnsPrefetchingEnabled : 1;
521 #if ENABLE(FULLSCREEN_API)
522         bool m_fullScreenAPIEnabled : 1;
523 #endif
524         bool m_asynchronousSpellCheckingEnabled: 1;
525         bool m_memoryInfoEnabled: 1;
526         bool m_interactiveFormValidation: 1;
527         bool m_usePreHTML5ParserQuirks: 1;
528         bool m_hyperlinkAuditingEnabled : 1;
529         bool m_crossOriginCheckInGetMatchedCSSRulesDisabled : 1;
530         bool m_useQuickLookResourceCachingQuirks : 1;
531         bool m_forceCompositingMode : 1;
532         bool m_shouldInjectUserScriptsInInitialEmptyDocument : 1;
533         bool m_allowDisplayOfInsecureContent : 1;
534         bool m_allowRunningOfInsecureContent : 1;
535         bool m_passwordEchoEnabled : 1;
536 
537 #if USE(AVFOUNDATION)
538         static bool gAVFoundationEnabled;
539 #endif
540 
541 #if USE(SAFARI_THEME)
542         static bool gShouldPaintNativeControls;
543 #endif
544 #if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
545         static bool gShouldUseHighResolutionTimers;
546 #endif
547     };
548 
549 } // namespace WebCore
550 
551 #endif // Settings_h
552