From 579ba8a3622d8883ebae748717ad76deabb2ca72 Mon Sep 17 00:00:00 2001 From: Claudio DeSouza Date: Thu, 11 Sep 2025 16:54:11 +0100 Subject: [PATCH] [cr142] Various functions taking `BrowserWindowInterface*` This is part of the bedrock project and has affected a few functions, that used to take `Browser*`. Chromium changes: https://chromium.googlesource.com/chromium/src/+/16eb4103fa3cb36a7dd89776ec661625c8ccab7f commit 16eb4103fa3cb36a7dd89776ec661625c8ccab7f Author: Glenn Hartmann Date: Wed Sep 10 13:07:13 2025 -0700 [bedrock] Transition application_launch.cc away from BrowserList::OrderedByActivation(). This migration is part of project bedrock to reduce the dependencies on Browser and BrowserList. See https://crbug.com/431671320 for more info. Bug: 438458102 Change-Id: I6a6a6964216e39447ac9da869b3d41a3a5a294a4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6932034 Reviewed-by: Tom Lukaszewicz Commit-Queue: Glenn Hartmann Cr-Commit-Position: refs/heads/main@{#1513886} --- browser/ui/session_crashed_bubble_brave.cc | 6 ++++-- chromium_src/chrome/browser/ui/session_crashed_bubble.h | 5 +++-- chromium_src/chrome/browser/ui/startup/infobar_utils.cc | 7 ++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/browser/ui/session_crashed_bubble_brave.cc b/browser/ui/session_crashed_bubble_brave.cc index b2769caa796..26356a4a960 100644 --- a/browser/ui/session_crashed_bubble_brave.cc +++ b/browser/ui/session_crashed_bubble_brave.cc @@ -5,16 +5,18 @@ #include "brave/browser/metrics/metrics_reporting_util.h" #include "brave/browser/ui/browser_dialogs.h" +#include "chrome/browser/ui/browser_window/public/browser_window_interface.h" #include "chrome/browser/ui/session_crashed_bubble.h" // static void SessionCrashedBubble::ShowIfNotOffTheRecordProfileBrave( - Browser* browser, + BrowserWindowInterface* browser, bool skip_tab_checking) { // If crash report permission ask dialog is launched, tab restore bubble will // be shown after closing aks dialog. if (ShouldShowCrashReportPermissionAskDialog()) { - brave::ShowCrashReportPermissionAskDialog(browser); + brave::ShowCrashReportPermissionAskDialog( + browser->GetBrowserForMigrationOnly()); return; } diff --git a/chromium_src/chrome/browser/ui/session_crashed_bubble.h b/chromium_src/chrome/browser/ui/session_crashed_bubble.h index f8bd2b1d3ff..51742f38dc2 100644 --- a/chromium_src/chrome/browser/ui/session_crashed_bubble.h +++ b/chromium_src/chrome/browser/ui/session_crashed_bubble.h @@ -6,8 +6,9 @@ #ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_SESSION_CRASHED_BUBBLE_H_ #define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_SESSION_CRASHED_BUBBLE_H_ -#define ShowIfNotOffTheRecordProfile \ - ShowIfNotOffTheRecordProfileBrave(Browser* browser, bool skip_tab_checking); \ +#define ShowIfNotOffTheRecordProfile \ + ShowIfNotOffTheRecordProfileBrave(BrowserWindowInterface* browser, \ + bool skip_tab_checking); \ static void ShowIfNotOffTheRecordProfile #include // IWYU pragma: export diff --git a/chromium_src/chrome/browser/ui/startup/infobar_utils.cc b/chromium_src/chrome/browser/ui/startup/infobar_utils.cc index 68b39dcccdb..389dbee66c1 100644 --- a/chromium_src/chrome/browser/ui/startup/infobar_utils.cc +++ b/chromium_src/chrome/browser/ui/startup/infobar_utils.cc @@ -40,7 +40,7 @@ class BraveGoogleKeysInfoBarDelegate { #undef GoogleApiKeysInfoBarDelegate #undef ShowIfNotOffTheRecordProfile -void AddInfoBarsIfNecessary(Browser* browser, +void AddInfoBarsIfNecessary(BrowserWindowInterface* browser, Profile* profile, const base::CommandLine& startup_command_line, chrome::startup::IsFirstRun is_first_run, @@ -51,7 +51,8 @@ void AddInfoBarsIfNecessary(Browser* browser, is_first_run, is_web_app, is_post_crash_launch, was_restarted); - if (!browser || !profile || browser->tab_strip_model()->count() == 0) { + TabStripModel* tab_strip_model = browser->GetTabStripModel(); + if (!browser || !profile || tab_strip_model->count() == 0) { return; } @@ -68,7 +69,7 @@ void AddInfoBarsIfNecessary(Browser* browser, infobars_shown = true; content::WebContents* web_contents = - browser->tab_strip_model()->GetActiveWebContents(); + tab_strip_model->GetActiveWebContents(); DCHECK(web_contents); infobars::ContentInfoBarManager* infobar_manager = infobars::ContentInfoBarManager::FromWebContents(web_contents);