diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-07 13:45:17 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-07 13:45:17 +0000 |
commit | 6c238a7b6c139c34c629d09e7f97a0ea4a17ed1e (patch) | |
tree | 1198b623fb128d023496a22e58b2c9fdeafada2c | |
parent | ddce2571b16bab7fcba7b31245efba7e929790d1 (diff) | |
parent | 73d6b553a37646c60c41d4d125b5c7058bd58207 (diff) | |
download | webview_support_interfaces-androidx-draganddrop-release.tar.gz |
Snap for 8404407 from 73d6b553a37646c60c41d4d125b5c7058bd58207 to androidx-draganddrop-releaseandroidx-draganddrop-release
Change-Id: Ib9e845481e488b8336bf7f1be1f5b23e3f4b485e
9 files changed, 73 insertions, 18 deletions
@@ -13,13 +13,13 @@ android_library("boundary_interface_java") { "src/org/chromium/support_lib_boundary/ProxyControllerBoundaryInterface.java", "src/org/chromium/support_lib_boundary/SafeBrowsingResponseBoundaryInterface.java", "src/org/chromium/support_lib_boundary/ScriptHandlerBoundaryInterface.java", - "src/org/chromium/support_lib_boundary/ScriptReferenceBoundaryInterface.java", "src/org/chromium/support_lib_boundary/ServiceWorkerClientBoundaryInterface.java", "src/org/chromium/support_lib_boundary/ServiceWorkerControllerBoundaryInterface.java", "src/org/chromium/support_lib_boundary/ServiceWorkerWebSettingsBoundaryInterface.java", "src/org/chromium/support_lib_boundary/StaticsBoundaryInterface.java", "src/org/chromium/support_lib_boundary/TracingControllerBoundaryInterface.java", "src/org/chromium/support_lib_boundary/VisualStateCallbackBoundaryInterface.java", + "src/org/chromium/support_lib_boundary/WebAuthnCallbackBoundaryInterface.java", "src/org/chromium/support_lib_boundary/WebMessageBoundaryInterface.java", "src/org/chromium/support_lib_boundary/WebMessageCallbackBoundaryInterface.java", "src/org/chromium/support_lib_boundary/WebMessageListenerBoundaryInterface.java", diff --git a/src/org/chromium/support_lib_boundary/ScriptHandlerBoundaryInterface.java b/src/org/chromium/support_lib_boundary/ScriptHandlerBoundaryInterface.java index 4dcaa75..0be98f8 100644 --- a/src/org/chromium/support_lib_boundary/ScriptHandlerBoundaryInterface.java +++ b/src/org/chromium/support_lib_boundary/ScriptHandlerBoundaryInterface.java @@ -7,4 +7,6 @@ package org.chromium.support_lib_boundary; /** * Boundary interface for AwContents.addDocumentStartJavascript(). */ -public interface ScriptHandlerBoundaryInterface extends ScriptReferenceBoundaryInterface {} +public interface ScriptHandlerBoundaryInterface { + void remove(); +} diff --git a/src/org/chromium/support_lib_boundary/ScriptReferenceBoundaryInterface.java b/src/org/chromium/support_lib_boundary/ScriptReferenceBoundaryInterface.java deleted file mode 100644 index aba822a..0000000 --- a/src/org/chromium/support_lib_boundary/ScriptReferenceBoundaryInterface.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.support_lib_boundary; - -/** - * Boundary interface for AwContents.addDocumentStartJavascript(). - * - * TODO(ctzsm): Delete this interface once we've updated the APKs on - * the AndroidX bots and move the remove method to ScriptHandlerBoundaryInterface. - */ -public interface ScriptReferenceBoundaryInterface { - void remove(); -} diff --git a/src/org/chromium/support_lib_boundary/ServiceWorkerWebSettingsBoundaryInterface.java b/src/org/chromium/support_lib_boundary/ServiceWorkerWebSettingsBoundaryInterface.java index dfd61fa..c7f60ab 100644 --- a/src/org/chromium/support_lib_boundary/ServiceWorkerWebSettingsBoundaryInterface.java +++ b/src/org/chromium/support_lib_boundary/ServiceWorkerWebSettingsBoundaryInterface.java @@ -4,6 +4,8 @@ package org.chromium.support_lib_boundary; +import org.chromium.support_lib_boundary.WebSettingsBoundaryInterface.RequestedWithHeaderMode; + /** * Boundary interface for ServiceWorkerWebSettings. */ @@ -23,4 +25,8 @@ public interface ServiceWorkerWebSettingsBoundaryInterface { void setBlockNetworkLoads(boolean flag); boolean getBlockNetworkLoads(); + + void setRequestedWithHeaderMode(@RequestedWithHeaderMode int mode); + @RequestedWithHeaderMode + int getRequestedWithHeaderMode(); } diff --git a/src/org/chromium/support_lib_boundary/StaticsBoundaryInterface.java b/src/org/chromium/support_lib_boundary/StaticsBoundaryInterface.java index c2d3864..e13b77a 100644 --- a/src/org/chromium/support_lib_boundary/StaticsBoundaryInterface.java +++ b/src/org/chromium/support_lib_boundary/StaticsBoundaryInterface.java @@ -20,4 +20,5 @@ public interface StaticsBoundaryInterface { void setSafeBrowsingWhitelist(List<String> hosts, ValueCallback<Boolean> callback); Uri getSafeBrowsingPrivacyPolicyUrl(); boolean isMultiProcessEnabled(); + String getVariationsHeader(); } diff --git a/src/org/chromium/support_lib_boundary/WebAuthnCallbackBoundaryInterface.java b/src/org/chromium/support_lib_boundary/WebAuthnCallbackBoundaryInterface.java new file mode 100644 index 0000000..8b6efc1 --- /dev/null +++ b/src/org/chromium/support_lib_boundary/WebAuthnCallbackBoundaryInterface.java @@ -0,0 +1,18 @@ +// Copyright 2021 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.support_lib_boundary; + +import android.content.Intent; + +/** + * Boundary interface for the response to a WebAuthn intent. + * <p> + * An instance of this object is given to the embedder in <code>onWebAuthnIntent</code>. + * Once the result of the intent is known the method in this interface is called so that the + * embedder can pass the result back into Chromium. + */ +public interface WebAuthnCallbackBoundaryInterface { + void onResult(int resultCode, Intent intent); +} diff --git a/src/org/chromium/support_lib_boundary/WebSettingsBoundaryInterface.java b/src/org/chromium/support_lib_boundary/WebSettingsBoundaryInterface.java index 426eb6d..dd3f383 100644 --- a/src/org/chromium/support_lib_boundary/WebSettingsBoundaryInterface.java +++ b/src/org/chromium/support_lib_boundary/WebSettingsBoundaryInterface.java @@ -31,6 +31,9 @@ public interface WebSettingsBoundaryInterface { void setForceDark(int forceDarkMode); int getForceDark(); + void setAlgorithmicDarkeningAllowed(boolean allow); + boolean isAlgorithmicDarkeningAllowed(); + @Retention(RetentionPolicy.SOURCE) @interface ForceDarkBehavior { int FORCE_DARK_ONLY = 0; @@ -41,4 +44,24 @@ public interface WebSettingsBoundaryInterface { void setForceDarkBehavior(@ForceDarkBehavior int forceDarkBehavior); @ForceDarkBehavior int getForceDarkBehavior(); + + @Retention(RetentionPolicy.SOURCE) + @interface WebAuthnSupport { + int NONE = 0; + int APP = 1; + int BROWSER = 2; + } + + void setWebAuthnSupport(@WebAuthnSupport int support); + @WebAuthnSupport + int getWebAuthnSupport(); + + @Retention(RetentionPolicy.SOURCE) + @interface RequestedWithHeaderMode { + int NO_HEADER = 0; + int APP_PACKAGE_NAME = 1; + } + void setRequestedWithHeaderMode(@RequestedWithHeaderMode int mode); + @RequestedWithHeaderMode + int getRequestedWithHeaderMode(); } diff --git a/src/org/chromium/support_lib_boundary/WebViewClientBoundaryInterface.java b/src/org/chromium/support_lib_boundary/WebViewClientBoundaryInterface.java index 9cdde0d..fc60168 100644 --- a/src/org/chromium/support_lib_boundary/WebViewClientBoundaryInterface.java +++ b/src/org/chromium/support_lib_boundary/WebViewClientBoundaryInterface.java @@ -4,6 +4,7 @@ package org.chromium.support_lib_boundary; +import android.app.PendingIntent; import android.webkit.WebResourceRequest; import android.webkit.WebResourceResponse; import android.webkit.WebView; @@ -22,4 +23,6 @@ public interface WebViewClientBoundaryInterface extends FeatureFlagHolderBoundar void onSafeBrowsingHit(WebView view, WebResourceRequest request, int threatType, /* SafeBrowsingResponse */ InvocationHandler callback); boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request); + boolean onWebAuthnIntent(WebView view, PendingIntent intent, + /* WebAuthnCallbackBoundaryInterface */ InvocationHandler callback); } diff --git a/src/org/chromium/support_lib_boundary/util/Features.java b/src/org/chromium/support_lib_boundary/util/Features.java index 3038a4f..1415361 100644 --- a/src/org/chromium/support_lib_boundary/util/Features.java +++ b/src/org/chromium/support_lib_boundary/util/Features.java @@ -176,6 +176,10 @@ public class Features { // WebSettingsCompat.getForceDarkBehavior public static final String FORCE_DARK_BEHAVIOR = "FORCE_DARK_BEHAVIOR"; + // WebSettingsCompat.setAlgorithmicDarkeningAllowed + // WebSettingsCompat.isAlgorithmicDarkeningAllowed + public static final String ALGORITHMIC_DARKENING = "ALGORITHMIC_DARKENING"; + // WebViewCompat.addWebMessageListener // WebViewCompat.removeWebMessageListener public static final String WEB_MESSAGE_LISTENER = "WEB_MESSAGE_LISTENER"; @@ -184,5 +188,18 @@ public class Features { public static final String SET_SUPPORT_LIBRARY_VERSION = "SET_SUPPORT_LIBRARY_VERSION"; // WebViewCompat.addDocumentStartJavascript - public static final String DOCUMENT_START_SCRIPT = "DOCUMENT_START_SCRIPT"; + public static final String DOCUMENT_START_SCRIPT = "DOCUMENT_START_SCRIPT:1"; + + // WebSettingsCompat.setWebAuthnSupport + // WebSettingsCompat.getWebAuthnSupport + public static final String WEB_AUTHENTICATION = "WEB_AUTHENTICATION"; + + // WebSettingsCompat.setRequestedWithHeaderMode + // WebSettingsCompat.getRequestedWithHeaderMode + // ServiceWorkerWebSettingsCompat.setRequestedWithHeaderMode + // ServiceWorkerWebSettingsCompat.getRequestedWithHeaderMode + public static final String REQUESTED_WITH_HEADER_CONTROL = "REQUESTED_WITH_HEADER_CONTROL"; + + // WebViewCompat.getVariationsHeader + public static final String GET_VARIATIONS_HEADER = "GET_VARIATIONS_HEADER"; } |