Files
brave-core/test
Sangwoo Ko 6da4988195 [Containers] Make context menu to open tabs/links in Containers (#29659)
Make a sharable ui::SimpleMenuModel for context menu to open tabs/links in Containers.

This menu contains items that represents corresponding Contianer,
and one more item to open settings page. And this menu is used by two places:
tab context menu and render view context menu.

They have a little difference in handling click action, so context menu
delegates its action to them.

<img width="403" alt="image" src="https://github.com/user-attachments/assets/41d6f916-f7d8-47c8-9454-b9f25f740591" />

**Container Model & Menu System:**
- Add ContainerModel class to represent container data in UI
  - For now this class is used only for context menus
  - but it could be used for tabs as well
- Add ContainersMenuModel for displaying container options in menus
  - ContainersMenuModel can be shared by multiple UI components
  - It gets data it needs via ContainersMenuModel::Delegate interface.

**Browser Integration:**
- Integrate containers menu into tab context menus via BraveTabMenuModel
- Add containers submenu to renderer context menus
- Implement ContainersMenuModel::Delegate interface in those context menu classes
- Add "Open in Container" command to both tab and page context menus

**Testing:**
- Add unit tests for ContainersMenuModel
- Implement ContainersMenuModelTestApi for testing private functionality
- Implement MockContainerMenuModelDelegate for testing
- Include tests for menu item creation, delegate callbacks, and state management

<!-- Add brave-browser issue below that this PR will resolve -->
Resolves https://github.com/brave/brave-browser/issues/46994
2025-06-27 23:06:13 +02:00
..