Unverified Commit 36c3c0eb authored by Alex Catarineu's avatar Alex Catarineu Committed by Matthew Finkel
Browse files

Bug 40019: Expose spoofEnglish pref

parent 3e027f29
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -607,6 +607,14 @@ class GeckoEngine(
                    runtime.settings.torSecurityLevel = it
                }
            }
        override var spoofEnglish: Boolean
            get() = runtime.settings.spoofEnglish
            set(value) {
                value.let {
                    runtime.settings.spoofEnglish = it
                    localeUpdater.updateValue()
                }
            }
    }.apply {
        defaultSettings?.let {
            this.javascriptEnabled = it.javascriptEnabled
@@ -625,6 +633,7 @@ class GeckoEngine(
            this.clearColor = it.clearColor
            this.loginAutofillEnabled = it.loginAutofillEnabled
            this.torSecurityLevel = it.torSecurityLevel
            this.spoofEnglish = it.spoofEnglish
        }
    }

+9 −0
Original line number Diff line number Diff line
@@ -607,6 +607,14 @@ class GeckoEngine(
                    runtime.settings.torSecurityLevel = it
                }
            }
        override var spoofEnglish: Boolean
            get() = runtime.settings.spoofEnglish
            set(value) {
                value.let {
                    runtime.settings.spoofEnglish = it
                    localeUpdater.updateValue()
                }
            }
    }.apply {
        defaultSettings?.let {
            this.javascriptEnabled = it.javascriptEnabled
@@ -625,6 +633,7 @@ class GeckoEngine(
            this.clearColor = it.clearColor
            this.loginAutofillEnabled = it.loginAutofillEnabled
            this.torSecurityLevel = it.torSecurityLevel
            this.spoofEnglish = it.spoofEnglish
        }
    }

+4 −1
Original line number Diff line number Diff line
@@ -184,6 +184,8 @@ abstract class Settings {
     * Setting to control the current security level
     */
    open var torSecurityLevel: Int by UnsupportedSetting()

    open var spoofEnglish: Boolean by UnsupportedSetting()
}

/**
@@ -220,7 +222,8 @@ data class DefaultSettings(
    override var forceUserScalableContent: Boolean = false,
    override var loginAutofillEnabled: Boolean = false,
    override var clearColor: Int? = null,
    override var torSecurityLevel: Int = 4
    override var torSecurityLevel: Int = 4,
    override var spoofEnglish: Boolean = false
) : Settings()

class UnsupportedSetting<T> {