SafeBrowsingResponseCompat


abstract class SafeBrowsingResponseCompat


Compatibility version of SafeBrowsingResponse.

Summary

Public functions

abstract Unit
@RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
backToSafety(report: Boolean)

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

abstract Unit
@RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_PROCEED, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
proceed(report: Boolean)

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

abstract Unit
@RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
showInterstitial(allowReporting: Boolean)

Display the default interstitial.

Public functions

backToSafety

Added in 1.1.0
@RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
abstract fun backToSafety(report: Boolean): Unit

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

Parameters
report: Boolean

true to enable Safe Browsing reporting.

Throws
java.lang.UnsupportedOperationException

if the SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY feature is not supported. This should be checked before use with isFeatureSupported.

proceed

Added in 1.1.0
@RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_PROCEED, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
abstract fun proceed(report: Boolean): Unit

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

Parameters
report: Boolean

true to enable Safe Browsing reporting.

Throws
java.lang.UnsupportedOperationException

if the SAFE_BROWSING_RESPONSE_PROCEED feature is not supported. This should be checked before use with isFeatureSupported.

showInterstitial

Added in 1.1.0
@RequiresFeature(name = WebViewFeature.SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
abstract fun showInterstitial(allowReporting: Boolean): Unit

Display the default interstitial.

Parameters
allowReporting: Boolean

true if the interstitial should show a reporting checkbox.

Throws
java.lang.UnsupportedOperationException

if the SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL feature is not supported. This should be checked before use with isFeatureSupported.