blob: a763c77c367bcfff9bfc0390e731cd0f6baec542 [file] [log] [blame]
Adam Barth06caa3d2014-10-23 11:15:41 -07001/*
2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
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.
17 *
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.
29 */
30
31#ifndef WebSettingsImpl_h
32#define WebSettingsImpl_h
33
34#include "public/web/WebSettings.h"
35
36namespace blink {
37
38class Settings;
39
Eric Seidel40ee4c72014-11-14 12:55:21 -080040class WebSettingsImpl final : public WebSettings {
Adam Barth06caa3d2014-10-23 11:15:41 -070041public:
42 explicit WebSettingsImpl(Settings*);
43 virtual ~WebSettingsImpl() { }
44
Adam Barthf438d5b2014-10-24 15:15:13 -070045 virtual bool mainFrameResizesAreOrientationChanges() const override;
46 virtual bool shrinksViewportContentToFit() const override;
47 virtual int availablePointerTypes() const override;
48 virtual PointerType primaryPointerType() const override;
49 virtual int availableHoverTypes() const override;
50 virtual HoverType primaryHoverType() const override;
Adam Barthf438d5b2014-10-24 15:15:13 -070051 virtual void setAccelerated2dCanvasEnabled(bool) override;
52 virtual void setAccelerated2dCanvasMSAASampleCount(int) override;
53 virtual void setPreferCompositingToLCDTextEnabled(bool) override;
Adam Barthf438d5b2014-10-24 15:15:13 -070054 virtual void setAntialiased2dCanvasEnabled(bool) override;
55 virtual void setAsynchronousSpellCheckingEnabled(bool) override;
Adam Barthf438d5b2014-10-24 15:15:13 -070056 virtual void setContainerCullingEnabled(bool) override;
Adam Barthf438d5b2014-10-24 15:15:13 -070057 virtual void setCursiveFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
58 virtual void setDOMPasteAllowed(bool) override;
59 virtual void setDefaultFixedFontSize(int) override;
60 virtual void setDefaultFontSize(int) override;
61 virtual void setDefaultTextEncodingName(const WebString&) override;
62 virtual void setDefaultVideoPosterURL(const WebString&) override;
63 virtual void setDeferredFiltersEnabled(bool) override;
64 virtual void setDeferredImageDecodingEnabled(bool) override;
Adam Barthf438d5b2014-10-24 15:15:13 -070065 virtual void setDeviceSupportsMouse(bool) override;
Adam Barth06caa3d2014-10-23 11:15:41 -070066
67 // FIXME: Remove once the pointer/hover features are converted to use the
68 // new APIs (e.g. setPrimaryPointerType) on the chromium side
Adam Barthf438d5b2014-10-24 15:15:13 -070069 virtual void setDeviceSupportsTouch(bool) override;
Adam Barth06caa3d2014-10-23 11:15:41 -070070
Adam Barthf438d5b2014-10-24 15:15:13 -070071 virtual void setDownloadableBinaryFontsEnabled(bool) override;
Adam Barthf438d5b2014-10-24 15:15:13 -070072 virtual void setEnableTouchAdjustment(bool) override;
73 virtual void setExperimentalWebGLEnabled(bool) override;
74 virtual void setFantasyFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
75 virtual void setFixedFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
76 virtual void setForceZeroLayoutHeight(bool) override;
Adam Barthf438d5b2014-10-24 15:15:13 -070077 virtual void setImagesEnabled(bool) override;
Adam Barthf438d5b2014-10-24 15:15:13 -070078 virtual void setJavaScriptCanAccessClipboard(bool) override;
79 virtual void setLoadsImagesAutomatically(bool) override;
80 virtual void setLoadWithOverviewMode(bool) override;
Adam Barthf438d5b2014-10-24 15:15:13 -070081 virtual void setMainFrameClipsContent(bool) override;
82 virtual void setMainFrameResizesAreOrientationChanges(bool) override;
83 virtual void setMaxTouchPoints(int) override;
84 virtual void setMediaControlsOverlayPlayButtonEnabled(bool) override;
85 virtual void setMediaPlaybackRequiresUserGesture(bool) override;
86 virtual void setMinimumAccelerated2dCanvasSize(int) override;
Adam Barthf438d5b2014-10-24 15:15:13 -070087 virtual void setOpenGLMultisamplingEnabled(bool) override;
88 virtual void setPerTilePaintingEnabled(bool) override;
89 virtual void setPictographFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
Adam Barthf438d5b2014-10-24 15:15:13 -070090 virtual void setAvailablePointerTypes(int) override;
91 virtual void setPrimaryPointerType(PointerType) override;
92 virtual void setAvailableHoverTypes(int) override;
93 virtual void setPrimaryHoverType(HoverType) override;
94 virtual void setRenderVSyncNotificationEnabled(bool) override;
95 virtual void setSansSerifFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
96 virtual void setSelectionIncludesAltImageText(bool) override;
97 virtual void setSerifFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
98 virtual void setShouldClearDocumentBackground(bool) override;
99 virtual void setShouldRespectImageOrientation(bool) override;
100 virtual void setShowFPSCounter(bool) override;
101 virtual void setShowPaintRects(bool) override;
Adam Barthf438d5b2014-10-24 15:15:13 -0700102 virtual void setShrinksViewportContentToFit(bool) override;
103 virtual void setSmartInsertDeleteEnabled(bool) override;
104 virtual void setStandardFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override;
105 virtual void setSupportDeprecatedTargetDensityDPI(bool) override;
Adam Barthf438d5b2014-10-24 15:15:13 -0700106 virtual void setTouchEditingEnabled(bool) override;
107 virtual void setUnifiedTextCheckerEnabled(bool) override;
108 virtual void setUseSolidColorScrollbars(bool) override;
109 virtual void setUseWideViewport(bool) override;
110 virtual void setV8CacheOptions(V8CacheOptions) override;
Adam Barthf438d5b2014-10-24 15:15:13 -0700111 virtual void setWebGLErrorsToConsoleEnabled(bool) override;
Adam Barth06caa3d2014-10-23 11:15:41 -0700112
113 bool showFPSCounter() const { return m_showFPSCounter; }
114 bool showPaintRects() const { return m_showPaintRects; }
115 bool renderVSyncNotificationEnabled() const { return m_renderVSyncNotificationEnabled; }
Adam Barth06caa3d2014-10-23 11:15:41 -0700116 bool perTilePaintingEnabled() const { return m_perTilePaintingEnabled; }
117 bool supportDeprecatedTargetDensityDPI() const { return m_supportDeprecatedTargetDensityDPI; }
118
119 void setMockGestureTapHighlightsEnabled(bool);
120 bool mockGestureTapHighlightsEnabled() const;
121
122private:
123 Settings* m_settings;
124 bool m_showFPSCounter;
125 bool m_showPaintRects;
126 bool m_renderVSyncNotificationEnabled;
Adam Barth06caa3d2014-10-23 11:15:41 -0700127 bool m_deferredImageDecodingEnabled;
Adam Barth06caa3d2014-10-23 11:15:41 -0700128 bool m_perTilePaintingEnabled;
129 bool m_supportDeprecatedTargetDensityDPI;
130 bool m_shrinksViewportContentToFit;
131 bool m_mainFrameResizesAreOrientationChanges;
132};
133
134} // namespace blink
135
136#endif