webkit/src/main/java/androidx/webkit/SafeBrowsingResponseCompat.java
@NonNull
    /* package */ static SafeBrowsingResponseCompat fromInvocationHandler(
            @NonNull InvocationHandler handler) {
        final SafeBrowsingResponseBoundaryInterface responseDelegate =
                BoundaryInterfaceReflectionUtil.castToSuppLibClass(
                        SafeBrowsingResponseBoundaryInterface.class, handler);
        return new SafeBrowsingResponseCompat() {
            @Override
            public void showInterstitial(boolean allowReporting) {
                final WebViewFeatureInternal webViewFeature =
                        WebViewFeatureInternal.getFeature(
                                WebViewFeature.SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL);
                if (!webViewFeature.isSupportedByWebView()) {
                    throw WebViewFeatureInternal.getUnsupportedOperationException();
                }
                responseDelegate.showInterstitial(allowReporting);
            }

            @Override
            public void proceed(boolean report) {
                final WebViewFeatureInternal webViewFeature =
                        WebViewFeatureInternal.getFeature(
                                WebViewFeature.SAFE_BROWSING_RESPONSE_PROCEED);
                if (!webViewFeature.isSupportedByWebView()) {
                    throw WebViewFeatureInternal.getUnsupportedOperationException();
                }
                responseDelegate.proceed(report);
            }

            @Override
            public void backToSafety(boolean report) {
                final WebViewFeatureInternal webViewFeature =
                        WebViewFeatureInternal.getFeature(
                                WebViewFeature.SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY);
                if (!webViewFeature.isSupportedByWebView()) {
                    throw WebViewFeatureInternal.getUnsupportedOperationException();
                }
                responseDelegate.backToSafety(report);
            }
        };
    }
/**
     * Conversion helper to create a SafeBrowsingResponseCompat which delegates calls to {@param
     * handler}. The InvocationHandler must be created by {@link
     * BoundaryInterfaceReflectionUtil#createInvocationHandlerFor} using {@link
     * SafeBrowsingResponseBoundaryInterface}.
     *
     * @param handler The InvocationHandler that chromium passed in the callback.
     */
Conversion helper to create a SafeBrowsingResponseCompat which delegates calls to {@param
handler}.

@param handler The InvocationHandler that chromium passed in the callback.
Conversion helper to create a SafeBrowsingResponseCompat which delegates calls to { @param handler } . @param handler The InvocationHandler that chromium passed in the callback .
@NonNull
    /* package */ static SafeBrowsingResponseCompat fromInvocationHandler(
            @NonNull InvocationHandler handler) {
        final SafeBrowsingResponseBoundaryInterface responseDelegate =
                BoundaryInterfaceReflectionUtil.castToSuppLibClass(
                        SafeBrowsingResponseBoundaryInterface.class, handler);
        return new SafeBrowsingResponseCompat() {
            @Override
            public void showInterstitial(boolean allowReporting) {
                final WebViewFeatureInternal webViewFeature =
                        WebViewFeatureInternal.getFeature(
                                WebViewFeature.SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL);
                if (!webViewFeature.isSupportedByWebView()) {
                    throw WebViewFeatureInternal.getUnsupportedOperationException();
                }
                responseDelegate.showInterstitial(allowReporting);
            }
            @Override
            public void proceed(boolean report) {
                final WebViewFeatureInternal webViewFeature =
                        WebViewFeatureInternal.getFeature(
                                WebViewFeature.SAFE_BROWSING_RESPONSE_PROCEED);
                if (!webViewFeature.isSupportedByWebView()) {
                    throw WebViewFeatureInternal.getUnsupportedOperationException();
                }
                responseDelegate.proceed(report);
            }
            @Override
            public void backToSafety(boolean report) {
                final WebViewFeatureInternal webViewFeature =
                        WebViewFeatureInternal.getFeature(
                                WebViewFeature.SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY);
                if (!webViewFeature.isSupportedByWebView()) {
                    throw WebViewFeatureInternal.getUnsupportedOperationException();
                }
                responseDelegate.backToSafety(report);
            }
        };
    }
@ NonNull /* package */ static SafeBrowsingResponseCompat fromInvocationHandler ( @ NonNull InvocationHandler handler ) { final SafeBrowsingResponseBoundaryInterface responseDelegate = BoundaryInterfaceReflectionUtil . castToSuppLibClass ( SafeBrowsingResponseBoundaryInterface . class , handler ) ; return new SafeBrowsingResponseCompat ( ) { @ Override public void showInterstitial ( boolean allowReporting ) { final WebViewFeatureInternal webViewFeature = WebViewFeatureInternal . getFeature ( WebViewFeature . SAFE_BROWSING_RESPONSE_SHOW_INTERSTITIAL ) ; if ( ! webViewFeature . isSupportedByWebView ( ) ) { throw WebViewFeatureInternal . getUnsupportedOperationException ( ) ; } responseDelegate . showInterstitial ( allowReporting ) ; } @ Override public void proceed ( boolean report ) { final WebViewFeatureInternal webViewFeature = WebViewFeatureInternal . getFeature ( WebViewFeature . SAFE_BROWSING_RESPONSE_PROCEED ) ; if ( ! webViewFeature . isSupportedByWebView ( ) ) { throw WebViewFeatureInternal . getUnsupportedOperationException ( ) ; } responseDelegate . proceed ( report ) ; } @ Override public void backToSafety ( boolean report ) { final WebViewFeatureInternal webViewFeature = WebViewFeatureInternal . getFeature ( WebViewFeature . SAFE_BROWSING_RESPONSE_BACK_TO_SAFETY ) ; if ( ! webViewFeature . isSupportedByWebView ( ) ) { throw WebViewFeatureInternal . getUnsupportedOperationException ( ) ; } responseDelegate . backToSafety ( report ) ; } } ; }
Conversion helper to create a SafeBrowsingResponseCompat which delegates calls to {@param
 handler}.
Conversion helper to create a SafeBrowsingResponseCompat which delegates calls to { @param handler } .