• Changwan Ryu's avatar
    [WebView] Add display cutout controller for P+ · 2496c85c
    Changwan Ryu authored
    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}
    2496c85c
BUILD.gn 39.7 KB