Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / web / WebSettingsImpl.h
blob4a635a558d8707a06505bb92f3ea223abeff4c55
1 /*
2 * Copyright (C) 2009 Google 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 are
6 * met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #ifndef WebSettingsImpl_h
32 #define WebSettingsImpl_h
34 #include "public/web/WebSettings.h"
36 namespace blink {
38 class DevToolsEmulator;
39 class Settings;
41 class WebSettingsImpl final : public WebSettings {
42 public:
43 WebSettingsImpl(Settings*, DevToolsEmulator*);
44 virtual ~WebSettingsImpl() { }
46 void setFromStrings(const WebString& name, const WebString& value) override;
48 bool mainFrameResizesAreOrientationChanges() const override;
49 bool shrinksViewportContentToFit() const override;
50 bool viewportEnabled() const override;
51 void setAccelerated2dCanvasEnabled(bool) override;
52 void setAccelerated2dCanvasMSAASampleCount(int) override;
53 void setAcceleratedCompositingEnabled(bool) override;
54 void setPreferCompositingToLCDTextEnabled(bool) override;
55 void setAccessibilityEnabled(bool) override;
56 void setAccessibilityPasswordValuesEnabled(bool) override;
57 void setAllowDisplayOfInsecureContent(bool) override;
58 void setAllowFileAccessFromFileURLs(bool) override;
59 void setAllowCustomScrollbarInMainFrame(bool) override;
60 void setAllowRunningOfInsecureContent(bool) override;
61 void setAllowScriptsToCloseWindows(bool) override;
62 void setAllowUniversalAccessFromFileURLs(bool) override;
63 void setAntialiased2dCanvasEnabled(bool) override;
64 void setAntialiasedClips2dCanvasEnabled(bool) override;
65 void setAsynchronousSpellCheckingEnabled(bool) override;
66 void setAutoplayExperimentMode(const WebString&) override;
67 void setAutoZoomFocusedNodeToLegibleScale(bool) override;
68 void setCaretBrowsingEnabled(bool) override;
69 void setClobberUserAgentInitialScaleQuirk(bool) override;
70 void setCookieEnabled(bool) override;
71 void setNavigateOnDragDrop(bool) override;
72 void setCursiveFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
73 void setDNSPrefetchingEnabled(bool) override;
74 void setDOMPasteAllowed(bool) override;
75 void setDefaultFixedFontSize(int) override;
76 void setDefaultFontSize(int) override;
77 void setDefaultTextEncodingName(const WebString&) override;
78 void setDefaultVideoPosterURL(const WebString&) override;
79 void setDeviceScaleAdjustment(float) override;
81 // FIXME: Replace these two with pointer/hover queries? crbug.com/441813
82 void setDeviceSupportsMouse(bool) override;
83 void setDeviceSupportsTouch(bool) override;
85 void setDisableReadingFromCanvas(bool) override;
86 void setDoubleTapToZoomEnabled(bool) override;
87 void setDownloadableBinaryFontsEnabled(bool) override;
88 void setEditingBehavior(EditingBehavior) override;
89 void setEnableScrollAnimator(bool) override;
90 void setEnableTouchAdjustment(bool) override;
91 bool multiTargetTapNotificationEnabled() override;
92 void setMultiTargetTapNotificationEnabled(bool) override;
93 void setExperimentalWebGLEnabled(bool) override;
94 void setFantasyFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
95 void setFixedFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
96 void setReportWheelOverscroll(bool) override;
97 void setForceZeroLayoutHeight(bool) override;
98 void setFullscreenSupported(bool) override;
99 void setHidePinchScrollbarsNearMinScale(bool) override;
100 void setHyperlinkAuditingEnabled(bool) override;
101 void setIgnoreMainFrameOverflowHiddenQuirk(bool) override;
102 void setImageAnimationPolicy(ImageAnimationPolicy) override;
103 void setImagesEnabled(bool) override;
104 void setInlineTextBoxAccessibilityEnabled(bool) override;
105 void setInvertViewportScrollOrder(bool) override;
106 void setJavaScriptCanAccessClipboard(bool) override;
107 void setJavaScriptCanOpenWindowsAutomatically(bool) override;
108 void setJavaScriptEnabled(bool) override;
109 void setLoadsImagesAutomatically(bool) override;
110 void setLoadWithOverviewMode(bool) override;
111 void setLocalStorageEnabled(bool) override;
112 void setMainFrameClipsContent(bool) override;
113 void setMainFrameResizesAreOrientationChanges(bool) override;
114 void setMaxTouchPoints(int) override;
115 void setMediaControlsOverlayPlayButtonEnabled(bool) override;
116 void setMediaPlaybackRequiresUserGesture(bool) override;
117 void setMinimumAccelerated2dCanvasSize(int) override;
118 void setMinimumFontSize(int) override;
119 void setMinimumLogicalFontSize(int) override;
120 void setMockScrollbarsEnabled(bool) override;
121 void setOfflineWebApplicationCacheEnabled(bool) override;
122 void setOpenGLMultisamplingEnabled(bool) override;
123 void setPasswordEchoDurationInSeconds(double) override;
124 void setPasswordEchoEnabled(bool) override;
125 void setPerTilePaintingEnabled(bool) override;
126 void setPictographFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
127 void setPinchOverlayScrollbarThickness(int) override;
128 void setPluginsEnabled(bool) override;
129 void setAvailablePointerTypes(int) override;
130 void setPrimaryPointerType(PointerType) override;
131 void setAvailableHoverTypes(int) override;
132 void setPrimaryHoverType(HoverType) override;
133 void setPreferHiddenVolumeControls(bool) override;
134 void setRenderVSyncNotificationEnabled(bool) override;
135 void setReportScreenSizeInPhysicalPixelsQuirk(bool) override;
136 void setRootLayerScrolls(bool) override;
137 void setRubberBandingOnCompositorThread(bool) override;
138 void setSansSerifFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
139 void setSelectTrailingWhitespaceEnabled(bool override);
140 void setSelectionIncludesAltImageText(bool) override;
141 void setSelectionStrategy(SelectionStrategyType) override;
142 void setSerifFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
143 void setShouldPrintBackgrounds(bool) override;
144 void setShouldClearDocumentBackground(bool) override;
145 void setShouldRespectImageOrientation(bool) override;
146 void setShowContextMenuOnMouseUp(bool) override;
147 void setShowFPSCounter(bool) override;
148 void setShowPaintRects(bool) override;
149 void setShrinksViewportContentToFit(bool) override;
150 void setSmartInsertDeleteEnabled(bool) override;
151 void setSpatialNavigationEnabled(bool) override;
152 void setStandardFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
153 void setStrictMixedContentChecking(bool) override;
154 void setStrictMixedContentCheckingForPlugin(bool) override;
155 void setStrictPowerfulFeatureRestrictions(bool) override;
156 void setStrictlyBlockBlockableMixedContent(bool) override;
157 void setSupportDeprecatedTargetDensityDPI(bool) override;
158 void setSupportsMultipleWindows(bool) override;
159 void setSyncXHRInDocumentsEnabled(bool) override;
160 void setTextAreasAreResizable(bool) override;
161 void setTextAutosizingEnabled(bool) override;
162 void setAccessibilityFontScaleFactor(float) override;
163 void setTextTrackKindUserPreference(TextTrackKindUserPreference) override;
164 void setTextTrackBackgroundColor(const WebString&) override;
165 void setTextTrackFontFamily(const WebString&) override;
166 void setTextTrackFontStyle(const WebString&) override;
167 void setTextTrackFontVariant(const WebString&) override;
168 void setTextTrackTextColor(const WebString&) override;
169 void setTextTrackTextShadow(const WebString&) override;
170 void setTextTrackTextSize(const WebString&) override;
171 void setThreadedScrollingEnabled(bool) override;
172 void setTouchDragDropEnabled(bool) override;
173 void setTouchEditingEnabled(bool) override;
174 void setUnifiedTextCheckerEnabled(bool) override;
175 void setUnsafePluginPastingEnabled(bool) override;
176 void setUsesEncodingDetector(bool) override;
177 void setUseLegacyBackgroundSizeShorthandBehavior(bool) override;
178 void setUseMobileViewportStyle(bool) override;
179 void setUseSolidColorScrollbars(bool) override;
180 void setUseWideViewport(bool) override;
181 void setV8CacheOptions(V8CacheOptions) override;
182 void setValidationMessageTimerMagnification(int) override;
183 void setViewportEnabled(bool) override;
184 void setViewportMetaEnabled(bool) override;
185 void setViewportMetaLayoutSizeQuirk(bool) override;
186 void setViewportMetaMergeContentQuirk(bool) override;
187 void setViewportMetaNonUserScalableQuirk(bool) override;
188 void setViewportMetaZeroValuesQuirk(bool) override;
189 void setWebAudioEnabled(bool) override;
190 void setWebGLErrorsToConsoleEnabled(bool) override;
191 void setWebSecurityEnabled(bool) override;
192 void setWideViewportQuirkEnabled(bool) override;
193 void setXSSAuditorEnabled(bool) override;
195 bool showFPSCounter() const { return m_showFPSCounter; }
196 bool showPaintRects() const { return m_showPaintRects; }
197 bool renderVSyncNotificationEnabled() const { return m_renderVSyncNotificationEnabled; }
198 bool autoZoomFocusedNodeToLegibleScale() const { return m_autoZoomFocusedNodeToLegibleScale; }
199 bool doubleTapToZoomEnabled() const;
200 bool perTilePaintingEnabled() const { return m_perTilePaintingEnabled; }
201 bool supportDeprecatedTargetDensityDPI() const { return m_supportDeprecatedTargetDensityDPI; }
202 bool viewportMetaEnabled() const;
203 bool viewportMetaLayoutSizeQuirk() const { return m_viewportMetaLayoutSizeQuirk; }
204 bool viewportMetaNonUserScalableQuirk() const { return m_viewportMetaNonUserScalableQuirk; }
205 bool clobberUserAgentInitialScaleQuirk() const { return m_clobberUserAgentInitialScaleQuirk; }
207 void setMockGestureTapHighlightsEnabled(bool);
208 bool mockGestureTapHighlightsEnabled() const;
210 private:
211 Settings* m_settings;
212 DevToolsEmulator* m_devToolsEmulator;
213 bool m_showFPSCounter;
214 bool m_showPaintRects;
215 bool m_renderVSyncNotificationEnabled;
216 bool m_autoZoomFocusedNodeToLegibleScale;
217 bool m_perTilePaintingEnabled;
218 bool m_supportDeprecatedTargetDensityDPI;
219 bool m_shrinksViewportContentToFit;
220 // This quirk is to maintain compatibility with Android apps built on
221 // the Android SDK prior to and including version 18. Presumably, this
222 // can be removed any time after 2015. See http://crbug.com/277369.
223 bool m_viewportMetaLayoutSizeQuirk;
224 // This quirk is to maintain compatibility with Android apps built on
225 // the Android SDK prior to and including version 18. Presumably, this
226 // can be removed any time after 2015. See http://crbug.com/312691.
227 bool m_viewportMetaNonUserScalableQuirk;
228 // This quirk is to maintain compatibility with Android apps built on
229 // the Android SDK prior to and including version 18. Presumably, this
230 // can be removed any time after 2015. See http://crbug.com/313754.
231 bool m_clobberUserAgentInitialScaleQuirk;
232 bool m_mainFrameResizesAreOrientationChanges;
235 } // namespace blink
237 #endif