Files
brave-core/patches/chrome-browser-ui-tabs-tab_data.cc.patch
Simon Hong 6f61e201fb [CR148] Fix NTP favicon override not being applied (#35989)
* [NTP] Fix NTP favicon override not being applied

The previous chromium_src override of TabData::FromTabInterface was
broken: the #define FromTabInterface FromTabInterface_ChromiumImpl
pattern also renamed the internal call inside
TabDataObserver::OnTabUIChange, so that function always called
FromTabInterface_ChromiumImpl directly, bypassing the Brave override
entirely.

Fix by injecting two macro hooks into the upstream FromTabInterface
body instead of overriding the whole function:
 * BRAVE_TAB_DATA_FROM_TAB_INTERFACE_SHARED_PINNED_EARLY_RETURN
   - early return for shared pinned tab dummy contents
 * BRAVE_TAB_DATA_FROM_TAB_INTERFACE_APPLY_OVERRIDES
   - favicon theming override for NTP/Welcome/Rewards pages and
     unloaded-tab discard status

This change also includes reverting https://github.com/brave/brave-core/pull/22852.
After applying FromTabInterface overriding, we found that
WebUIEmbeddingContextTest.InitEmbeddingContext_MovingTabsAcrossWindowsUpdatesContext
is failed. It was failed due to our should_show_discard_status flag overriding.
In this test, "browser" pointer is null at TabIcon::SetDisarded()
when this flag is on by our overriding.
That overriding is for showing unload ring when tab is gone by urgent discard.
But it doesn't work now. So just reverted.
See https://github.com/brave/brave-core/pull/22852 for more details.
2026-04-29 23:35:54 +09:00

21 lines
910 B
Diff

diff --git a/chrome/browser/ui/tabs/tab_data.cc b/chrome/browser/ui/tabs/tab_data.cc
index 84682b0f8437b952f7ed8607ab31a2f7f958938c..2bc5e7c51095e51a827bda7b199767ab3a37dd6a 100644
--- a/chrome/browser/ui/tabs/tab_data.cc
+++ b/chrome/browser/ui/tabs/tab_data.cc
@@ -28,6 +28,7 @@
namespace tabs {
TabData TabData::FromTabInterface(tabs::TabInterface* tab_interface) {
+ BRAVE_TAB_DATA_FROM_TAB_INTERFACE_SHARED_PINNED_EARLY_RETURN
TabUIHelper* const tab_ui_helper = TabUIHelper::From(tab_interface);
tabs::TabAlertController* const tab_alert_controller =
tabs::TabAlertController::From(tab_interface);
@@ -72,6 +73,7 @@ TabData TabData::FromTabInterface(tabs::TabInterface* tab_interface) {
tab_data.collaboration_messaging =
collaboration_messaging ? collaboration_messaging->GetWeakPtr() : nullptr;
+ BRAVE_TAB_DATA_FROM_TAB_INTERFACE_APPLY_OVERRIDES
return tab_data;
}