diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/content/browser/display_cutout | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/content/browser/display_cutout')
-rw-r--r-- | chromium/content/browser/display_cutout/display_cutout_host_impl.cc | 19 | ||||
-rw-r--r-- | chromium/content/browser/display_cutout/display_cutout_host_impl.h | 2 |
2 files changed, 4 insertions, 17 deletions
diff --git a/chromium/content/browser/display_cutout/display_cutout_host_impl.cc b/chromium/content/browser/display_cutout/display_cutout_host_impl.cc index f6ee4595ed3..1640ec83489 100644 --- a/chromium/content/browser/display_cutout/display_cutout_host_impl.cc +++ b/chromium/content/browser/display_cutout/display_cutout_host_impl.cc @@ -47,7 +47,7 @@ void DisplayCutoutHostImpl::DidExitFullscreen() { SetCurrentRenderFrameHost(nullptr); } -void DisplayCutoutHostImpl::DidStartNavigation( +void DisplayCutoutHostImpl::DidFinishNavigation( NavigationHandle* navigation_handle) { // If the navigation is not in the main frame or if we are a same document // navigation then we should stop now. @@ -57,16 +57,6 @@ void DisplayCutoutHostImpl::DidStartNavigation( } RecordPendingUKMEvents(); -} - -void DisplayCutoutHostImpl::DidFinishNavigation( - NavigationHandle* navigation_handle) { - // If the navigation is not in the main frame or if we are a same document - // navigation then we should stop now. - if (!navigation_handle->IsInMainFrame() || - navigation_handle->IsSameDocument()) { - return; - } // If we finish a main frame navigation and the |WebDisplayMode| is // fullscreen then we should make the main frame the current @@ -182,6 +172,7 @@ void DisplayCutoutHostImpl::MaybeQueueUKMEvent(RenderFrameHost* frame) { // Adds the UKM event to the list of pending events. PendingUKMEvent pending_event; + pending_event.source_id = frame->GetPageUkmSourceId(); pending_event.is_main_frame = !frame->GetParent(); pending_event.applied_value = applied_value; pending_event.supplied_value = supplied_value; @@ -192,12 +183,8 @@ void DisplayCutoutHostImpl::MaybeQueueUKMEvent(RenderFrameHost* frame) { } void DisplayCutoutHostImpl::RecordPendingUKMEvents() { - // TODO(crbug.com/1061899): The code here should take an explicit reference - // to the corresponding frame instead of using the current main frame. - for (const auto& event : pending_ukm_events_) { - ukm::builders::Layout_DisplayCutout_StateChanged builder( - web_contents_impl_->GetMainFrame()->GetPageUkmSourceId()); + ukm::builders::Layout_DisplayCutout_StateChanged builder(event.source_id); builder.SetIsMainFrame(event.is_main_frame); builder.SetViewportFit_Applied(static_cast<int>(event.applied_value)); builder.SetViewportFit_Supplied(static_cast<int>(event.supplied_value)); diff --git a/chromium/content/browser/display_cutout/display_cutout_host_impl.h b/chromium/content/browser/display_cutout/display_cutout_host_impl.h index d281ab87e0e..56081029df0 100644 --- a/chromium/content/browser/display_cutout/display_cutout_host_impl.h +++ b/chromium/content/browser/display_cutout/display_cutout_host_impl.h @@ -27,7 +27,6 @@ class DisplayCutoutHostImpl : public blink::mojom::DisplayCutoutHost { // Called by WebContents when various events occur. void DidAcquireFullscreen(RenderFrameHost* rfh); void DidExitFullscreen(); - void DidStartNavigation(NavigationHandle* navigation_handle); void DidFinishNavigation(NavigationHandle* navigation_handle); void RenderFrameDeleted(RenderFrameHost* rfh); void RenderFrameCreated(RenderFrameHost* rfh); @@ -39,6 +38,7 @@ class DisplayCutoutHostImpl : public blink::mojom::DisplayCutoutHost { private: // Stores the data for a pending UKM event. struct PendingUKMEvent { + ukm::SourceId source_id; bool is_main_frame; blink::mojom::ViewportFit applied_value; blink::mojom::ViewportFit supplied_value; |