From 35c8018845fcc2850e8ff72171fd044e7992f1a0 Mon Sep 17 00:00:00 2001 From: Claudio DeSouza Date: Tue, 24 Mar 2026 03:38:16 +0000 Subject: [PATCH] [cr148] `ShowSingletonTab` migrated to BWI Chromium changes: https://chromium.googlesource.com/chromium/src/+/7f61ab9536e34aad9c59e1f79bd0fada6f84a16c commit 7f61ab9536e34aad9c59e1f79bd0fada6f84a16c Author: Yu He Date: Sun Mar 22 11:57:30 2026 -0700 [bedrock] Migrate chrome_pages and singleton_tabs from Browser* to BrowserWindowInterface* Migrate function signatures in chrome_pages.h/cc and singleton_tabs.h/cc to accept BrowserWindowInterface* instead of Browser*. This allows callers to pass a BrowserWindowInterface* directly, eliminating intermediate GetBrowserForMigrationOnly() calls at: extension_install_ui_desktop.cc startup_launch_infobar_manager_impl.cc singleton_tabs.cc (internal usage) Also: Guard desktop-only includes in notification_common.cc with #if !BUILDFLAG(IS_ANDROID) to fix Android build. Add missing browser.h include to inspect_ui.cc. Remove forward declaration of Browser from chrome_pages.h and singleton_tabs.h. Bug: 494010890 Change-Id: Ica78133224b67d439dc264fa187d261b4ee6f87c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7667947 Reviewed-by: Qikai Zhong Auto-Submit: Yu He Commit-Queue: Tom Lukaszewicz Reviewed-by: Tom Lukaszewicz Cr-Commit-Position: refs/heads/main@{#1603192} --- .../ui/views/infobars/web_discovery_infobar_content_view.cc | 3 +-- browser/ui/webui/brave_adblock_ui.cc | 1 + browser/ui/webui/settings/brave_adblock_handler.cc | 1 + chromium_src/chrome/browser/ui/singleton_tabs.cc | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/browser/ui/views/infobars/web_discovery_infobar_content_view.cc b/browser/ui/views/infobars/web_discovery_infobar_content_view.cc index a3af50a3f41..c2e07857d3d 100644 --- a/browser/ui/views/infobars/web_discovery_infobar_content_view.cc +++ b/browser/ui/views/infobars/web_discovery_infobar_content_view.cc @@ -51,8 +51,7 @@ constexpr int kNarrowLayoutHorizontalPadding = 10; void OpenMoreInfoPage() { if (auto* browser = GetLastActiveBrowserWindowInterfaceWithAnyProfile()) { - ShowSingletonTab(browser->GetBrowserForMigrationOnly(), - GURL(kWebDiscoveryLearnMoreUrl)); + ShowSingletonTab(browser, GURL(kWebDiscoveryLearnMoreUrl)); } } diff --git a/browser/ui/webui/brave_adblock_ui.cc b/browser/ui/webui/brave_adblock_ui.cc index 387a9369068..74b7941d45d 100644 --- a/browser/ui/webui/brave_adblock_ui.cc +++ b/browser/ui/webui/brave_adblock_ui.cc @@ -31,6 +31,7 @@ #include "chrome/browser/android/tab_web_contents_delegate_android.h" #include "content/public/browser/web_contents.h" #else +#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_navigator_params.h" #include "chrome/browser/ui/singleton_tabs.h" diff --git a/browser/ui/webui/settings/brave_adblock_handler.cc b/browser/ui/webui/settings/brave_adblock_handler.cc index dbaf2d5a53e..237990f8497 100644 --- a/browser/ui/webui/settings/brave_adblock_handler.cc +++ b/browser/ui/webui/settings/brave_adblock_handler.cc @@ -24,6 +24,7 @@ #include "brave/components/brave_shields/core/common/pref_names.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/singleton_tabs.h" #include "content/public/browser/web_ui.h" diff --git a/chromium_src/chrome/browser/ui/singleton_tabs.cc b/chromium_src/chrome/browser/ui/singleton_tabs.cc index 07a38de6b56..13d4f21ef59 100644 --- a/chromium_src/chrome/browser/ui/singleton_tabs.cc +++ b/chromium_src/chrome/browser/ui/singleton_tabs.cc @@ -12,7 +12,7 @@ // and remote (on https://www.google.com and https://support.google.com). // For remote URLs going to Google we want to point users to our community site // instead. -void ShowSingletonTab(Browser* browser, const GURL& url) { +void ShowSingletonTab(BrowserWindowInterface* browser, const GURL& url) { GURL new_url = url.DomainIs("google.com") ? GURL("https://community.brave.app/") : url;