Commit 2496c85c authored by Changwan Ryu's avatar Changwan Ryu Committed by Commit Bot

[WebView] Add display cutout controller for P+

Design doc: http://go/webview-display-cutout
(Google internal)

This is the core logic for display cutout support in WebView.

We cannot get the onApplyWindowInsets() for P, Q, R,
and sometimes view signals should update safe area insets, so
we are currently triggering window inset updates on certain
view callbacks.

https://crrev.com/c/chromium/src/+/2299461 is the next CL
that has more information on how this can be integrated into
AwContents.

Once the controller sets the insets and pass it to
WebContents#setDisplayCutoutSafeArea(insets), then the
webpages can use these values as safe-area-inset-*
CSS properties. Note that these CSS values will be
automatically updated when we set the values again, and set to
zero on navigation away from the current page.

Tested: AwDisplayCutoutControllerTest, also tested manually.
Bug: 1094366
Change-Id: I53461689ca065651d382ad2bb5c4cd1d09591df4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2298728Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Changwan Ryu <changwan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798948}
parent 9a20a5cc
...@@ -465,6 +465,7 @@ android_library("browser_java") { ...@@ -465,6 +465,7 @@ android_library("browser_java") {
"java/src/org/chromium/android_webview/AwDataDirLock.java", "java/src/org/chromium/android_webview/AwDataDirLock.java",
"java/src/org/chromium/android_webview/AwDebug.java", "java/src/org/chromium/android_webview/AwDebug.java",
"java/src/org/chromium/android_webview/AwDevToolsServer.java", "java/src/org/chromium/android_webview/AwDevToolsServer.java",
"java/src/org/chromium/android_webview/AwDisplayCutoutController.java",
"java/src/org/chromium/android_webview/AwFeatureList.java", "java/src/org/chromium/android_webview/AwFeatureList.java",
"java/src/org/chromium/android_webview/AwFormDatabase.java", "java/src/org/chromium/android_webview/AwFormDatabase.java",
"java/src/org/chromium/android_webview/AwGeolocationPermissions.java", "java/src/org/chromium/android_webview/AwGeolocationPermissions.java",
......
...@@ -498,6 +498,7 @@ generate_jni("android_webview_unittests_jni") { ...@@ -498,6 +498,7 @@ generate_jni("android_webview_unittests_jni") {
# robolectric tests # robolectric tests
junit_binary("android_webview_junit_tests") { junit_binary("android_webview_junit_tests") {
sources = [ sources = [
"../junit/src/org/chromium/android_webview/robolectric/AwDisplayCutoutControllerTest.java",
"../junit/src/org/chromium/android_webview/robolectric/AwLayoutSizerTest.java", "../junit/src/org/chromium/android_webview/robolectric/AwLayoutSizerTest.java",
"../junit/src/org/chromium/android_webview/robolectric/AwScrollOffsetManagerTest.java", "../junit/src/org/chromium/android_webview/robolectric/AwScrollOffsetManagerTest.java",
"../junit/src/org/chromium/android_webview/robolectric/FindAddressTest.java", "../junit/src/org/chromium/android_webview/robolectric/FindAddressTest.java",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment