* Support tab groups in tree tab strip
Integrate tab groups with the tree tab strip so that groups are represented
as a single tree node wrapping the group (not one tree node per tab). Tabs
inside a group remain direct children of the group collection.
Collection and delegate:
- BraveTreeTabStripCollectionDelegate: When adding a tab with new_group_id,
add to collection without wrapping in a tree node; the group wraps it.
MoveTabsRecursive: handle empty tab_indices (no-op when moving within same
group), and route move-out-of-group and move-into-group to new helpers.
- MoveTabsIntoGroup: unwrap tabs from tree nodes (or detach from other
groups), add to target group; when group is detached (new group), wrap
group in a TreeTabNode and attach at the correct tree position.
- MoveTabsOutOfGroup: move tabs from TabGroupTabCollection back into the
tree by wrapping each in a tree node at the destination index.
- BraveTabStripCollection: add PopDetachedGroupCollectionForDelegate and
GetTreeTabNodeIdForGroup; chromium_src TabStripCollection gains virtual
GetTreeTabNodeIdForGroup. BraveTabStripCollectionDelegate implements
GetTreeTabNodeIdForGroup.
TreeTabNodeTabCollection:
- BuildTreeTabs: wrap entire groups in one tree node (processed_groups set);
grouped tabs stay as direct children of the group.
- New constructor that wraps a TabGroupTabCollection (for creating a group
in tree mode). Single-tab constructor allows null for GetEmptyTreeTabNode
when a tab was moved into a group and the view still holds the old node id.
Model, controller, and UI:
- BraveTabStripModel::GetTreeTabNodeIdForGroup returns the tree node id for
a group (or nullptr if tree tabs off). Wired through controller and
BraveTabStripCollection.
- BraveBrowserTabStripController::GetTreeTabNode returns GetEmptyTreeTabNode()
when the node is null (e.g. tab just moved into group, before
TabGroupedStateChanged/AddTabToGroup updates the view).
- OnTreeTabChanged: handle tab index kNoTab and detached state during group
creation; avoid double-clearing when AddTabToGroup will clear the node id.
- BraveTabStrip::AddTabToGroup override sets the tab's tree_tab_node from
GetTreeTabNodeIdForGroup when adding to a group in tree mode.