[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 <hartmanng@chromium.org>
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 <tluk@chromium.org>
    Commit-Queue: Glenn Hartmann <hartmanng@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1513886}
This commit is contained in:
Claudio DeSouza
2025-10-15 18:31:59 -04:00
committed by Emerick Rogul
parent 9e111593fc
commit 579ba8a362
3 changed files with 11 additions and 7 deletions
+4 -2
View File
@@ -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;
}
@@ -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 <chrome/browser/ui/session_crashed_bubble.h> // IWYU pragma: export
@@ -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);