Commit 1680452c authored by Simon Chae's avatar Simon Chae
Browse files

Issue #3666: Add useWideViewPort setting and SystemEngineSession

parent 6b585972
......@@ -319,6 +319,7 @@ class SystemEngineSession(
webFontsEnabled = it.webFontsEnabled
displayZoomControls = it.displayZoomControls
loadWithOverviewMode = it.loadWithOverviewMode
useWideViewPort = it.useWideViewPort
trackingProtectionPolicy = it.trackingProtectionPolicy
historyTrackingDelegate = it.historyTrackingDelegate
requestInterceptor = it.requestInterceptor
......
......@@ -306,6 +306,10 @@ class SystemEngineSessionTest {
engineSession.settings.loadWithOverviewMode = true
verify(webViewSettings).loadWithOverviewMode = true
assertFalse(engineSession.settings.useWideViewPort)
engineSession.settings.useWideViewPort = true
verify(webViewSettings).useWideViewPort = true
assertTrue(engineSession.settings.allowContentAccess)
engineSession.settings.allowContentAccess = false
verify(webViewSettings).allowContentAccess = false
......
......@@ -83,6 +83,13 @@ abstract class Settings {
*/
open var loadWithOverviewMode: Boolean by UnsupportedSetting()
/**
* Setting to control whether to support the viewport HTML meta tag or if a wide viewport
* should be used. If not null, this value overrides useWideViePort webSettings in
* [EngineSession.toggleDesktopMode].
*/
open var useWideViewPort: Boolean by UnsupportedSetting()
/**
* Setting to control whether or not file access is allowed.
*/
......@@ -175,6 +182,7 @@ data class DefaultSettings(
override var javaScriptCanOpenWindowsAutomatically: Boolean = false,
override var displayZoomControls: Boolean = true,
override var loadWithOverviewMode: Boolean = false,
override var useWideViewPort: Boolean = false,
override var allowFileAccess: Boolean = true,
override var allowFileAccessFromFileURLs: Boolean = false,
override var allowUniversalAccessFromFileURLs: Boolean = false,
......
......@@ -49,6 +49,8 @@ class SettingsTest {
{ settings.displayZoomControls = false },
{ settings.loadWithOverviewMode },
{ settings.loadWithOverviewMode = false },
{ settings.useWideViewPort },
{ settings.useWideViewPort = false },
{ settings.allowFileAccess },
{ settings.allowFileAccess = false },
{ settings.allowContentAccess },
......@@ -101,6 +103,7 @@ class SettingsTest {
assertTrue(settings.automaticFontSizeAdjustment)
assertTrue(settings.automaticLanguageAdjustment)
assertFalse(settings.loadWithOverviewMode)
assertFalse(settings.useWideViewPort)
assertTrue(settings.allowContentAccess)
assertTrue(settings.allowFileAccess)
assertFalse(settings.allowFileAccessFromFileURLs)
......@@ -133,6 +136,7 @@ class SettingsTest {
javaScriptCanOpenWindowsAutomatically = true,
displayZoomControls = false,
loadWithOverviewMode = true,
useWideViewPort = true,
allowContentAccess = false,
allowFileAccess = false,
allowFileAccessFromFileURLs = true,
......@@ -161,6 +165,7 @@ class SettingsTest {
assertTrue(defaultSettings.javaScriptCanOpenWindowsAutomatically)
assertFalse(defaultSettings.displayZoomControls)
assertTrue(defaultSettings.loadWithOverviewMode)
assertTrue(defaultSettings.useWideViewPort)
assertFalse(defaultSettings.allowContentAccess)
assertFalse(defaultSettings.allowFileAccess)
assertTrue(defaultSettings.allowFileAccessFromFileURLs)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment