| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class DevToolsEmulator; | 38 class DevToolsEmulator; |
| 39 class Settings; | 39 class Settings; |
| 40 | 40 |
| 41 class WebSettingsImpl final : public WebSettings { | 41 class WebSettingsImpl final : public WebSettings { |
| 42 public: | 42 public: |
| 43 WebSettingsImpl(Settings*, DevToolsEmulator*); | 43 WebSettingsImpl(Settings*, DevToolsEmulator*); |
| 44 virtual ~WebSettingsImpl() { } | 44 virtual ~WebSettingsImpl() { } |
| 45 | 45 |
| 46 virtual void setFromStrings(const WebString& name, const WebString& value) o
verride; | 46 void setFromStrings(const WebString& name, const WebString& value) override; |
| 47 | 47 |
| 48 virtual bool mainFrameResizesAreOrientationChanges() const override; | 48 bool mainFrameResizesAreOrientationChanges() const override; |
| 49 virtual bool shrinksViewportContentToFit() const override; | 49 bool shrinksViewportContentToFit() const override; |
| 50 virtual int availablePointerTypes() const override; | 50 int availablePointerTypes() const override; |
| 51 virtual PointerType primaryPointerType() const override; | 51 PointerType primaryPointerType() const override; |
| 52 virtual int availableHoverTypes() const override; | 52 int availableHoverTypes() const override; |
| 53 virtual HoverType primaryHoverType() const override; | 53 HoverType primaryHoverType() const override; |
| 54 virtual bool viewportEnabled() const override; | 54 bool viewportEnabled() const override; |
| 55 virtual void setAccelerated2dCanvasEnabled(bool) override; | 55 void setAccelerated2dCanvasEnabled(bool) override; |
| 56 virtual void setAccelerated2dCanvasMSAASampleCount(int) override; | 56 void setAccelerated2dCanvasMSAASampleCount(int) override; |
| 57 virtual void setAcceleratedCompositingEnabled(bool) override; | 57 void setAcceleratedCompositingEnabled(bool) override; |
| 58 virtual void setPreferCompositingToLCDTextEnabled(bool) override; | 58 void setPreferCompositingToLCDTextEnabled(bool) override; |
| 59 virtual void setAccessibilityEnabled(bool) override; | 59 void setAccessibilityEnabled(bool) override; |
| 60 virtual void setAccessibilityPasswordValuesEnabled(bool) override; | 60 void setAccessibilityPasswordValuesEnabled(bool) override; |
| 61 virtual void setAllowDisplayOfInsecureContent(bool) override; | 61 void setAllowDisplayOfInsecureContent(bool) override; |
| 62 virtual void setAllowFileAccessFromFileURLs(bool) override; | 62 void setAllowFileAccessFromFileURLs(bool) override; |
| 63 virtual void setAllowCustomScrollbarInMainFrame(bool) override; | 63 void setAllowCustomScrollbarInMainFrame(bool) override; |
| 64 virtual void setAllowRunningOfInsecureContent(bool) override; | 64 void setAllowRunningOfInsecureContent(bool) override; |
| 65 virtual void setAllowScriptsToCloseWindows(bool) override; | 65 void setAllowScriptsToCloseWindows(bool) override; |
| 66 virtual void setAllowUniversalAccessFromFileURLs(bool) override; | 66 void setAllowUniversalAccessFromFileURLs(bool) override; |
| 67 virtual void setAntialiased2dCanvasEnabled(bool) override; | 67 void setAntialiased2dCanvasEnabled(bool) override; |
| 68 virtual void setAntialiasedClips2dCanvasEnabled(bool) override; | 68 void setAntialiasedClips2dCanvasEnabled(bool) override; |
| 69 virtual void setAsynchronousSpellCheckingEnabled(bool) override; | 69 void setAsynchronousSpellCheckingEnabled(bool) override; |
| 70 virtual void setAutoZoomFocusedNodeToLegibleScale(bool) override; | 70 void setAutoZoomFocusedNodeToLegibleScale(bool) override; |
| 71 virtual void setCaretBrowsingEnabled(bool) override; | 71 void setCaretBrowsingEnabled(bool) override; |
| 72 virtual void setClobberUserAgentInitialScaleQuirk(bool) override; | 72 void setClobberUserAgentInitialScaleQuirk(bool) override; |
| 73 virtual void setCookieEnabled(bool) override; | 73 void setCookieEnabled(bool) override; |
| 74 virtual void setNavigateOnDragDrop(bool) override; | 74 void setNavigateOnDragDrop(bool) override; |
| 75 virtual void setCursiveFontFamily(const WebString&, UScriptCode = USCRIPT_CO
MMON) override; | 75 void setCursiveFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) ov
erride; |
| 76 virtual void setDNSPrefetchingEnabled(bool) override; | 76 void setDNSPrefetchingEnabled(bool) override; |
| 77 virtual void setDOMPasteAllowed(bool) override; | 77 void setDOMPasteAllowed(bool) override; |
| 78 virtual void setDefaultFixedFontSize(int) override; | 78 void setDefaultFixedFontSize(int) override; |
| 79 virtual void setDefaultFontSize(int) override; | 79 void setDefaultFontSize(int) override; |
| 80 virtual void setDefaultTextEncodingName(const WebString&) override; | 80 void setDefaultTextEncodingName(const WebString&) override; |
| 81 virtual void setDefaultVideoPosterURL(const WebString&) override; | 81 void setDefaultVideoPosterURL(const WebString&) override; |
| 82 virtual void setDeviceScaleAdjustment(float) override; | 82 void setDeviceScaleAdjustment(float) override; |
| 83 | 83 |
| 84 // FIXME: Replace these two with pointer/hover queries? crbug.com/441813 | 84 // FIXME: Replace these two with pointer/hover queries? crbug.com/441813 |
| 85 virtual void setDeviceSupportsMouse(bool) override; | 85 void setDeviceSupportsMouse(bool) override; |
| 86 virtual void setDeviceSupportsTouch(bool) override; | 86 void setDeviceSupportsTouch(bool) override; |
| 87 | 87 |
| 88 virtual void setDisableReadingFromCanvas(bool) override; | 88 void setDisableReadingFromCanvas(bool) override; |
| 89 virtual void setDoubleTapToZoomEnabled(bool) override; | 89 void setDoubleTapToZoomEnabled(bool) override; |
| 90 virtual void setDownloadableBinaryFontsEnabled(bool) override; | 90 void setDownloadableBinaryFontsEnabled(bool) override; |
| 91 virtual void setEditingBehavior(EditingBehavior) override; | 91 void setEditingBehavior(EditingBehavior) override; |
| 92 virtual void setEnableScrollAnimator(bool) override; | 92 void setEnableScrollAnimator(bool) override; |
| 93 virtual void setEnableTouchAdjustment(bool) override; | 93 void setEnableTouchAdjustment(bool) override; |
| 94 virtual bool multiTargetTapNotificationEnabled() override; | 94 bool multiTargetTapNotificationEnabled() override; |
| 95 virtual void setMultiTargetTapNotificationEnabled(bool) override; | 95 void setMultiTargetTapNotificationEnabled(bool) override; |
| 96 virtual void setExperimentalWebGLEnabled(bool) override; | 96 void setExperimentalWebGLEnabled(bool) override; |
| 97 virtual void setFantasyFontFamily(const WebString&, UScriptCode = USCRIPT_CO
MMON) override; | 97 void setFantasyFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) ov
erride; |
| 98 virtual void setFixedFontFamily(const WebString&, UScriptCode = USCRIPT_COMM
ON) override; | 98 void setFixedFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) over
ride; |
| 99 virtual void setReportWheelOverscroll(bool) override; | 99 void setReportWheelOverscroll(bool) override; |
| 100 virtual void setForceZeroLayoutHeight(bool) override; | 100 void setForceZeroLayoutHeight(bool) override; |
| 101 virtual void setFullscreenSupported(bool) override; | 101 void setFullscreenSupported(bool) override; |
| 102 virtual void setHyperlinkAuditingEnabled(bool) override; | 102 void setHyperlinkAuditingEnabled(bool) override; |
| 103 virtual void setIgnoreMainFrameOverflowHiddenQuirk(bool) override; | 103 void setIgnoreMainFrameOverflowHiddenQuirk(bool) override; |
| 104 virtual void setImageAnimationPolicy(ImageAnimationPolicy) override; | 104 void setImageAnimationPolicy(ImageAnimationPolicy) override; |
| 105 virtual void setImagesEnabled(bool) override; | 105 void setImagesEnabled(bool) override; |
| 106 virtual void setInlineTextBoxAccessibilityEnabled(bool) override; | 106 void setInlineTextBoxAccessibilityEnabled(bool) override; |
| 107 virtual void setInvertViewportScrollOrder(bool) override; | 107 void setInvertViewportScrollOrder(bool) override; |
| 108 virtual void setJavaEnabled(bool) override; | 108 void setJavaEnabled(bool) override; |
| 109 virtual void setJavaScriptCanAccessClipboard(bool) override; | 109 void setJavaScriptCanAccessClipboard(bool) override; |
| 110 virtual void setJavaScriptCanOpenWindowsAutomatically(bool) override; | 110 void setJavaScriptCanOpenWindowsAutomatically(bool) override; |
| 111 virtual void setJavaScriptEnabled(bool) override; | 111 void setJavaScriptEnabled(bool) override; |
| 112 virtual void setLoadsImagesAutomatically(bool) override; | 112 void setLoadsImagesAutomatically(bool) override; |
| 113 virtual void setLoadWithOverviewMode(bool) override; | 113 void setLoadWithOverviewMode(bool) override; |
| 114 virtual void setLocalStorageEnabled(bool) override; | 114 void setLocalStorageEnabled(bool) override; |
| 115 virtual void setMainFrameClipsContent(bool) override; | 115 void setMainFrameClipsContent(bool) override; |
| 116 virtual void setMainFrameResizesAreOrientationChanges(bool) override; | 116 void setMainFrameResizesAreOrientationChanges(bool) override; |
| 117 virtual void setMaxTouchPoints(int) override; | 117 void setMaxTouchPoints(int) override; |
| 118 virtual void setMediaControlsOverlayPlayButtonEnabled(bool) override; | 118 void setMediaControlsOverlayPlayButtonEnabled(bool) override; |
| 119 virtual void setMediaPlaybackRequiresUserGesture(bool) override; | 119 void setMediaPlaybackRequiresUserGesture(bool) override; |
| 120 virtual void setMinimumAccelerated2dCanvasSize(int) override; | 120 void setMinimumAccelerated2dCanvasSize(int) override; |
| 121 virtual void setMinimumFontSize(int) override; | 121 void setMinimumFontSize(int) override; |
| 122 virtual void setMinimumLogicalFontSize(int) override; | 122 void setMinimumLogicalFontSize(int) override; |
| 123 virtual void setMockScrollbarsEnabled(bool) override; | 123 void setMockScrollbarsEnabled(bool) override; |
| 124 virtual void setOfflineWebApplicationCacheEnabled(bool) override; | 124 void setOfflineWebApplicationCacheEnabled(bool) override; |
| 125 virtual void setOpenGLMultisamplingEnabled(bool) override; | 125 void setOpenGLMultisamplingEnabled(bool) override; |
| 126 virtual void setPasswordEchoDurationInSeconds(double) override; | 126 void setPasswordEchoDurationInSeconds(double) override; |
| 127 virtual void setPasswordEchoEnabled(bool) override; | 127 void setPasswordEchoEnabled(bool) override; |
| 128 virtual void setPerTilePaintingEnabled(bool) override; | 128 void setPerTilePaintingEnabled(bool) override; |
| 129 virtual void setPictographFontFamily(const WebString&, UScriptCode = USCRIPT
_COMMON) override; | 129 void setPictographFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON)
override; |
| 130 virtual void setPinchOverlayScrollbarThickness(int) override; | 130 void setPinchOverlayScrollbarThickness(int) override; |
| 131 virtual void setPluginsEnabled(bool) override; | 131 void setPluginsEnabled(bool) override; |
| 132 virtual void setAvailablePointerTypes(int) override; | 132 void setAvailablePointerTypes(int) override; |
| 133 virtual void setPrimaryPointerType(PointerType) override; | 133 void setPrimaryPointerType(PointerType) override; |
| 134 virtual void setAvailableHoverTypes(int) override; | 134 void setAvailableHoverTypes(int) override; |
| 135 virtual void setPrimaryHoverType(HoverType) override; | 135 void setPrimaryHoverType(HoverType) override; |
| 136 virtual void setRenderVSyncNotificationEnabled(bool) override; | 136 void setRenderVSyncNotificationEnabled(bool) override; |
| 137 virtual void setReportScreenSizeInPhysicalPixelsQuirk(bool) override; | 137 void setReportScreenSizeInPhysicalPixelsQuirk(bool) override; |
| 138 virtual void setRootLayerScrolls(bool) override; | 138 void setRootLayerScrolls(bool) override; |
| 139 virtual void setRubberBandingOnCompositorThread(bool) override; | 139 void setRubberBandingOnCompositorThread(bool) override; |
| 140 virtual void setSansSerifFontFamily(const WebString&, UScriptCode = USCRIPT_
COMMON) override; | 140 void setSansSerifFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON)
override; |
| 141 virtual void setSelectTrailingWhitespaceEnabled(bool override); | 141 void setSelectTrailingWhitespaceEnabled(bool override); |
| 142 virtual void setSelectionIncludesAltImageText(bool) override; | 142 void setSelectionIncludesAltImageText(bool) override; |
| 143 virtual void setSelectionStrategy(SelectionStrategyType) override; | 143 void setSelectionStrategy(SelectionStrategyType) override; |
| 144 virtual void setSerifFontFamily(const WebString&, UScriptCode = USCRIPT_COMM
ON) override; | 144 void setSerifFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) over
ride; |
| 145 virtual void setShouldPrintBackgrounds(bool) override; | 145 void setShouldPrintBackgrounds(bool) override; |
| 146 virtual void setShouldClearDocumentBackground(bool) override; | 146 void setShouldClearDocumentBackground(bool) override; |
| 147 virtual void setShouldRespectImageOrientation(bool) override; | 147 void setShouldRespectImageOrientation(bool) override; |
| 148 virtual void setShowContextMenuOnMouseUp(bool) override; | 148 void setShowContextMenuOnMouseUp(bool) override; |
| 149 virtual void setShowFPSCounter(bool) override; | 149 void setShowFPSCounter(bool) override; |
| 150 virtual void setShowPaintRects(bool) override; | 150 void setShowPaintRects(bool) override; |
| 151 virtual void setShrinksViewportContentToFit(bool) override; | 151 void setShrinksViewportContentToFit(bool) override; |
| 152 virtual void setSmartInsertDeleteEnabled(bool) override; | 152 void setSmartInsertDeleteEnabled(bool) override; |
| 153 virtual void setSpatialNavigationEnabled(bool) override; | 153 void setSpatialNavigationEnabled(bool) override; |
| 154 virtual void setStandardFontFamily(const WebString&, UScriptCode = USCRIPT_C
OMMON) override; | 154 void setStandardFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) o
verride; |
| 155 virtual void setStrictMixedContentChecking(bool) override; | 155 void setStrictMixedContentChecking(bool) override; |
| 156 virtual void setStrictPowerfulFeatureRestrictions(bool) override; | 156 void setStrictPowerfulFeatureRestrictions(bool) override; |
| 157 virtual void setSupportDeprecatedTargetDensityDPI(bool) override; | 157 void setSupportDeprecatedTargetDensityDPI(bool) override; |
| 158 virtual void setSupportsMultipleWindows(bool) override; | 158 void setSupportsMultipleWindows(bool) override; |
| 159 virtual void setSyncXHRInDocumentsEnabled(bool) override; | 159 void setSyncXHRInDocumentsEnabled(bool) override; |
| 160 virtual void setTextAreasAreResizable(bool) override; | 160 void setTextAreasAreResizable(bool) override; |
| 161 virtual void setTextAutosizingEnabled(bool) override; | 161 void setTextAutosizingEnabled(bool) override; |
| 162 virtual void setAccessibilityFontScaleFactor(float) override; | 162 void setAccessibilityFontScaleFactor(float) override; |
| 163 virtual void setTextTrackBackgroundColor(const WebString&); | 163 virtual void setTextTrackBackgroundColor(const WebString&); |
| 164 virtual void setTextTrackFontFamily(const WebString&); | 164 virtual void setTextTrackFontFamily(const WebString&); |
| 165 virtual void setTextTrackFontStyle(const WebString&); | 165 virtual void setTextTrackFontStyle(const WebString&); |
| 166 virtual void setTextTrackFontVariant(const WebString&); | 166 virtual void setTextTrackFontVariant(const WebString&); |
| 167 virtual void setTextTrackTextColor(const WebString&); | 167 virtual void setTextTrackTextColor(const WebString&); |
| 168 virtual void setTextTrackTextShadow(const WebString&); | 168 virtual void setTextTrackTextShadow(const WebString&); |
| 169 virtual void setTextTrackTextSize(const WebString&); | 169 virtual void setTextTrackTextSize(const WebString&); |
| 170 virtual void setThreadedScrollingEnabled(bool) override; | 170 void setThreadedScrollingEnabled(bool) override; |
| 171 virtual void setTouchDragDropEnabled(bool) override; | 171 void setTouchDragDropEnabled(bool) override; |
| 172 virtual void setTouchEditingEnabled(bool) override; | 172 void setTouchEditingEnabled(bool) override; |
| 173 virtual void setUnifiedTextCheckerEnabled(bool) override; | 173 void setUnifiedTextCheckerEnabled(bool) override; |
| 174 virtual void setUnsafePluginPastingEnabled(bool) override; | 174 void setUnsafePluginPastingEnabled(bool) override; |
| 175 virtual void setUsesEncodingDetector(bool) override; | 175 void setUsesEncodingDetector(bool) override; |
| 176 virtual void setUseLegacyBackgroundSizeShorthandBehavior(bool) override; | 176 void setUseLegacyBackgroundSizeShorthandBehavior(bool) override; |
| 177 virtual void setUseMobileViewportStyle(bool) override; | 177 void setUseMobileViewportStyle(bool) override; |
| 178 virtual void setUseSolidColorScrollbars(bool) override; | 178 void setUseSolidColorScrollbars(bool) override; |
| 179 virtual void setUseWideViewport(bool) override; | 179 void setUseWideViewport(bool) override; |
| 180 virtual void setV8CacheOptions(V8CacheOptions) override; | 180 void setV8CacheOptions(V8CacheOptions) override; |
| 181 virtual void setValidationMessageTimerMagnification(int) override; | 181 void setValidationMessageTimerMagnification(int) override; |
| 182 virtual void setViewportEnabled(bool) override; | 182 void setViewportEnabled(bool) override; |
| 183 virtual void setViewportMetaEnabled(bool) override; | 183 void setViewportMetaEnabled(bool) override; |
| 184 virtual void setViewportMetaLayoutSizeQuirk(bool) override; | 184 void setViewportMetaLayoutSizeQuirk(bool) override; |
| 185 virtual void setViewportMetaMergeContentQuirk(bool) override; | 185 void setViewportMetaMergeContentQuirk(bool) override; |
| 186 virtual void setViewportMetaNonUserScalableQuirk(bool) override; | 186 void setViewportMetaNonUserScalableQuirk(bool) override; |
| 187 virtual void setViewportMetaZeroValuesQuirk(bool) override; | 187 void setViewportMetaZeroValuesQuirk(bool) override; |
| 188 virtual void setWebAudioEnabled(bool) override; | 188 void setWebAudioEnabled(bool) override; |
| 189 virtual void setWebGLErrorsToConsoleEnabled(bool) override; | 189 void setWebGLErrorsToConsoleEnabled(bool) override; |
| 190 virtual void setWebSecurityEnabled(bool) override; | 190 void setWebSecurityEnabled(bool) override; |
| 191 virtual void setWideViewportQuirkEnabled(bool) override; | 191 void setWideViewportQuirkEnabled(bool) override; |
| 192 virtual void setXSSAuditorEnabled(bool) override; | 192 void setXSSAuditorEnabled(bool) override; |
| 193 | 193 |
| 194 bool showFPSCounter() const { return m_showFPSCounter; } | 194 bool showFPSCounter() const { return m_showFPSCounter; } |
| 195 bool showPaintRects() const { return m_showPaintRects; } | 195 bool showPaintRects() const { return m_showPaintRects; } |
| 196 bool renderVSyncNotificationEnabled() const { return m_renderVSyncNotificati
onEnabled; } | 196 bool renderVSyncNotificationEnabled() const { return m_renderVSyncNotificati
onEnabled; } |
| 197 bool autoZoomFocusedNodeToLegibleScale() const { return m_autoZoomFocusedNod
eToLegibleScale; } | 197 bool autoZoomFocusedNodeToLegibleScale() const { return m_autoZoomFocusedNod
eToLegibleScale; } |
| 198 bool doubleTapToZoomEnabled() const; | 198 bool doubleTapToZoomEnabled() const; |
| 199 bool perTilePaintingEnabled() const { return m_perTilePaintingEnabled; } | 199 bool perTilePaintingEnabled() const { return m_perTilePaintingEnabled; } |
| 200 bool supportDeprecatedTargetDensityDPI() const { return m_supportDeprecatedT
argetDensityDPI; } | 200 bool supportDeprecatedTargetDensityDPI() const { return m_supportDeprecatedT
argetDensityDPI; } |
| 201 bool viewportMetaEnabled() const; | 201 bool viewportMetaEnabled() const; |
| 202 bool viewportMetaLayoutSizeQuirk() const { return m_viewportMetaLayoutSizeQu
irk; } | 202 bool viewportMetaLayoutSizeQuirk() const { return m_viewportMetaLayoutSizeQu
irk; } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 227 // This quirk is to maintain compatibility with Android apps built on | 227 // This quirk is to maintain compatibility with Android apps built on |
| 228 // the Android SDK prior to and including version 18. Presumably, this | 228 // the Android SDK prior to and including version 18. Presumably, this |
| 229 // can be removed any time after 2015. See http://crbug.com/313754. | 229 // can be removed any time after 2015. See http://crbug.com/313754. |
| 230 bool m_clobberUserAgentInitialScaleQuirk; | 230 bool m_clobberUserAgentInitialScaleQuirk; |
| 231 bool m_mainFrameResizesAreOrientationChanges; | 231 bool m_mainFrameResizesAreOrientationChanges; |
| 232 }; | 232 }; |
| 233 | 233 |
| 234 } // namespace blink | 234 } // namespace blink |
| 235 | 235 |
| 236 #endif | 236 #endif |
| OLD | NEW |