Files
brave-core/app
Simon Hong 43f2ac7072 Fixed tab closing bug from tab context menu (#31769)
Resolves brave/brave-browser#50063

This PR fixed regressions of https://github.com/brave/brave-core/pull/30951.
That PR missed the situation that context menu's tab is inactive.

One of that PR's purpose is closing only active tab via tab closing short cut(ex, cmd + w).
And we don't need that any more because upstream introduced
features::kCloseActiveTabInSplitViewViaHotkey feature.
With that feature, only active tab in split view is closed. So, deleted our code.

The other goal of original PR was closing only the tab context menu's tab.
Upstream closes both tab when execute tab close via tab context menu.
But we want to close only that tab if it's in split view.

This PR also includes dangling ptr fix(the changes in BraveTabMenuModel and BraveTabContextMenuContents).
It's not directly related but this PR's test code failed w/o that fix.

TEST=BraveTabContextMenuContentsTest.SplitViewMenuCustomizationTest,
SplitViewCommonBrowserTest.SplitViewCloseTabTest
2025-10-13 18:43:57 +09:00
..