| 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 26 matching lines...) Expand all Loading... |
| 37 #include "public/platform/WebString.h" | 37 #include "public/platform/WebString.h" |
| 38 #include "public/platform/WebURL.h" | 38 #include "public/platform/WebURL.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 WebSettingsImpl::WebSettingsImpl(Settings* settings) | 42 WebSettingsImpl::WebSettingsImpl(Settings* settings) |
| 43 : m_settings(settings) | 43 : m_settings(settings) |
| 44 , m_showFPSCounter(false) | 44 , m_showFPSCounter(false) |
| 45 , m_showPaintRects(false) | 45 , m_showPaintRects(false) |
| 46 , m_renderVSyncNotificationEnabled(false) | 46 , m_renderVSyncNotificationEnabled(false) |
| 47 , m_autoZoomFocusedNodeToLegibleScale(false) | |
| 48 , m_deferredImageDecodingEnabled(false) | 47 , m_deferredImageDecodingEnabled(false) |
| 49 , m_doubleTapToZoomEnabled(false) | 48 , m_doubleTapToZoomEnabled(false) |
| 50 , m_supportDeprecatedTargetDensityDPI(false) | 49 , m_supportDeprecatedTargetDensityDPI(false) |
| 51 , m_shrinksViewportContentToFit(false) | 50 , m_shrinksViewportContentToFit(false) |
| 52 , m_mainFrameResizesAreOrientationChanges(false) | 51 , m_mainFrameResizesAreOrientationChanges(false) |
| 53 { | 52 { |
| 54 ASSERT(settings); | 53 ASSERT(settings); |
| 55 } | 54 } |
| 56 | 55 |
| 57 void WebSettingsImpl::setStandardFontFamily(const WebString& font, UScriptCode s
cript) | 56 void WebSettingsImpl::setStandardFontFamily(const WebString& font, UScriptCode s
cript) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 void WebSettingsImpl::setDefaultFixedFontSize(int size) | 108 void WebSettingsImpl::setDefaultFixedFontSize(int size) |
| 110 { | 109 { |
| 111 m_settings->setDefaultFixedFontSize(size); | 110 m_settings->setDefaultFixedFontSize(size); |
| 112 } | 111 } |
| 113 | 112 |
| 114 void WebSettingsImpl::setDefaultVideoPosterURL(const WebString& url) | 113 void WebSettingsImpl::setDefaultVideoPosterURL(const WebString& url) |
| 115 { | 114 { |
| 116 m_settings->setDefaultVideoPosterURL(url); | 115 m_settings->setDefaultVideoPosterURL(url); |
| 117 } | 116 } |
| 118 | 117 |
| 119 void WebSettingsImpl::setMinimumFontSize(int size) | |
| 120 { | |
| 121 m_settings->setMinimumFontSize(size); | |
| 122 } | |
| 123 | |
| 124 void WebSettingsImpl::setMinimumLogicalFontSize(int size) | |
| 125 { | |
| 126 m_settings->setMinimumLogicalFontSize(size); | |
| 127 } | |
| 128 | |
| 129 void WebSettingsImpl::setDeviceSupportsTouch(bool deviceSupportsTouch) | 118 void WebSettingsImpl::setDeviceSupportsTouch(bool deviceSupportsTouch) |
| 130 { | 119 { |
| 131 m_settings->setDeviceSupportsTouch(deviceSupportsTouch); | 120 m_settings->setDeviceSupportsTouch(deviceSupportsTouch); |
| 132 | 121 |
| 133 // FIXME: Until the embedder is converted to using the new APIs, set them | 122 // FIXME: Until the embedder is converted to using the new APIs, set them |
| 134 // here to keep the media queries working unchanged. | 123 // here to keep the media queries working unchanged. |
| 135 if (deviceSupportsTouch) { | 124 if (deviceSupportsTouch) { |
| 136 m_settings->setPrimaryPointerType(blink::PointerTypeCoarse); | 125 m_settings->setPrimaryPointerType(blink::PointerTypeCoarse); |
| 137 m_settings->setPrimaryHoverType(blink::HoverTypeOnDemand); | 126 m_settings->setPrimaryHoverType(blink::HoverTypeOnDemand); |
| 138 } else { | 127 } else { |
| 139 m_settings->setPrimaryPointerType(blink::PointerTypeNone); | 128 m_settings->setPrimaryPointerType(blink::PointerTypeNone); |
| 140 m_settings->setPrimaryHoverType(blink::HoverTypeNone); | 129 m_settings->setPrimaryHoverType(blink::HoverTypeNone); |
| 141 } | 130 } |
| 142 } | 131 } |
| 143 | 132 |
| 144 void WebSettingsImpl::setDeviceSupportsMouse(bool deviceSupportsMouse) | 133 void WebSettingsImpl::setDeviceSupportsMouse(bool deviceSupportsMouse) |
| 145 { | 134 { |
| 146 m_settings->setDeviceSupportsMouse(deviceSupportsMouse); | 135 m_settings->setDeviceSupportsMouse(deviceSupportsMouse); |
| 147 } | 136 } |
| 148 | 137 |
| 149 void WebSettingsImpl::setAutoZoomFocusedNodeToLegibleScale(bool autoZoomFocusedN
odeToLegibleScale) | |
| 150 { | |
| 151 m_autoZoomFocusedNodeToLegibleScale = autoZoomFocusedNodeToLegibleScale; | |
| 152 } | |
| 153 | |
| 154 void WebSettingsImpl::setAccessibilityFontScaleFactor(float fontScaleFactor) | |
| 155 { | |
| 156 m_settings->setAccessibilityFontScaleFactor(fontScaleFactor); | |
| 157 } | |
| 158 | |
| 159 void WebSettingsImpl::setAccessibilityEnabled(bool enabled) | |
| 160 { | |
| 161 m_settings->setAccessibilityEnabled(enabled); | |
| 162 } | |
| 163 | |
| 164 void WebSettingsImpl::setInlineTextBoxAccessibilityEnabled(bool enabled) | |
| 165 { | |
| 166 m_settings->setInlineTextBoxAccessibilityEnabled(enabled); | |
| 167 } | |
| 168 | |
| 169 void WebSettingsImpl::setDeviceScaleAdjustment(float deviceScaleAdjustment) | |
| 170 { | |
| 171 } | |
| 172 | |
| 173 void WebSettingsImpl::setDefaultTextEncodingName(const WebString& encoding) | 138 void WebSettingsImpl::setDefaultTextEncodingName(const WebString& encoding) |
| 174 { | 139 { |
| 175 m_settings->setDefaultTextEncodingName((String)encoding); | 140 m_settings->setDefaultTextEncodingName((String)encoding); |
| 176 } | 141 } |
| 177 | 142 |
| 178 void WebSettingsImpl::setWebSecurityEnabled(bool enabled) | |
| 179 { | |
| 180 m_settings->setWebSecurityEnabled(enabled); | |
| 181 } | |
| 182 | |
| 183 void WebSettingsImpl::setSupportDeprecatedTargetDensityDPI(bool supportDeprecate
dTargetDensityDPI) | 143 void WebSettingsImpl::setSupportDeprecatedTargetDensityDPI(bool supportDeprecate
dTargetDensityDPI) |
| 184 { | 144 { |
| 185 m_supportDeprecatedTargetDensityDPI = supportDeprecatedTargetDensityDPI; | 145 m_supportDeprecatedTargetDensityDPI = supportDeprecatedTargetDensityDPI; |
| 186 } | 146 } |
| 187 | 147 |
| 188 void WebSettingsImpl::setLoadsImagesAutomatically(bool loadsImagesAutomatically) | 148 void WebSettingsImpl::setLoadsImagesAutomatically(bool loadsImagesAutomatically) |
| 189 { | 149 { |
| 190 m_settings->setLoadsImagesAutomatically(loadsImagesAutomatically); | 150 m_settings->setLoadsImagesAutomatically(loadsImagesAutomatically); |
| 191 } | 151 } |
| 192 | 152 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 218 void WebSettingsImpl::setPrimaryHoverType(HoverType type) | 178 void WebSettingsImpl::setPrimaryHoverType(HoverType type) |
| 219 { | 179 { |
| 220 m_settings->setPrimaryHoverType(static_cast<blink::HoverType>(type)); | 180 m_settings->setPrimaryHoverType(static_cast<blink::HoverType>(type)); |
| 221 } | 181 } |
| 222 | 182 |
| 223 void WebSettingsImpl::setDOMPasteAllowed(bool enabled) | 183 void WebSettingsImpl::setDOMPasteAllowed(bool enabled) |
| 224 { | 184 { |
| 225 m_settings->setDOMPasteAllowed(enabled); | 185 m_settings->setDOMPasteAllowed(enabled); |
| 226 } | 186 } |
| 227 | 187 |
| 228 void WebSettingsImpl::setShrinksStandaloneImagesToFit(bool shrinkImages) | |
| 229 { | |
| 230 m_settings->setShrinksStandaloneImagesToFit(shrinkImages); | |
| 231 } | |
| 232 | |
| 233 void WebSettingsImpl::setShrinksViewportContentToFit(bool shrinkViewportContent) | 188 void WebSettingsImpl::setShrinksViewportContentToFit(bool shrinkViewportContent) |
| 234 { | 189 { |
| 235 m_shrinksViewportContentToFit = shrinkViewportContent; | 190 m_shrinksViewportContentToFit = shrinkViewportContent; |
| 236 } | 191 } |
| 237 | 192 |
| 238 void WebSettingsImpl::setTextAreasAreResizable(bool areResizable) | 193 void WebSettingsImpl::setTextAreasAreResizable(bool areResizable) |
| 239 { | 194 { |
| 240 m_settings->setTextAreasAreResizable(areResizable); | 195 m_settings->setTextAreasAreResizable(areResizable); |
| 241 } | 196 } |
| 242 | 197 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 253 void WebSettingsImpl::setDownloadableBinaryFontsEnabled(bool enabled) | 208 void WebSettingsImpl::setDownloadableBinaryFontsEnabled(bool enabled) |
| 254 { | 209 { |
| 255 m_settings->setDownloadableBinaryFontsEnabled(enabled); | 210 m_settings->setDownloadableBinaryFontsEnabled(enabled); |
| 256 } | 211 } |
| 257 | 212 |
| 258 void WebSettingsImpl::setJavaScriptCanAccessClipboard(bool enabled) | 213 void WebSettingsImpl::setJavaScriptCanAccessClipboard(bool enabled) |
| 259 { | 214 { |
| 260 m_settings->setJavaScriptCanAccessClipboard(enabled); | 215 m_settings->setJavaScriptCanAccessClipboard(enabled); |
| 261 } | 216 } |
| 262 | 217 |
| 263 void WebSettingsImpl::setLocalStorageEnabled(bool enabled) | |
| 264 { | |
| 265 m_settings->setLocalStorageEnabled(enabled); | |
| 266 } | |
| 267 | |
| 268 void WebSettingsImpl::setMainFrameClipsContent(bool enabled) | 218 void WebSettingsImpl::setMainFrameClipsContent(bool enabled) |
| 269 { | 219 { |
| 270 m_settings->setMainFrameClipsContent(enabled); | 220 m_settings->setMainFrameClipsContent(enabled); |
| 271 } | 221 } |
| 272 | 222 |
| 273 void WebSettingsImpl::setMaxTouchPoints(int maxTouchPoints) | 223 void WebSettingsImpl::setMaxTouchPoints(int maxTouchPoints) |
| 274 { | 224 { |
| 275 m_settings->setMaxTouchPoints(maxTouchPoints); | 225 m_settings->setMaxTouchPoints(maxTouchPoints); |
| 276 } | 226 } |
| 277 | 227 |
| 278 void WebSettingsImpl::setAllowUniversalAccessFromFileURLs(bool allow) | |
| 279 { | |
| 280 m_settings->setAllowUniversalAccessFromFileURLs(allow); | |
| 281 } | |
| 282 | |
| 283 void WebSettingsImpl::setAllowFileAccessFromFileURLs(bool allow) | |
| 284 { | |
| 285 m_settings->setAllowFileAccessFromFileURLs(allow); | |
| 286 } | |
| 287 | |
| 288 void WebSettingsImpl::setTouchDragDropEnabled(bool enabled) | |
| 289 { | |
| 290 m_settings->setTouchDragDropEnabled(enabled); | |
| 291 } | |
| 292 | |
| 293 void WebSettingsImpl::setTouchEditingEnabled(bool enabled) | 228 void WebSettingsImpl::setTouchEditingEnabled(bool enabled) |
| 294 { | 229 { |
| 295 m_settings->setTouchEditingEnabled(enabled); | 230 m_settings->setTouchEditingEnabled(enabled); |
| 296 } | 231 } |
| 297 | 232 |
| 298 void WebSettingsImpl::setExperimentalWebGLEnabled(bool enabled) | 233 void WebSettingsImpl::setExperimentalWebGLEnabled(bool enabled) |
| 299 { | 234 { |
| 300 m_settings->setWebGLEnabled(enabled); | 235 m_settings->setWebGLEnabled(enabled); |
| 301 } | 236 } |
| 302 | 237 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 298 |
| 364 void WebSettingsImpl::setPreferCompositingToLCDTextEnabled(bool enabled) | 299 void WebSettingsImpl::setPreferCompositingToLCDTextEnabled(bool enabled) |
| 365 { | 300 { |
| 366 } | 301 } |
| 367 | 302 |
| 368 void WebSettingsImpl::setMinimumAccelerated2dCanvasSize(int numPixels) | 303 void WebSettingsImpl::setMinimumAccelerated2dCanvasSize(int numPixels) |
| 369 { | 304 { |
| 370 m_settings->setMinimumAccelerated2dCanvasSize(numPixels); | 305 m_settings->setMinimumAccelerated2dCanvasSize(numPixels); |
| 371 } | 306 } |
| 372 | 307 |
| 373 void WebSettingsImpl::setHyperlinkAuditingEnabled(bool enabled) | |
| 374 { | |
| 375 m_settings->setHyperlinkAuditingEnabled(enabled); | |
| 376 } | |
| 377 | |
| 378 void WebSettingsImpl::setAsynchronousSpellCheckingEnabled(bool enabled) | 308 void WebSettingsImpl::setAsynchronousSpellCheckingEnabled(bool enabled) |
| 379 { | 309 { |
| 380 m_settings->setAsynchronousSpellCheckingEnabled(enabled); | 310 m_settings->setAsynchronousSpellCheckingEnabled(enabled); |
| 381 } | 311 } |
| 382 | 312 |
| 383 void WebSettingsImpl::setUnifiedTextCheckerEnabled(bool enabled) | 313 void WebSettingsImpl::setUnifiedTextCheckerEnabled(bool enabled) |
| 384 { | 314 { |
| 385 m_settings->setUnifiedTextCheckerEnabled(enabled); | 315 m_settings->setUnifiedTextCheckerEnabled(enabled); |
| 386 } | 316 } |
| 387 | 317 |
| 388 void WebSettingsImpl::setCaretBrowsingEnabled(bool enabled) | |
| 389 { | |
| 390 m_settings->setCaretBrowsingEnabled(enabled); | |
| 391 } | |
| 392 | |
| 393 void WebSettingsImpl::setValidationMessageTimerMagnification(int newValue) | |
| 394 { | |
| 395 m_settings->setValidationMessageTimerMagnification(newValue); | |
| 396 } | |
| 397 | |
| 398 void WebSettingsImpl::setAllowDisplayOfInsecureContent(bool enabled) | |
| 399 { | |
| 400 m_settings->setAllowDisplayOfInsecureContent(enabled); | |
| 401 } | |
| 402 | |
| 403 void WebSettingsImpl::setAllowRunningOfInsecureContent(bool enabled) | |
| 404 { | |
| 405 m_settings->setAllowRunningOfInsecureContent(enabled); | |
| 406 } | |
| 407 | |
| 408 void WebSettingsImpl::setAllowConnectingInsecureWebSocket(bool enabled) | |
| 409 { | |
| 410 m_settings->setAllowConnectingInsecureWebSocket(enabled); | |
| 411 } | |
| 412 | |
| 413 void WebSettingsImpl::setPerTilePaintingEnabled(bool enabled) | 318 void WebSettingsImpl::setPerTilePaintingEnabled(bool enabled) |
| 414 { | 319 { |
| 415 m_perTilePaintingEnabled = enabled; | 320 m_perTilePaintingEnabled = enabled; |
| 416 } | 321 } |
| 417 | 322 |
| 418 void WebSettingsImpl::setShouldClearDocumentBackground(bool enabled) | 323 void WebSettingsImpl::setShouldClearDocumentBackground(bool enabled) |
| 419 { | 324 { |
| 420 m_settings->setShouldClearDocumentBackground(enabled); | 325 m_settings->setShouldClearDocumentBackground(enabled); |
| 421 } | 326 } |
| 422 | 327 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 void WebSettingsImpl::setViewportEnabled(bool enabled) | 392 void WebSettingsImpl::setViewportEnabled(bool enabled) |
| 488 { | 393 { |
| 489 m_settings->setViewportEnabled(enabled); | 394 m_settings->setViewportEnabled(enabled); |
| 490 } | 395 } |
| 491 | 396 |
| 492 void WebSettingsImpl::setViewportMetaEnabled(bool enabled) | 397 void WebSettingsImpl::setViewportMetaEnabled(bool enabled) |
| 493 { | 398 { |
| 494 m_settings->setViewportMetaEnabled(enabled); | 399 m_settings->setViewportMetaEnabled(enabled); |
| 495 } | 400 } |
| 496 | 401 |
| 497 void WebSettingsImpl::setNavigateOnDragDrop(bool enabled) | |
| 498 { | |
| 499 m_settings->setNavigateOnDragDrop(enabled); | |
| 500 } | |
| 501 | |
| 502 void WebSettingsImpl::setAllowCustomScrollbarInMainFrame(bool enabled) | |
| 503 { | |
| 504 m_settings->setAllowCustomScrollbarInMainFrame(enabled); | |
| 505 } | |
| 506 | |
| 507 void WebSettingsImpl::setSelectionIncludesAltImageText(bool enabled) | 402 void WebSettingsImpl::setSelectionIncludesAltImageText(bool enabled) |
| 508 { | 403 { |
| 509 m_settings->setSelectionIncludesAltImageText(enabled); | 404 m_settings->setSelectionIncludesAltImageText(enabled); |
| 510 } | 405 } |
| 511 | 406 |
| 512 void WebSettingsImpl::setSmartInsertDeleteEnabled(bool enabled) | 407 void WebSettingsImpl::setSmartInsertDeleteEnabled(bool enabled) |
| 513 { | 408 { |
| 514 m_settings->setSmartInsertDeleteEnabled(enabled); | 409 m_settings->setSmartInsertDeleteEnabled(enabled); |
| 515 } | 410 } |
| 516 | 411 |
| 517 void WebSettingsImpl::setUseSolidColorScrollbars(bool enabled) | 412 void WebSettingsImpl::setUseSolidColorScrollbars(bool enabled) |
| 518 { | 413 { |
| 519 m_settings->setUseSolidColorScrollbars(enabled); | 414 m_settings->setUseSolidColorScrollbars(enabled); |
| 520 } | 415 } |
| 521 | 416 |
| 522 void WebSettingsImpl::setMainFrameResizesAreOrientationChanges(bool enabled) | 417 void WebSettingsImpl::setMainFrameResizesAreOrientationChanges(bool enabled) |
| 523 { | 418 { |
| 524 m_mainFrameResizesAreOrientationChanges = enabled; | 419 m_mainFrameResizesAreOrientationChanges = enabled; |
| 525 } | 420 } |
| 526 | 421 |
| 527 void WebSettingsImpl::setV8CacheOptions(V8CacheOptions options) | 422 void WebSettingsImpl::setV8CacheOptions(V8CacheOptions options) |
| 528 { | 423 { |
| 529 m_settings->setV8CacheOptions(static_cast<blink::V8CacheOptions>(options)); | 424 m_settings->setV8CacheOptions(static_cast<blink::V8CacheOptions>(options)); |
| 530 } | 425 } |
| 531 | 426 |
| 532 } // namespace blink | 427 } // namespace blink |
| OLD | NEW |