diff --git a/app/brave_command_ids.h b/app/brave_command_ids.h index 129a36aab867..bbaf390b8ac3 100644 --- a/app/brave_command_ids.h +++ b/app/brave_command_ids.h @@ -138,6 +138,8 @@ // Adblock (user-defined cosmetic filters) #define IDC_ADBLOCK_CONTEXT_BLOCK_ELEMENTS 56351 +#define IDC_SHOW_APPS_PAGE 56352 + #define IDC_BRAVE_COMMANDS_LAST 57000 #endif // BRAVE_APP_BRAVE_COMMAND_IDS_H_ diff --git a/browser/ui/brave_browser_command_controller.cc b/browser/ui/brave_browser_command_controller.cc index 1090d9ef199d..72ac8e2c8156 100644 --- a/browser/ui/brave_browser_command_controller.cc +++ b/browser/ui/brave_browser_command_controller.cc @@ -275,6 +275,9 @@ void BraveBrowserCommandController::InitBraveCommandState() { UpdateCommandEnabled(IDC_COMMANDER, commander::IsEnabled()); #endif + UpdateCommandEnabled(IDC_SHOW_APPS_PAGE, + !browser_->profile()->IsPrimaryOTRProfile()); + UpdateCommandEnabled(IDC_BRAVE_BOOKMARK_BAR_SUBMENU, true); UpdateCommandEnabled(IDC_TOGGLE_VERTICAL_TABS, true); @@ -656,6 +659,9 @@ bool BraveBrowserCommandController::ExecuteBraveCommandWithDisposition( brave::ToggleCommander(base::to_address(browser_)); #endif break; + case IDC_SHOW_APPS_PAGE: + brave::ShowAppsPage(&*browser_); + break; case IDC_WINDOW_GROUP_UNGROUPED_TABS: brave::GroupUngroupedTabs(&*browser_); break; diff --git a/browser/ui/brave_pages.cc b/browser/ui/brave_pages.cc index 81779b8b904e..f5e8351be9fb 100644 --- a/browser/ui/brave_pages.cc +++ b/browser/ui/brave_pages.cc @@ -92,4 +92,8 @@ void ShowWalletSettings(Browser* browser) { ShowSingletonTabOverwritingNTP(browser, GURL(kWalletSettingsURL)); } +void ShowAppsPage(Browser* browser) { + ShowSingletonTabOverwritingNTP(browser, GURL(chrome::kChromeUIAppsURL)); +} + } // namespace brave diff --git a/browser/ui/brave_pages.h b/browser/ui/brave_pages.h index 8fe518460d06..1e18e3716417 100644 --- a/browser/ui/brave_pages.h +++ b/browser/ui/brave_pages.h @@ -27,6 +27,8 @@ void ShowShortcutsPage(Browser* browser); void ShowBraveTalk(Browser* browser); void ShowFullpageChat(Browser* browser); +void ShowAppsPage(Browser* browser); + } // namespace brave #endif // BRAVE_BROWSER_UI_BRAVE_PAGES_H_ diff --git a/browser/ui/toolbar/app_menu_icons.cc b/browser/ui/toolbar/app_menu_icons.cc index dad2f24b1587..77c0c30f035a 100644 --- a/browser/ui/toolbar/app_menu_icons.cc +++ b/browser/ui/toolbar/app_menu_icons.cc @@ -106,6 +106,7 @@ const std::map& GetCommandIcons() { {IDC_OPEN_GUEST_PROFILE, kLeoUserCircleIcon}, {IDC_NAME_WINDOW, kLeoEditBoxIcon}, {IDC_COMMANDER, kLeoArrowSmallRightIcon}, + {IDC_SHOW_APPS_PAGE, kLeoGrid04Icon}, {IDC_PERFORMANCE, kLeoNetworkSpeedFastIcon}, {IDC_DEV_TOOLS, kLeoCodeIcon}, {IDC_TASK_MANAGER, kLeoWindowBinaryCodeIcon}, diff --git a/browser/ui/toolbar/brave_app_menu_model.cc b/browser/ui/toolbar/brave_app_menu_model.cc index 29ca27e68436..0c4dae8d717e 100644 --- a/browser/ui/toolbar/brave_app_menu_model.cc +++ b/browser/ui/toolbar/brave_app_menu_model.cc @@ -67,9 +67,7 @@ BraveAppMenuModel::BraveAppMenuModel( Browser* browser, AppMenuIconController* app_menu_icon_controller, AlertMenuItem alert_item) - : AppMenuModel(provider, browser, app_menu_icon_controller, alert_item) -{ -} + : AppMenuModel(provider, browser, app_menu_icon_controller, alert_item) {} BraveAppMenuModel::~BraveAppMenuModel() = default; @@ -287,6 +285,14 @@ void BraveAppMenuModel::BuildMoreToolsSubMenu() { need_separator = false; } + if (!browser()->profile()->IsOffTheRecord()) { + if (auto index = + more_tools_menu_model->GetIndexOfCommandId(IDC_NAME_WINDOW)) { + more_tools_menu_model->InsertItemWithStringIdAt( + *index + 1, IDC_SHOW_APPS_PAGE, IDS_IDC_SHOW_APPS_PAGE); + } + } + #if BUILDFLAG(ENABLE_COMMANDER) if (auto index = more_tools_menu_model->GetIndexOfCommandId(IDC_NAME_WINDOW)) { diff --git a/browser/ui/toolbar/brave_app_menu_model_browsertest.cc b/browser/ui/toolbar/brave_app_menu_model_browsertest.cc index 55855e7f6849..2361222f3a2f 100644 --- a/browser/ui/toolbar/brave_app_menu_model_browsertest.cc +++ b/browser/ui/toolbar/brave_app_menu_model_browsertest.cc @@ -208,7 +208,7 @@ IN_PROC_BROWSER_TEST_F(BraveAppMenuModelBrowserTest, MenuOrderTest) { std::vector more_tools_in_order = { IDC_ADD_NEW_PROFILE, IDC_OPEN_GUEST_PROFILE, IDC_SHOW_BRAVE_SYNC, - IDC_DEV_TOOLS, IDC_TASK_MANAGER, + IDC_SHOW_APPS_PAGE, IDC_DEV_TOOLS, IDC_TASK_MANAGER, }; if (!syncer::IsSyncAllowedByFlag()) { @@ -259,6 +259,12 @@ IN_PROC_BROWSER_TEST_F(BraveAppMenuModelBrowserTest, MenuOrderTest) { commands_disabled_for_private_profile); CheckHelpCommandsAreInOrderInMenuModel(private_browser, help_commands_in_order); + + // SHOW_APPS_PAGE isn't available in incognito + more_tools_in_order.erase( + std::remove(more_tools_in_order.begin(), more_tools_in_order.end(), + IDC_SHOW_APPS_PAGE), + more_tools_in_order.end()); CheckMoreToolsCommandsAreInOrderInMenuModel(private_browser, more_tools_in_order); diff --git a/components/resources/commands.grdp b/components/resources/commands.grdp index 4674234e2496..95682602f8af 100644 --- a/components/resources/commands.grdp +++ b/components/resources/commands.grdp @@ -516,6 +516,9 @@ Swap Tab Positions + + Show Apps + @@ -533,5 +536,8 @@ Swap tab positions + + Show apps + diff --git a/components/vector_icons/BUILD.gn b/components/vector_icons/BUILD.gn index 48f81788b8c4..53fa9dce6922 100644 --- a/components/vector_icons/BUILD.gn +++ b/components/vector_icons/BUILD.gn @@ -49,6 +49,7 @@ aggregate_vector_icons("brave_components_vector_icons") { "leo_folder_exchange.icon", "leo_folder.icon", "leo_fullscreen_on.icon", + "leo_grid04.icon", "leo_heart_filled.icon", "leo_heart_outline.icon", "leo_help_outline.icon",