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..121f428 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;
   }