Adam Barth | 06caa3d | 2014-10-23 11:15:41 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 36 | namespace blink { |
| 37 | |
| 38 | class Settings; |
| 39 | |
Eric Seidel | 40ee4c7 | 2014-11-14 12:55:21 -0800 | [diff] [blame] | 40 | class WebSettingsImpl final : public WebSettings { |
Adam Barth | 06caa3d | 2014-10-23 11:15:41 -0700 | [diff] [blame] | 41 | public: |
| 42 | explicit WebSettingsImpl(Settings*); |
| 43 | virtual ~WebSettingsImpl() { } |
| 44 | |
Adam Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 45 | 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 Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 51 | virtual void setAccelerated2dCanvasEnabled(bool) override; |
| 52 | virtual void setAccelerated2dCanvasMSAASampleCount(int) override; |
| 53 | virtual void setPreferCompositingToLCDTextEnabled(bool) override; |
Adam Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 54 | virtual void setAntialiased2dCanvasEnabled(bool) override; |
| 55 | virtual void setAsynchronousSpellCheckingEnabled(bool) override; |
Adam Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 56 | virtual void setContainerCullingEnabled(bool) override; |
Adam Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 57 | 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 Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 65 | virtual void setDeviceSupportsMouse(bool) override; |
Adam Barth | 06caa3d | 2014-10-23 11:15:41 -0700 | [diff] [blame] | 66 | |
| 67 | // FIXME: Remove once the pointer/hover features are converted to use the |
| 68 | // new APIs (e.g. setPrimaryPointerType) on the chromium side |
Adam Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 69 | virtual void setDeviceSupportsTouch(bool) override; |
Adam Barth | 06caa3d | 2014-10-23 11:15:41 -0700 | [diff] [blame] | 70 | |
Adam Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 71 | virtual void setDownloadableBinaryFontsEnabled(bool) override; |
Adam Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 72 | 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 Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 77 | virtual void setImagesEnabled(bool) override; |
Adam Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 78 | virtual void setJavaScriptCanAccessClipboard(bool) override; |
| 79 | virtual void setLoadsImagesAutomatically(bool) override; |
| 80 | virtual void setLoadWithOverviewMode(bool) override; |
Adam Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 81 | 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 Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 87 | virtual void setOpenGLMultisamplingEnabled(bool) override; |
| 88 | virtual void setPerTilePaintingEnabled(bool) override; |
| 89 | virtual void setPictographFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) override; |
Adam Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 90 | 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 Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 102 | 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 Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 106 | 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 Barth | f438d5b | 2014-10-24 15:15:13 -0700 | [diff] [blame] | 111 | virtual void setWebGLErrorsToConsoleEnabled(bool) override; |
Adam Barth | 06caa3d | 2014-10-23 11:15:41 -0700 | [diff] [blame] | 112 | |
| 113 | bool showFPSCounter() const { return m_showFPSCounter; } |
| 114 | bool showPaintRects() const { return m_showPaintRects; } |
| 115 | bool renderVSyncNotificationEnabled() const { return m_renderVSyncNotificationEnabled; } |
Adam Barth | 06caa3d | 2014-10-23 11:15:41 -0700 | [diff] [blame] | 116 | bool perTilePaintingEnabled() const { return m_perTilePaintingEnabled; } |
| 117 | bool supportDeprecatedTargetDensityDPI() const { return m_supportDeprecatedTargetDensityDPI; } |
| 118 | |
| 119 | void setMockGestureTapHighlightsEnabled(bool); |
| 120 | bool mockGestureTapHighlightsEnabled() const; |
| 121 | |
| 122 | private: |
| 123 | Settings* m_settings; |
| 124 | bool m_showFPSCounter; |
| 125 | bool m_showPaintRects; |
| 126 | bool m_renderVSyncNotificationEnabled; |
Adam Barth | 06caa3d | 2014-10-23 11:15:41 -0700 | [diff] [blame] | 127 | bool m_deferredImageDecodingEnabled; |
Adam Barth | 06caa3d | 2014-10-23 11:15:41 -0700 | [diff] [blame] | 128 | bool m_perTilePaintingEnabled; |
| 129 | bool m_supportDeprecatedTargetDensityDPI; |
| 130 | bool m_shrinksViewportContentToFit; |
| 131 | bool m_mainFrameResizesAreOrientationChanges; |
| 132 | }; |
| 133 | |
| 134 | } // namespace blink |
| 135 | |
| 136 | #endif |