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) ...@@ -679,7 +679,10 @@ WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
host_zoom_map_observer_.reset(new HostZoomMapObserver(this)); host_zoom_map_observer_.reset(new HostZoomMapObserver(this));
#endif // !defined(OS_ANDROID) #endif // !defined(OS_ANDROID)
display_cutout_host_impl_ = std::make_unique<DisplayCutoutHostImpl>(this); #if defined(OS_ANDROID)
if (base::FeatureList::IsEnabled(features::kDisplayCutoutAPI))
display_cutout_host_impl_ = std::make_unique<DisplayCutoutHostImpl>(this);
#endif
registry_.AddInterface(base::BindRepeating( registry_.AddInterface(base::BindRepeating(
&WebContentsImpl::OnColorChooserFactoryRequest, base::Unretained(this))); &WebContentsImpl::OnColorChooserFactoryRequest, base::Unretained(this)));
...@@ -1392,7 +1395,8 @@ const std::string& WebContentsImpl::GetMediaDeviceGroupIDSaltBase() const { ...@@ -1392,7 +1395,8 @@ const std::string& WebContentsImpl::GetMediaDeviceGroupIDSaltBase() const {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
void WebContentsImpl::SetDisplayCutoutSafeArea(gfx::Insets insets) { void WebContentsImpl::SetDisplayCutoutSafeArea(gfx::Insets insets) {
display_cutout_host_impl_->SetDisplayCutoutSafeArea(insets); if (display_cutout_host_impl_)
display_cutout_host_impl_->SetDisplayCutoutSafeArea(insets);
} }
#endif #endif
...@@ -4152,9 +4156,11 @@ void WebContentsImpl::ReadyToCommitNavigation( ...@@ -4152,9 +4156,11 @@ void WebContentsImpl::ReadyToCommitNavigation(
SetNotWaitingForResponse(); SetNotWaitingForResponse();
// Reset the viewport fit // Reset the viewport fit
display_cutout_host_impl_->ViewportFitChangedForFrame( if (display_cutout_host_impl_) {
navigation_handle->GetRenderFrameHost(), display_cutout_host_impl_->ViewportFitChangedForFrame(
blink::mojom::ViewportFit::kAuto); navigation_handle->GetRenderFrameHost(),
blink::mojom::ViewportFit::kAuto);
}
} }
void WebContentsImpl::DidFinishNavigation(NavigationHandle* navigation_handle) { 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