public class

WebSettingsAdapter

extends java.lang.Object

 java.lang.Object

↳androidx.webkit.internal.WebSettingsAdapter

Gradle dependencies

compile group: 'androidx.webkit', name: 'webkit', version: '1.5.0-alpha01'

  • groupId: androidx.webkit
  • artifactId: webkit
  • version: 1.5.0-alpha01

Artifact androidx.webkit:webkit:1.5.0-alpha01 it located at Google repository (https://maven.google.com/)

Androidx artifact mapping:

androidx.webkit:webkit com.android.support:webkit

Overview

Adapter between WebSettingsCompat and org.chromium.support_lib_boundary.WebSettingsBoundaryInterface (the corresponding interface shared with the support library glue in the WebView APK).

Summary

Constructors
publicWebSettingsAdapter(org.chromium.support_lib_boundary.WebSettingsBoundaryInterface boundaryInterface)

Methods
public intgetDisabledActionModeMenuItems()

Adapter method for WebSettingsCompat.getDisabledActionModeMenuItems(WebSettings).

public intgetForceDark()

Adapter method for WebSettingsCompat.getForceDark(WebSettings).

public intgetForceDarkStrategy()

Adapter method for WebSettingsCompat.getForceDarkStrategy(WebSettings).

public booleangetOffscreenPreRaster()

Adapter method for WebSettingsCompat.getOffscreenPreRaster(WebSettings).

public intgetRequestedWithHeaderMode()

Adapter method for WebSettingsCompat

public booleangetSafeBrowsingEnabled()

Adapter method for WebSettingsCompat.getSafeBrowsingEnabled(WebSettings).

public booleanisAlgorithmicDarkeningAllowed()

Adapter method for WebSettingsCompat.isAlgorithmicDarkeningAllowed(WebSettings).

public voidsetAlgorithmicDarkeningAllowed(boolean allow)

Adapter method for WebSettingsCompat.setAlgorithmicDarkeningAllowed(WebSettings, boolean).

public voidsetDisabledActionModeMenuItems(int menuItems)

Adapter method for WebSettingsCompat.setDisabledActionModeMenuItems(WebSettings, int).

public voidsetForceDark(int forceDarkMode)

Adapter method for WebSettingsCompat.setForceDark(WebSettings, int).

public voidsetForceDarkStrategy(int forceDarkStrategy)

Adapter method for WebSettingsCompat.setForceDarkStrategy(WebSettings, int).

public voidsetOffscreenPreRaster(boolean enabled)

Adapter method for WebSettingsCompat.setOffscreenPreRaster(WebSettings, boolean).

public voidsetRequestedWithHeaderMode(int requestedWithHeaderMode)

Adapter method for WebSettingsCompat

public voidsetSafeBrowsingEnabled(boolean enabled)

Adapter method for WebSettingsCompat.setSafeBrowsingEnabled(WebSettings, boolean).

public voidsetWillSuppressErrorPage(boolean suppressed)

Adapter method for WebSettingsCompat.setWillSuppressErrorPage(WebSettings, boolean).

public booleanwillSuppressErrorPage()

Adapter method for WebSettingsCompat.willSuppressErrorPage(WebSettings).

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public WebSettingsAdapter(org.chromium.support_lib_boundary.WebSettingsBoundaryInterface boundaryInterface)

Methods

public void setOffscreenPreRaster(boolean enabled)

Adapter method for WebSettingsCompat.setOffscreenPreRaster(WebSettings, boolean).

public boolean getOffscreenPreRaster()

Adapter method for WebSettingsCompat.getOffscreenPreRaster(WebSettings).

public void setSafeBrowsingEnabled(boolean enabled)

Adapter method for WebSettingsCompat.setSafeBrowsingEnabled(WebSettings, boolean).

public boolean getSafeBrowsingEnabled()

Adapter method for WebSettingsCompat.getSafeBrowsingEnabled(WebSettings).

public void setDisabledActionModeMenuItems(int menuItems)

Adapter method for WebSettingsCompat.setDisabledActionModeMenuItems(WebSettings, int).

public int getDisabledActionModeMenuItems()

Adapter method for WebSettingsCompat.getDisabledActionModeMenuItems(WebSettings).

public void setWillSuppressErrorPage(boolean suppressed)

Adapter method for WebSettingsCompat.setWillSuppressErrorPage(WebSettings, boolean).

public boolean willSuppressErrorPage()

Adapter method for WebSettingsCompat.willSuppressErrorPage(WebSettings).

public void setForceDark(int forceDarkMode)

Adapter method for WebSettingsCompat.setForceDark(WebSettings, int).

public int getForceDark()

Adapter method for WebSettingsCompat.getForceDark(WebSettings).

public void setForceDarkStrategy(int forceDarkStrategy)

Adapter method for WebSettingsCompat.setForceDarkStrategy(WebSettings, int).

public int getForceDarkStrategy()

Adapter method for WebSettingsCompat.getForceDarkStrategy(WebSettings).

public void setAlgorithmicDarkeningAllowed(boolean allow)

Adapter method for WebSettingsCompat.setAlgorithmicDarkeningAllowed(WebSettings, boolean).

public boolean isAlgorithmicDarkeningAllowed()

Adapter method for WebSettingsCompat.isAlgorithmicDarkeningAllowed(WebSettings).

public void setRequestedWithHeaderMode(int requestedWithHeaderMode)

Adapter method for WebSettingsCompat

public int getRequestedWithHeaderMode()

Adapter method for WebSettingsCompat

Source

/*
 * Copyright 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.webkit.internal;

import androidx.annotation.NonNull;

import org.chromium.support_lib_boundary.WebSettingsBoundaryInterface;

/**
 * Adapter between WebSettingsCompat and
 * {@link org.chromium.support_lib_boundary.WebSettingsBoundaryInterface} (the
 * corresponding interface shared with the support library glue in the WebView APK).
 */
public class WebSettingsAdapter {
    private final WebSettingsBoundaryInterface mBoundaryInterface;

    public WebSettingsAdapter(@NonNull WebSettingsBoundaryInterface boundaryInterface) {
        mBoundaryInterface = boundaryInterface;
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#setOffscreenPreRaster}.
     */
    public void setOffscreenPreRaster(boolean enabled) {
        mBoundaryInterface.setOffscreenPreRaster(enabled);
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#getOffscreenPreRaster}.
     */
    public boolean getOffscreenPreRaster() {
        return mBoundaryInterface.getOffscreenPreRaster();
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#setSafeBrowsingEnabled}.
     */
    public void setSafeBrowsingEnabled(boolean enabled) {
        mBoundaryInterface.setSafeBrowsingEnabled(enabled);
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#getSafeBrowsingEnabled}.
     */
    public boolean getSafeBrowsingEnabled() {
        return mBoundaryInterface.getSafeBrowsingEnabled();
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#setDisabledActionModeMenuItems}.
     */
    public void setDisabledActionModeMenuItems(int menuItems) {
        mBoundaryInterface.setDisabledActionModeMenuItems(menuItems);
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#getDisabledActionModeMenuItems}.
     */
    public int getDisabledActionModeMenuItems() {
        return mBoundaryInterface.getDisabledActionModeMenuItems();
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#setWillSuppressErrorPage}.
     */
    public void setWillSuppressErrorPage(boolean suppressed) {
        mBoundaryInterface.setWillSuppressErrorPage(suppressed);
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#willSuppressErrorPage}.
     */
    public boolean willSuppressErrorPage() {
        return mBoundaryInterface.getWillSuppressErrorPage();
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#setForceDark}.
     */
    public void setForceDark(int forceDarkMode) {
        mBoundaryInterface.setForceDark(forceDarkMode);
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#getForceDark}.
     */
    public int getForceDark() {
        return mBoundaryInterface.getForceDark();
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#setForceDarkStrategy}.
     */
    public void setForceDarkStrategy(int forceDarkStrategy) {
        mBoundaryInterface.setForceDarkBehavior(forceDarkStrategy);
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#getForceDarkStrategy}.
     */
    public int getForceDarkStrategy() {
        return mBoundaryInterface.getForceDarkBehavior();
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#setAlgorithmicDarkeningAllowed}.
     */
    public void setAlgorithmicDarkeningAllowed(boolean allow) {
        mBoundaryInterface.setAlgorithmicDarkeningAllowed(allow);
    }

    /**
     * Adapter method for {@link androidx.webkit.WebSettingsCompat#isAlgorithmicDarkeningAllowed}.
     */
    public boolean isAlgorithmicDarkeningAllowed() {
        return mBoundaryInterface.isAlgorithmicDarkeningAllowed();
    }

    /**
     * Adapter method for
     * {@link androidx.webkit.WebSettingsCompat#setRequestedWithHeaderMode(android.webkit.WebSettings, int)}
     */
    public void setRequestedWithHeaderMode(int requestedWithHeaderMode) {
        mBoundaryInterface.setRequestedWithHeaderMode(requestedWithHeaderMode);
    }

    /**
     * Adapter method for
     * {@link androidx.webkit.WebSettingsCompat#getRequestedWithHeaderMode(android.webkit.WebSettings)}
     */
    public int getRequestedWithHeaderMode() {
        return mBoundaryInterface.getRequestedWithHeaderMode();
    }
}