Commit 8633462d authored by Becca Hughes's avatar Becca Hughes Committed by Commit Bot

[Display Cutout] Do not create DisplayCutoutHostImpl

Do not create DisplayCutoutHostImpl automatically in WebContentsImpl

BUG=859241

Change-Id: I1dff20d653d1712f529f595c3fb9d0ce08eaceeb
Reviewed-on: https://chromium-review.googlesource.com/1129557Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Becca Hughes <beccahughes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573451}
parent cb7bfaf7
......@@ -679,7 +679,10 @@ WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
host_zoom_map_observer_.reset(new HostZoomMapObserver(this));
#endif // !defined(OS_ANDROID)
#if defined(OS_ANDROID)
if (base::FeatureList::IsEnabled(features::kDisplayCutoutAPI))
display_cutout_host_impl_ = std::make_unique<DisplayCutoutHostImpl>(this);
#endif
registry_.AddInterface(base::BindRepeating(
&WebContentsImpl::OnColorChooserFactoryRequest, base::Unretained(this)));
......@@ -1392,6 +1395,7 @@ const std::string& WebContentsImpl::GetMediaDeviceGroupIDSaltBase() const {
#if defined(OS_ANDROID)
void WebContentsImpl::SetDisplayCutoutSafeArea(gfx::Insets insets) {
if (display_cutout_host_impl_)
display_cutout_host_impl_->SetDisplayCutoutSafeArea(insets);
}
......@@ -4152,9 +4156,11 @@ void WebContentsImpl::ReadyToCommitNavigation(
SetNotWaitingForResponse();
// Reset the viewport fit
if (display_cutout_host_impl_) {
display_cutout_host_impl_->ViewportFitChangedForFrame(
navigation_handle->GetRenderFrameHost(),
blink::mojom::ViewportFit::kAuto);
}
}
void WebContentsImpl::DidFinishNavigation(NavigationHandle* navigation_handle) {
......
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