History log of /frameworks/support/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f0c8e92936f54b7130669a0baaa42dfdd7dd7d45 14-Apr-2018 Nate Fischer <ntfschr@google.com> [WebView Support Library] Guard methods in callback-passed objects

This guards WebResourceErrorCompat and SafeBrowsingResponseCompat
methods with Feature flags.

Bug: 77967793
Test: N/A
Change-Id: I1f8e9fa816d83f3425d9cbdf38a0c1e41aca29f2
/frameworks/support/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java
d87f7a41115a7e5d6e99f19d11c5ec9452dcebe3 13-Apr-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "[WebView Support Library] Implement onSafeBrowsingHit" into pi-androidx-dev
17fc27f19b672a56f01c5f20773fb1047876646d 07-Apr-2018 Nate Fischer <ntfschr@google.com> [WebView Support Library] Implement onSafeBrowsingHit

This is the third CL in a series to implement WebViewClientCompat.

This implements WebViewClientCompat#onSafeBrowsingHit() and adds the
abstract class SafeBrowsingResponseCompat.

As in the previous CL, we define 3 signatures for onSafeBrowsingHit():

1. Inheriting the WebViewClient method with SafeBrowsingResponse
(called by legacy WebView APKs on 27+)
2. Implementing the boundary interface method with an InvocationHandler
(called by up-to-date WebView APKs)
3. A new signature which uses SafeBrowsingResponseCompat (which apps
may override)

Signatures 1 and 2 convert their parameter into a
SafeBrowsingResponseCompat and invoke signature 3. Signature 3 also
implements default behavior resembling the corresponding WebViewClient
method.

SafeBrowsingResponseCompat intentionally differs from
SafeBrowsingResponse in that it may not be instantiated by applications.
Applications have no reason to instantiate SafeBrowsingResponse(Compat),
and it was a mistake for SafeBrowsingResponse to have a public
constructor.

Also, this adds explicit NonNull annotations for the static #from*()
conversion methods (including those on WebResourceErrorCompat), since
these methods already assume NonNull parameters.

Design doc: http://go/wv-support-library-callbacks

Bug: 73151460
Test: Manual - build a test app with WebViewClientCompat
Change-Id: I52ae652077a180b20c8ae7ad3a307224d5e744e8
/frameworks/support/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java
27212250352c364eed75088412198c28245e40fc 10-Apr-2018 Gustav Sennton <gsennton@google.com> [WebView Support Library] Add WebResourceRequestCompat.

WebResourceRequest.isRedirect was added after Lollipop so with this CL
we provide support for the method
WebResourceRequestCompat.isRedirect(WebResourceRequest).

Bug: 74939930
Test: manually ensure calling WebResourceRequestCompat.isRedirect
doesn't crash.
Change-Id: Id68e83c090486c23c7bd84767a1810da08cd879b
/frameworks/support/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java
db584b38b76c4b5fc9c267764807289ebb7df7a7 11-Apr-2018 Nate Fischer <ntfschr@google.com> [WebView Support Library] Add WebViewClientCompat feature flags

This guards WebViewClientCompat callbacks with feature flags. The
WebViewClientCompat instance is responsible for declaring which features
it supports, and the chromium side will check these features before
invoking the callback.

Specifically, this declares that WebViewClient implements all of the
relevant features except SAFE_BROWSING_HIT (but this will be soon
implemented in http://ag/3858246).

This CL also copies documentation from the WebViewClient methods, and
appends a paragraph about which Feature is associated with each
callback.

The corresponding chromium change is in http://crrev/c/1006051.

Bug: 73151460
Test: Manual
Change-Id: Icb5858a8dba77467e65b3d69b6e4b3fcae61d762
/frameworks/support/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java
6d58dc81185fcd04ec5e5c836263caae1f4a65ab 06-Apr-2018 Gustav Sennton <gsennton@google.com> [webkit] add feature flag for ServiceWorkerClien..shouldInterceptRequest

Allow developers to check whether
ServiceWorkerClientCompat.shouldInterceptRequest is supported through
the use of a feature flag.

Corresponding Chromium change:
https://chromium-review.googlesource.com/c/chromium/src/+/998164

Bug: 73151166
Test: Ensure ServiceWorkerClientCompat test fails when the
SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST flag is missing on the support
support library side.

Change-Id: I3f8e27f6462a7bab90a48bf8c5d9cf8d5814dc9b
/frameworks/support/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java
826eeefd318cd30068ec731619ade6f5da7e7c4d 03-Apr-2018 Gustav Sennton <gsennton@google.com> [WebView Support Library] guard existing APIs with feature flags.

This CL adds feature flags for a bunch of WebView Support Library APIs
(related to ServiceWorkers, SafeBrowsing, and WebSettings) and ensures
that those APIs are guarded by the corresponding feature flags.
These feature flags are used to determine which APIs the current WebView
APK implements.

Bug: 73454029
Bug: 73151166
Bug: 73151403
Test: manually, ensuring features declared in the WebView APK are
marked as supported in the support library, and features not declared in
the WebView APK are marked as unsupported.
Change-Id: I6928769648ce68c73aadcaf0563426abdebb0992
/frameworks/support/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java
055157a7821fe8a24e14e619b1036bb2d6d4e2a8 23-Mar-2018 Gustav Sennton <gsennton@google.com> [WebView Support Library] Support incompatible WebView APKs.

Most functionality in the WebView Support Library requires an up-to-date
WebView APK.
We need a way of dealing with WebView APKs that are not up-to-date.
In this CL we ensure that if the current WebView APK is not up-to-date
(i.e. the support library cannot bypass the framework to call into the
WebView APK) the support library declares that the APK supports no
features at all.

Bug: 76202025
Test: run androidx.webkit
Change-Id: I30ecf2459fc793c10f1817a431b18804344e2b8e
/frameworks/support/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java
9c84d01adb0d1dcd63490a134004db139855477b 28-Feb-2018 Gustav Sennton <gsennton@google.com> [WebView Support Library] Add feature detection support.

We will use feature detection in the WebView Support Library to ensure
different versions of the support library are compatible with different
versions of the WebView APK, and to ensure we're forwards compatible (so
if we ever remove a feature we can simply mark that as removed in our
feature detection mechanism).

Bug: 38302180
Test: run androidx.webkit tests.
Change-Id: I8381845078a72872ab187ed66d5ab7c2ddcd2f91
/frameworks/support/webkit/src/main/java/androidx/webkit/internal/WebViewFeatureInternal.java