SafeBrowsingResponseCompat

public abstract class SafeBrowsingResponseCompat


Compatibility version of SafeBrowsingResponse.

Summary

Public methods

abstract void
@RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
backToSafety(boolean report)

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

abstract void
@RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_PROCEED, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
proceed(boolean report)

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

abstract void
@RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
showInterstitial(boolean allowReporting)

Display the default interstitial.

Public methods

backToSafety

Added in 1.1.0
@RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
public abstract void backToSafety(boolean report)

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

This method should only be called if isFeatureSupported returns true for SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY.

Parameters
boolean report

true to enable Safe Browsing reporting.

proceed

Added in 1.1.0
@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 "visit this unsafe site" button.

This method should only be called if isFeatureSupported returns true for SAFE_BROWSING_RESPONSE_PROCEED.

Parameters
boolean report

true to enable Safe Browsing reporting.

showInterstitial

Added in 1.1.0
@RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
public abstract void showInterstitial(boolean allowReporting)

Display the default interstitial.

This method should only be called if isFeatureSupported returns true for SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL.

Parameters
boolean allowReporting

true if the interstitial should show a reporting checkbox.