public abstract class

SafeBrowsingResponseCompat

extends java.lang.Object

 java.lang.Object

↳androidx.webkit.SafeBrowsingResponseCompat

Subclasses:

SafeBrowsingResponseImpl

Gradle dependencies

compile group: 'androidx.webkit', name: 'webkit', version: '1.12.0-rc01'

  • groupId: androidx.webkit
  • artifactId: webkit
  • version: 1.12.0-rc01

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

Androidx artifact mapping:

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

Overview

Compatibility version of .

Summary

Constructors
publicSafeBrowsingResponseCompat()

This class cannot be created by applications.

Methods
public abstract voidbackToSafety(boolean report)

Act as if the user clicked the "back to safety" button.

public abstract voidproceed(boolean report)

Act as if the user clicked the "visit this unsafe site" button.

public abstract voidshowInterstitial(boolean allowReporting)

Display the default interstitial.

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

Constructors

public SafeBrowsingResponseCompat()

This class cannot be created by applications.

Methods

public abstract void showInterstitial(boolean allowReporting)

Display the default interstitial.

This method should only be called if WebViewFeature.isFeatureSupported(String) returns true for WebViewFeature.SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL.

Parameters:

allowReporting: true if the interstitial should show a reporting checkbox.

public abstract void proceed(boolean report)

Act as if the user clicked the "visit this unsafe site" button.

This method should only be called if WebViewFeature.isFeatureSupported(String) returns true for WebViewFeature.SAFE_BROWSING_RESPONSE_PROCEED.

Parameters:

report: true to enable Safe Browsing reporting.

public abstract void backToSafety(boolean report)

Act as if the user clicked the "back to safety" button.

This method should only be called if WebViewFeature.isFeatureSupported(String) returns true for WebViewFeature.SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY.

Parameters:

report: true to enable Safe Browsing reporting.

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;

import android.webkit.SafeBrowsingResponse;

import androidx.annotation.RequiresFeature;
import androidx.annotation.RestrictTo;

/**
 * Compatibility version of {@link SafeBrowsingResponse}.
 */
public abstract class SafeBrowsingResponseCompat {
    /**
     * Display the default interstitial.
     *
     * <p>
     * This method should only be called if
     * {@link WebViewFeature#isFeatureSupported(String)}
     * returns true for {@link WebViewFeature#SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL}.
     *
     * @param allowReporting {@code true} if the interstitial should show a reporting checkbox.
     */
    @RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL,
            enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
    public abstract void showInterstitial(boolean allowReporting);

    /**
     * Act as if the user clicked the "visit this unsafe site" button.
     *
     * <p>
     * This method should only be called if
     * {@link WebViewFeature#isFeatureSupported(String)}
     * returns true for {@link WebViewFeature#SAFE_BROWSING_RESPONSE_PROCEED}.
     *
     * @param report {@code true} to enable Safe Browsing reporting.
     */
    @RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_PROCEED,
            enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
    public abstract void proceed(boolean report);

    /**
     * Act as if the user clicked the "back to safety" button.
     *
     * <p>
     * This method should only be called if
     * {@link WebViewFeature#isFeatureSupported(String)}
     * returns true for {@link WebViewFeature#SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY}.
     *
     * @param report {@code true} to enable Safe Browsing reporting.
     */
    @RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY,
            enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
    public abstract void backToSafety(boolean report);

    /**
     * This class cannot be created by applications.
     */
    @RestrictTo(RestrictTo.Scope.LIBRARY)
    public SafeBrowsingResponseCompat() {
    }
}