2 * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
26 #ifndef WebPreferencesStore_h
27 #define WebPreferencesStore_h
29 #include "ArgumentDecoder.h"
30 #include "ArgumentEncoder.h"
31 #include <wtf/HashMap.h>
32 #include <wtf/text/StringHash.h>
33 #include <wtf/text/WTFString.h>
37 // macro(KeyUpper, KeyLower, TypeNameUpper, TypeName, DefaultValue)
40 #define DEFAULT_WEBKIT_TABSTOLINKS_ENABLED true
42 #define DEFAULT_WEBKIT_TABSTOLINKS_ENABLED false
45 #if ENABLE(SMOOTH_SCROLLING)
46 #define DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED true
48 #define DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED false
51 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
52 #define DEFAULT_SCREEN_FONT_SUBSTITUTION_ENABLED false
54 #define DEFAULT_SCREEN_FONT_SUBSTITUTION_ENABLED true
58 #define DEFAULT_HIDDEN_PAGE_DOM_TIMER_THROTTLING_ENABLED true
59 #define DEFAULT_HIDDEN_PAGE_CSS_ANIMATION_SUSPENSION_ENABLED true
60 #define DEFAULT_PDFPLUGIN_ENABLED true
62 #define DEFAULT_HIDDEN_PAGE_DOM_TIMER_THROTTLING_ENABLED false
63 #define DEFAULT_HIDDEN_PAGE_CSS_ANIMATION_SUSPENSION_ENABLED false
64 #define DEFAULT_PDFPLUGIN_ENABLED false
68 #define DEFAULT_FRAME_FLATTENING_ENABLED true
69 #define DEFAULT_SHOULD_PRINT_BACKGROUNDS true
70 #define DEFAULT_TEXT_AREAS_ARE_RESIZABLE false
71 #define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY false
72 #define DEFAULT_SHOULD_RESPECT_IMAGE_ORIENTATION true
73 #define DEFAULT_MINIMUM_FONT_ZOOM_SIZE WKGetMinimumZoomFontSize()
74 #define DEFAULT_PASSWORD_ECHO_ENABLED true
75 #define DEFAULT_MEDIA_PLAYBACK_ALLOWS_INLINE false
76 #define DEFAULT_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE true
77 #define DEFAULT_TEMPORARY_TILE_COHORT_RETENTION_ENABLED false
79 #define DEFAULT_FRAME_FLATTENING_ENABLED false
80 #define DEFAULT_SHOULD_PRINT_BACKGROUNDS false
81 #define DEFAULT_TEXT_AREAS_ARE_RESIZABLE true
82 #define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY true
83 #define DEFAULT_SHOULD_RESPECT_IMAGE_ORIENTATION false
84 #define DEFAULT_MINIMUM_FONT_ZOOM_SIZE 0
85 #define DEFAULT_PASSWORD_ECHO_ENABLED false
86 #define DEFAULT_MEDIA_PLAYBACK_ALLOWS_INLINE true
87 #define DEFAULT_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE false
88 #define DEFAULT_TEMPORARY_TILE_COHORT_RETENTION_ENABLED true
91 #if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
92 #define DEFAULT_ACCELERATED_DRAWING_ENABLED true
94 #define DEFAULT_ACCELERATED_DRAWING_ENABLED false
97 #if PLATFORM(IOS) && PLATFORM(IOS_SIMULATOR)
98 #define DEFAULT_CANVAS_USES_ACCELERATED_DRAWING false
100 #define DEFAULT_CANVAS_USES_ACCELERATED_DRAWING true
103 #define FOR_EACH_WEBKIT_BOOL_PREFERENCE(macro) \
104 macro(JavaScriptEnabled, javaScriptEnabled, Bool, bool, true) \
105 macro(JavaScriptMarkupEnabled, javaScriptMarkupEnabled, Bool, bool, true) \
106 macro(LoadsImagesAutomatically, loadsImagesAutomatically, Bool, bool, true) \
107 macro(LoadsSiteIconsIgnoringImageLoadingPreference, loadsSiteIconsIgnoringImageLoadingPreference, Bool, bool, false) \
108 macro(PluginsEnabled, pluginsEnabled, Bool, bool, true) \
109 macro(JavaEnabled, javaEnabled, Bool, bool, true) \
110 macro(JavaEnabledForLocalFiles, javaEnabledForLocalFiles, Bool, bool, true) \
111 macro(OfflineWebApplicationCacheEnabled, offlineWebApplicationCacheEnabled, Bool, bool, false) \
112 macro(LocalStorageEnabled, localStorageEnabled, Bool, bool, true) \
113 macro(DatabasesEnabled, databasesEnabled, Bool, bool, true) \
114 macro(XSSAuditorEnabled, xssAuditorEnabled, Bool, bool, true) \
115 macro(FrameFlatteningEnabled, frameFlatteningEnabled, Bool, bool, DEFAULT_FRAME_FLATTENING_ENABLED) \
116 macro(DeveloperExtrasEnabled, developerExtrasEnabled, Bool, bool, false) \
117 macro(JavaScriptExperimentsEnabled, javaScriptExperimentsEnabled, Bool, bool, false) \
118 macro(PrivateBrowsingEnabled, privateBrowsingEnabled, Bool, bool, false) \
119 macro(TextAreasAreResizable, textAreasAreResizable, Bool, bool, DEFAULT_TEXT_AREAS_ARE_RESIZABLE) \
120 macro(JavaScriptCanOpenWindowsAutomatically, javaScriptCanOpenWindowsAutomatically, Bool, bool, DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY) \
121 macro(HyperlinkAuditingEnabled, hyperlinkAuditingEnabled, Bool, bool, true) \
122 macro(NeedsSiteSpecificQuirks, needsSiteSpecificQuirks, Bool, bool, false) \
123 macro(AcceleratedCompositingEnabled, acceleratedCompositingEnabled, Bool, bool, true) \
124 macro(ForceCompositingMode, forceCompositingMode, Bool, bool, false) \
125 macro(AcceleratedDrawingEnabled, acceleratedDrawingEnabled, Bool, bool, DEFAULT_ACCELERATED_DRAWING_ENABLED) \
126 macro(CanvasUsesAcceleratedDrawing, canvasUsesAcceleratedDrawing, Bool, bool, DEFAULT_CANVAS_USES_ACCELERATED_DRAWING) \
127 macro(CompositingBordersVisible, compositingBordersVisible, Bool, bool, false) \
128 macro(CompositingRepaintCountersVisible, compositingRepaintCountersVisible, Bool, bool, false) \
129 macro(TiledScrollingIndicatorVisible, tiledScrollingIndicatorVisible, Bool, bool, false) \
130 macro(WebGLEnabled, webGLEnabled, Bool, bool, true) \
131 macro(MultithreadedWebGLEnabled, multithreadedWebGLEnabled, Bool, bool, false) \
132 macro(ForceSoftwareWebGLRendering, forceSoftwareWebGLRendering, Bool, bool, false) \
133 macro(Accelerated2dCanvasEnabled, accelerated2dCanvasEnabled, Bool, bool, false) \
134 macro(CSSRegionsEnabled, cssRegionsEnabled, Bool, bool, true) \
135 macro(CSSCompositingEnabled, cssCompositingEnabled, Bool, bool, true) \
136 macro(ForceFTPDirectoryListings, forceFTPDirectoryListings, Bool, bool, false) \
137 macro(TabsToLinks, tabsToLinks, Bool, bool, DEFAULT_WEBKIT_TABSTOLINKS_ENABLED) \
138 macro(DNSPrefetchingEnabled, dnsPrefetchingEnabled, Bool, bool, false) \
139 macro(WebArchiveDebugModeEnabled, webArchiveDebugModeEnabled, Bool, bool, false) \
140 macro(LocalFileContentSniffingEnabled, localFileContentSniffingEnabled, Bool, bool, false) \
141 macro(UsesPageCache, usesPageCache, Bool, bool, true) \
142 macro(PageCacheSupportsPlugins, pageCacheSupportsPlugins, Bool, bool, true) \
143 macro(AuthorAndUserStylesEnabled, authorAndUserStylesEnabled, Bool, bool, true) \
144 macro(PaginateDuringLayoutEnabled, paginateDuringLayoutEnabled, Bool, bool, false) \
145 macro(DOMPasteAllowed, domPasteAllowed, Bool, bool, false) \
146 macro(JavaScriptCanAccessClipboard, javaScriptCanAccessClipboard, Bool, bool, false) \
147 macro(ShouldPrintBackgrounds, shouldPrintBackgrounds, Bool, bool, DEFAULT_SHOULD_PRINT_BACKGROUNDS) \
148 macro(FullScreenEnabled, fullScreenEnabled, Bool, bool, false) \
149 macro(AsynchronousSpellCheckingEnabled, asynchronousSpellCheckingEnabled, Bool, bool, false) \
150 macro(WebSecurityEnabled, webSecurityEnabled, Bool, bool, true) \
151 macro(AllowUniversalAccessFromFileURLs, allowUniversalAccessFromFileURLs, Bool, bool, false) \
152 macro(AllowFileAccessFromFileURLs, allowFileAccessFromFileURLs, Bool, bool, false) \
153 macro(AVFoundationEnabled, isAVFoundationEnabled, Bool, bool, true) \
154 macro(MediaPlaybackRequiresUserGesture, mediaPlaybackRequiresUserGesture, Bool, bool, DEFAULT_MEDIA_PLAYBACK_REQUIRES_USER_GESTURE) \
155 macro(MediaPlaybackAllowsInline, mediaPlaybackAllowsInline, Bool, bool, DEFAULT_MEDIA_PLAYBACK_ALLOWS_INLINE) \
156 macro(MediaPlaybackAllowsAirPlay, mediaPlaybackAllowsAirPlay, Bool, bool, true) \
157 macro(InspectorStartsAttached, inspectorStartsAttached, Bool, bool, true) \
158 macro(ShowsToolTipOverTruncatedText, showsToolTipOverTruncatedText, Bool, bool, false) \
159 macro(MockScrollbarsEnabled, mockScrollbarsEnabled, Bool, bool, false) \
160 macro(WebAudioEnabled, webAudioEnabled, Bool, bool, true) \
161 macro(ApplicationChromeModeEnabled, applicationChromeMode, Bool, bool, false) \
162 macro(SuppressesIncrementalRendering, suppressesIncrementalRendering, Bool, bool, false) \
163 macro(BackspaceKeyNavigationEnabled, backspaceKeyNavigationEnabled, Bool, bool, true) \
164 macro(CaretBrowsingEnabled, caretBrowsingEnabled, Bool, bool, false) \
165 macro(ShouldDisplaySubtitles, shouldDisplaySubtitles, Bool, bool, false) \
166 macro(ShouldDisplayCaptions, shouldDisplayCaptions, Bool, bool, false) \
167 macro(ShouldDisplayTextDescriptions, shouldDisplayTextDescriptions, Bool, bool, false) \
168 macro(NotificationsEnabled, notificationsEnabled, Bool, bool, true) \
169 macro(ShouldRespectImageOrientation, shouldRespectImageOrientation, Bool, bool, DEFAULT_SHOULD_RESPECT_IMAGE_ORIENTATION) \
170 macro(WantsBalancedSetDefersLoadingBehavior, wantsBalancedSetDefersLoadingBehavior, Bool, bool, false) \
171 macro(RequestAnimationFrameEnabled, requestAnimationFrameEnabled, Bool, bool, true) \
172 macro(DiagnosticLoggingEnabled, diagnosticLoggingEnabled, Bool, bool, false) \
173 macro(AsynchronousPluginInitializationEnabled, asynchronousPluginInitializationEnabled, Bool, bool, false) \
174 macro(AsynchronousPluginInitializationEnabledForAllPlugins, asynchronousPluginInitializationEnabledForAllPlugins, Bool, bool, false) \
175 macro(ArtificialPluginInitializationDelayEnabled, artificialPluginInitializationDelayEnabled, Bool, bool, false) \
176 macro(TabToLinksEnabled, tabToLinksEnabled, Bool, bool, false) \
177 macro(InteractiveFormValidationEnabled, interactiveFormValidationEnabled, Bool, bool, false) \
178 macro(ScrollingPerformanceLoggingEnabled, scrollingPerformanceLoggingEnabled, Bool, bool, false) \
179 macro(StorageBlockingPolicy, storageBlockingPolicy, UInt32, uint32_t, 0) \
180 macro(ScrollAnimatorEnabled, scrollAnimatorEnabled, Bool, bool, DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED) \
181 macro(ScreenFontSubstitutionEnabled, screenFontSubstitutionEnabled, Bool, bool, DEFAULT_SCREEN_FONT_SUBSTITUTION_ENABLED) \
182 macro(CookieEnabled, cookieEnabled, Bool, bool, true) \
183 macro(PlugInSnapshottingEnabled, plugInSnapshottingEnabled, Bool, bool, false) \
184 macro(SnapshotAllPlugIns, snapshotAllPlugIns, Bool, bool, false) \
185 macro(AutostartOriginPlugInSnapshottingEnabled, autostartOriginPlugInSnapshottingEnabled, Bool, bool, true) \
186 macro(PrimaryPlugInSnapshotDetectionEnabled, primaryPlugInSnapshotDetectionEnabled, Bool, bool, true) \
187 macro(PDFPluginEnabled, pdfPluginEnabled, Bool, bool, DEFAULT_PDFPLUGIN_ENABLED) \
188 macro(UsesEncodingDetector, usesEncodingDetector, Bool, bool, false) \
189 macro(TextAutosizingEnabled, textAutosizingEnabled, Bool, bool, false) \
190 macro(AggressiveTileRetentionEnabled, aggressiveTileRetentionEnabled, Bool, bool, false) \
191 macro(TemporaryTileCohortRetentionEnabled, temporaryTileCohortRetentionEnabled, Bool, bool, DEFAULT_TEMPORARY_TILE_COHORT_RETENTION_ENABLED) \
192 macro(QTKitEnabled, isQTKitEnabled, Bool, bool, true) \
193 macro(LogsPageMessagesToSystemConsoleEnabled, logsPageMessagesToSystemConsoleEnabled, Bool, bool, false) \
194 macro(PageVisibilityBasedProcessSuppressionEnabled, pageVisibilityBasedProcessSuppressionEnabled, Bool, bool, true) \
195 macro(SmartInsertDeleteEnabled, smartInsertDeleteEnabled, Bool, bool, true) \
196 macro(SelectTrailingWhitespaceEnabled, selectTrailingWhitespaceEnabled, Bool, bool, false) \
197 macro(ShowsURLsInToolTipsEnabled, showsURLsInToolTipsEnabled, Bool, bool, false) \
198 macro(AcceleratedCompositingForOverflowScrollEnabled, acceleratedCompositingForOverflowScrollEnabled, Bool, bool, false) \
199 macro(HiddenPageDOMTimerThrottlingEnabled, hiddenPageDOMTimerThrottlingEnabled, Bool, bool, DEFAULT_HIDDEN_PAGE_DOM_TIMER_THROTTLING_ENABLED) \
200 macro(HiddenPageCSSAnimationSuspensionEnabled, hiddenPageCSSAnimationSuspensionEnabled, Bool, bool, DEFAULT_HIDDEN_PAGE_CSS_ANIMATION_SUSPENSION_ENABLED) \
201 macro(LowPowerVideoAudioBufferSizeEnabled, lowPowerVideoAudioBufferSizeEnabled, Bool, bool, false) \
202 macro(ThreadedScrollingEnabled, threadedScrollingEnabled, Bool, bool, true) \
203 macro(SimpleLineLayoutEnabled, simpleLineLayoutEnabled, Bool, bool, true) \
204 macro(SimpleLineLayoutDebugBordersEnabled, simpleLineLayoutDebugBordersEnabled, Bool, bool, false) \
205 macro(SubpixelCSSOMElementMetricsEnabled, subpixelCSSOMElementMetricsEnabled, Bool, bool, true) \
206 macro(BackgroundShouldExtendBeyondPage, backgroundShouldExtendBeyondPage, Bool, bool, false) \
207 macro(MediaStreamEnabled, mediaStreamEnabled, Bool, bool, false) \
208 macro(UseLegacyTextAlignPositionedElementBehavior, useLegacyTextAlignPositionedElementBehavior, Bool, bool, false) \
209 macro(SpatialNavigationEnabled, spatialNavigationEnabled, Bool, bool, false) \
210 macro(MediaSourceEnabled, mediaSourceEnabled, Bool, bool, true) \
211 macro(ViewGestureDebuggingEnabled, viewGestureDebuggingEnabled, Bool, bool, false) \
212 macro(ShouldConvertPositionStyleOnCopy, shouldConvertPositionStyleOnCopy, Bool, bool, false) \
213 macro(Standalone, standalone, Bool, bool, false) \
214 macro(TelephoneNumberParsingEnabled, telephoneNumberParsingEnabled, Bool, bool, false) \
215 macro(AlwaysUseBaselineOfPrimaryFont, alwaysUseBaselineOfPrimaryFont, Bool, bool, false) \
216 macro(AllowMultiElementImplicitSubmission, allowMultiElementImplicitSubmission, Bool, bool, false) \
217 macro(AlwaysUseAcceleratedOverflowScroll, alwaysUseAcceleratedOverflowScroll, Bool, bool, false) \
218 macro(PasswordEchoEnabled, passwordEchoEnabled, Bool, bool, DEFAULT_PASSWORD_ECHO_ENABLED) \
219 macro(ImageControlsEnabled, imageControlsEnabled, Bool, bool, false) \
220 macro(EnableInheritURIQueryComponent, enableInheritURIQueryComponent, Bool, bool, false) \
221 macro(ServiceControlsEnabled, serviceControlsEnabled, Bool, bool, false) \
223 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
224 macro(PDFScaleFactor, pdfScaleFactor, Double, double, 0) \
225 macro(IncrementalRenderingSuppressionTimeout, incrementalRenderingSuppressionTimeout, Double, double, 5) \
226 macro(MinimumFontSize, minimumFontSize, Double, double, 0) \
227 macro(MinimumLogicalFontSize, minimumLogicalFontSize, Double, double, 9) \
228 macro(MinimumZoomFontSize, minimumZoomFontSize, Double, double, DEFAULT_MINIMUM_FONT_ZOOM_SIZE) \
229 macro(DefaultFontSize, defaultFontSize, Double, double, 16) \
230 macro(DefaultFixedFontSize, defaultFixedFontSize, Double, double, 13) \
231 macro(LayoutInterval, layoutInterval, Double, double, -1) \
232 macro(MaxParseDuration, maxParseDuration, Double, double, -1) \
233 macro(PasswordEchoDuration, passwordEchoDuration, Double, double, 2) \
236 #define FOR_EACH_WEBKIT_FLOAT_PREFERENCE(macro) \
239 #define FOR_EACH_WEBKIT_UINT32_PREFERENCE(macro) \
240 macro(FontSmoothingLevel, fontSmoothingLevel, UInt32, uint32_t, FontSmoothingLevelMedium) \
241 macro(LayoutFallbackWidth, layoutFallbackWidth, UInt32, uint32_t, 980) \
242 macro(DeviceWidth, deviceWidth, UInt32, uint32_t, 0) \
243 macro(DeviceHeight, deviceHeight, UInt32, uint32_t, 0) \
244 macro(PDFDisplayMode, pdfDisplayMode, UInt32, uint32_t, 1) \
245 macro(EditableLinkBehavior, editableLinkBehavior, UInt32, uint32_t, WebCore::EditableLinkNeverLive) \
246 macro(InspectorAttachedHeight, inspectorAttachedHeight, UInt32, uint32_t, 300) \
247 macro(InspectorAttachedWidth, inspectorAttachedWidth, UInt32, uint32_t, 750) \
248 macro(InspectorAttachmentSide, inspectorAttachmentSide, UInt32, uint32_t, 0) \
254 #define DEFAULT_CURSIVE_FONT_FAMILY "Snell Roundhand"
255 #define DEFAULT_PICTOGRAPH_FONT_FAMILY "AppleColorEmoji"
257 #define DEFAULT_CURSIVE_FONT_FAMILY "Apple Chancery"
258 #define DEFAULT_PICTOGRAPH_FONT_FAMILY "Apple Color Emoji"
262 #define FOR_EACH_WEBKIT_FONT_FAMILY_PREFERENCE(macro) \
263 macro(StandardFontFamily, standardFontFamily, String, String, "Times") \
264 macro(CursiveFontFamily, cursiveFontFamily, String, String, DEFAULT_CURSIVE_FONT_FAMILY) \
265 macro(FantasyFontFamily, fantasyFontFamily, String, String, "Papyrus") \
266 macro(FixedFontFamily, fixedFontFamily, String, String, "Courier") \
267 macro(SansSerifFontFamily, sansSerifFontFamily, String, String, "Helvetica") \
268 macro(SerifFontFamily, serifFontFamily, String, String, "Times") \
269 macro(PictographFontFamily, pictographFontFamily, String, String, "Apple Color Emoji") \
272 #elif PLATFORM(GTK) || PLATFORM(EFL)
274 #define FOR_EACH_WEBKIT_FONT_FAMILY_PREFERENCE(macro) \
275 macro(StandardFontFamily, standardFontFamily, String, String, "Times") \
276 macro(CursiveFontFamily, cursiveFontFamily, String, String, "Comic Sans MS") \
277 macro(FantasyFontFamily, fantasyFontFamily, String, String, "Impact") \
278 macro(FixedFontFamily, fixedFontFamily, String, String, "Courier New") \
279 macro(SansSerifFontFamily, sansSerifFontFamily, String, String, "Helvetica") \
280 macro(SerifFontFamily, serifFontFamily, String, String, "Times") \
281 macro(PictographFontFamily, pictographFontFamily, String, String, "Times") \
286 #define FOR_EACH_WEBKIT_STRING_PREFERENCE(macro) \
287 FOR_EACH_WEBKIT_FONT_FAMILY_PREFERENCE(macro) \
288 macro(DefaultTextEncodingName, defaultTextEncodingName, String, String, "ISO-8859-1") \
289 macro(FTPDirectoryTemplatePath, ftpDirectoryTemplatePath, String, String, "") \
292 #define FOR_EACH_WEBKIT_STRING_PREFERENCE_NOT_IN_WEBCORE(macro) \
293 macro(InspectorWindowFrame, inspectorWindowFrame, String, String, "") \
296 #define FOR_EACH_WEBKIT_PREFERENCE(macro) \
297 FOR_EACH_WEBKIT_BOOL_PREFERENCE(macro) \
298 FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
299 FOR_EACH_WEBKIT_FLOAT_PREFERENCE(macro) \
300 FOR_EACH_WEBKIT_UINT32_PREFERENCE(macro) \
301 FOR_EACH_WEBKIT_STRING_PREFERENCE(macro) \
302 FOR_EACH_WEBKIT_STRING_PREFERENCE_NOT_IN_WEBCORE(macro) \
305 namespace WebPreferencesKey {
307 #define DECLARE_KEY_GETTERS(KeyUpper, KeyLower, TypeName, Type, DefaultValue) const String& KeyLower##Key();
309 FOR_EACH_WEBKIT_PREFERENCE(DECLARE_KEY_GETTERS)
311 #undef DECLARE_KEY_GETTERS
313 } // namespace WebPreferencesKey
315 struct WebPreferencesStore {
316 WebPreferencesStore();
318 void encode(IPC::ArgumentEncoder&) const;
319 static bool decode(IPC::ArgumentDecoder&, WebPreferencesStore&);
321 // NOTE: The getters in this class have non-standard names to aid in the use of the preference macros.
323 bool setStringValueForKey(const String& key, const String& value);
324 String getStringValueForKey(const String& key) const;
326 bool setBoolValueForKey(const String& key, bool value);
327 bool getBoolValueForKey(const String& key) const;
329 bool setUInt32ValueForKey(const String& key, uint32_t value);
330 uint32_t getUInt32ValueForKey(const String& key) const;
332 bool setDoubleValueForKey(const String& key, double value);
333 double getDoubleValueForKey(const String& key) const;
335 bool setFloatValueForKey(const String& key, float value);
336 float getFloatValueForKey(const String& key) const;
338 // For WebKitTestRunner usage.
339 static void overrideBoolValueForKey(const String& key, bool value);
340 static void removeTestRunnerOverrides();
342 HashMap<String, String> m_stringValues;
343 HashMap<String, bool> m_boolValues;
344 HashMap<String, uint32_t> m_uint32Values;
345 HashMap<String, double> m_doubleValues;
346 HashMap<String, float> m_floatValues;
349 } // namespace WebKit
351 #endif // WebPreferencesStore_h