Commit 05a2ce15 authored by Becca Hughes's avatar Becca Hughes Committed by Commit Bot

[Display Cutout] Remove support for standalone

It looks like standalone apps will still show the
system UI (and should) so they will be blocked
by the Android OS from extending into the display
cutout.

Therefore, we should not give them default control
of the cutout

BUG=859241

Change-Id: Ie26d41fe983c1f45e4177676a3f936a03ca3a07c
Reviewed-on: https://chromium-review.googlesource.com/1134080
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576126}
parent 0f8c1cf3
......@@ -70,7 +70,7 @@ public class WebappDisplayCutoutTest {
}
/**
* Test that a safe area is applied when we have viewport-fit=cover and a standalone
* Test that a safe area is not applied when we have viewport-fit=cover and a standalone
* display mode.
*/
@Test
......@@ -79,8 +79,8 @@ public class WebappDisplayCutoutTest {
public void testViewportFitWebapp_Standalone() throws InterruptedException, TimeoutException {
mTestRule.setViewportFit(DisplayCutoutTestRule.VIEWPORT_FIT_COVER);
mTestRule.waitForSafeArea(DisplayCutoutTestRule.TEST_SAFE_AREA_WITH_CUTOUT);
mTestRule.waitForSafeArea(DisplayCutoutTestRule.TEST_SAFE_AREA_WITHOUT_CUTOUT);
mTestRule.waitForLayoutInDisplayCutoutMode(
DisplayCutoutTestRule.LayoutParamsApi28.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES);
DisplayCutoutTestRule.LayoutParamsApi28.LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT);
}
}
......@@ -441,7 +441,7 @@ IN_PROC_BROWSER_TEST_F(DisplayCutoutBrowserTest, WebDisplayMode_Standalone) {
{
TestWebContentsObserver observer(web_contents_impl());
LoadTestPageWithViewportFitFromMeta("cover");
observer.WaitForWantedValue(blink::mojom::ViewportFit::kCover);
EXPECT_FALSE(observer.has_value());
}
}
......
......@@ -75,13 +75,12 @@ void DisplayCutoutHostImpl::DidFinishNavigation(
}
// If we finish a main frame navigation and the |WebDisplayMode| is
// fullscreen or standalone then we should make the main frame the
// current |RenderFrameHost|.
// fullscreen then we should make the main frame the current
// |RenderFrameHost|.
RenderWidgetHostImpl* rwh =
web_contents_impl()->GetRenderViewHost()->GetWidget();
blink::WebDisplayMode mode = web_contents_impl()->GetDisplayMode(rwh);
if (mode == blink::WebDisplayMode::kWebDisplayModeFullscreen ||
mode == blink::WebDisplayMode::kWebDisplayModeStandalone) {
if (mode == blink::WebDisplayMode::kWebDisplayModeFullscreen) {
SetCurrentRenderFrameHost(web_contents_impl()->GetMainFrame());
}
}
......
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