[cr148] ShowSingletonTab migrated to BWI
Chromium changes: https://chromium.googlesource.com/chromium/src/+/7f61ab9536e34aad9c59e1f79bd0fada6f84a16c commit 7f61ab9536e34aad9c59e1f79bd0fada6f84a16c Author: Yu He <yhe@microsoft.com> 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 <qikaizhong@microsoft.com> Auto-Submit: Yu He <yhe@microsoft.com> Commit-Queue: Tom Lukaszewicz <tluk@chromium.org> Reviewed-by: Tom Lukaszewicz <tluk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1603192}
This commit is contained in:
@@ -51,8 +51,7 @@ constexpr int kNarrowLayoutHorizontalPadding = 10;
|
||||
|
||||
void OpenMoreInfoPage() {
|
||||
if (auto* browser = GetLastActiveBrowserWindowInterfaceWithAnyProfile()) {
|
||||
ShowSingletonTab(browser->GetBrowserForMigrationOnly(),
|
||||
GURL(kWebDiscoveryLearnMoreUrl));
|
||||
ShowSingletonTab(browser, GURL(kWebDiscoveryLearnMoreUrl));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user