commit | f086205293c23cea33d680f89613ad04c20df4e0 | [log] [tgz] |
---|---|---|
author | Antia Puentes <apuentes@igalia.com> | Wed Nov 16 11:22:15 2022 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Nov 16 11:22:15 2022 |
tree | 233e9f418f4b8f820e3df6d748da82b9242f7a8e | |
parent | be2e1c284674c6685c4a49b1d2b31e2c6e35c815 [diff] |
Rewrite GetPrimaryMainFrame comparison in terms of IsInPrimaryMainFrame (8/n) This CL replaces the GetPrimaryMainFrame() comparison check in favor of a more concise method IsInPrimaryMainFrame() in: * safe_tip_page_info_bubble_view.cc * page_info_bubble_view_base.cc Bug: 1268893 Change-Id: I6909eebec4ae0872081b4976275e9460216ea39d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4028636 Commit-Queue: Antia Puentes <apuentes@igalia.com> Reviewed-by: Christian Dullweber <dullweber@chromium.org> Cr-Commit-Position: refs/heads/main@{#1072157}
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view_base.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view_base.cc index a71302a3..121f428b 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view_base.cc +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view_base.cc
@@ -67,7 +67,7 @@ void PageInfoBubbleViewBase::RenderFrameDeleted( content::RenderFrameHost* render_frame_host) { - if (render_frame_host == web_contents()->GetPrimaryMainFrame()) { + if (render_frame_host->IsInPrimaryMainFrame()) { GetWidget()->Close(); } }
diff --git a/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view.cc b/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view.cc index 1e5fd36..6beb8611 100644 --- a/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view.cc +++ b/chrome/browser/ui/views/page_info/safety_tip_page_info_bubble_view.cc
@@ -189,7 +189,7 @@ void SafetyTipPageInfoBubbleView::RenderFrameDeleted( content::RenderFrameHost* render_frame_host) { - if (render_frame_host != web_contents()->GetPrimaryMainFrame()) { + if (!render_frame_host->IsInPrimaryMainFrame()) { return; }