0

Move DisplayCutoutController tracking to AwViewMethodsImpl.

This change calls DisplayCutoutController#onAttachedToWindow when either
the WebView is attached to the window, or the FullScreenView is attached
to the window (whichever the AwContents is displaying to).

This is a change in behaviour, but should be more correct. There likely
wasn't an issue beforehand because when switching to full screen,
DisplayCutoutController#setCurrentContainerView was called, which also
requested full screen insets.

Bug: 380261043
Change-Id: I23a607b6450bb53cd37644e5a62ab708c97dfe90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6513140
Reviewed-by: Peter Pakkenberg <pbirk@chromium.org>
Commit-Queue: Peter Conn <peconn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1456964}
This commit is contained in:
Peter E Conn
2025-05-07 06:50:42 -07:00
committed by Chromium LUCI CQ
parent 8d85dbe5fb
commit 2c1245a04f

@ -3351,8 +3351,6 @@ public class AwContents implements SmartClipProvider {
// instead attached to a FullScreenView. // instead attached to a FullScreenView.
mAwViewMethods.onAttachedToWindow(); mAwViewMethods.onAttachedToWindow();
if (mDisplayCutoutController != null) mDisplayCutoutController.onAttachedToWindow();
mAwFrameMetricsListener = mAwFrameMetricsListener =
AwFrameMetricsListener.maybeCreate( AwFrameMetricsListener.maybeCreate(
mContainerView, mWindowAndroid.getWindowAndroid()); mContainerView, mWindowAndroid.getWindowAndroid());
@ -4650,6 +4648,8 @@ public class AwContents implements SmartClipProvider {
StylusWritingSettingsState.getInstance().registerObserver(mStylusWritingController); StylusWritingSettingsState.getInstance().registerObserver(mStylusWritingController);
} }
if (mDisplayCutoutController != null) mDisplayCutoutController.onAttachedToWindow();
mAwWindowCoverageTracker = mAwWindowCoverageTracker =
AwWindowCoverageTracker.getOrCreateForRootView( AwWindowCoverageTracker.getOrCreateForRootView(
AwContents.this, mContainerView.getRootView()); AwContents.this, mContainerView.getRootView());