Allen Bauer | 969e74cf8 | 2023-09-07 20:49:47 | [diff] [blame] | 1 | // Copyright 2023 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "chrome/browser/ui/actions/chrome_actions.h" |
| 6 | |
Joseph Park | 2d0781a1 | 2023-10-12 23:09:46 | [diff] [blame] | 7 | #include <string> |
| 8 | |
| 9 | #include "base/containers/flat_map.h" |
| 10 | #include "chrome/browser/ui/actions/chrome_action_id.h" |
| 11 | #include "ui/actions/actions.h" |
| 12 | |
| 13 | void InitializeChromeActions(actions::ActionManager* manager) {} |
| 14 | |
Alison Gale | 3f4203f7 | 2024-04-26 19:27:42 | [diff] [blame] | 15 | // TODO(crbug.com/40285337): Adding temporarily to unblock the side panel team. |
Joseph Park | 2d0781a1 | 2023-10-12 23:09:46 | [diff] [blame] | 16 | // Should be removed/replaced when general solution to add action id mappings is |
| 17 | // implemented. |
| 18 | void InitializeActionIdStringMapping() { |
| 19 | #define MAP_ACTION_IDS_TO_STRINGS |
| 20 | #include "ui/actions/action_id_macros.inc" |
| 21 | |
Joseph Park | 50dfb8b | 2023-10-16 23:04:12 | [diff] [blame] | 22 | actions::ActionIdMap::AddActionIdToStringMappings( |
Andrew Paseltiner | 40b5491 | 2025-04-22 15:36:48 | [diff] [blame] | 23 | base::flat_map<actions::ActionId, std::string>( |
Joseph Park | 2d0781a1 | 2023-10-12 23:09:46 | [diff] [blame] | 24 | std::vector<std::pair<actions::ActionId, std::string>>{ |
| 25 | SIDE_PANEL_ACTION_IDS})); |
| 26 | |
Joseph Park | f793176 | 2024-02-22 20:52:42 | [diff] [blame] | 27 | actions::ActionIdMap::AddActionIdToStringMappings( |
Andrew Paseltiner | 40b5491 | 2025-04-22 15:36:48 | [diff] [blame] | 28 | base::flat_map<actions::ActionId, std::string>( |
Joseph Park | f793176 | 2024-02-22 20:52:42 | [diff] [blame] | 29 | std::vector<std::pair<actions::ActionId, std::string>>{ |
| 30 | TOOLBAR_PINNABLE_ACTION_IDS})); |
| 31 | |
Joseph Park | 2d0781a1 | 2023-10-12 23:09:46 | [diff] [blame] | 32 | #include "ui/actions/action_id_macros.inc" |
| 33 | #undef MAP_ACTION_IDS_TO_STRINGS |
| 34 | |
| 35 | #define MAP_STRING_TO_ACTION_IDS |
| 36 | #include "ui/actions/action_id_macros.inc" |
| 37 | |
Joseph Park | 50dfb8b | 2023-10-16 23:04:12 | [diff] [blame] | 38 | actions::ActionIdMap::AddStringToActionIdMappings( |
Andrew Paseltiner | 40b5491 | 2025-04-22 15:36:48 | [diff] [blame] | 39 | base::flat_map<std::string, actions::ActionId>( |
Joseph Park | 2d0781a1 | 2023-10-12 23:09:46 | [diff] [blame] | 40 | std::vector<std::pair<std::string, actions::ActionId>>{ |
| 41 | SIDE_PANEL_ACTION_IDS})); |
| 42 | |
Joseph Park | f793176 | 2024-02-22 20:52:42 | [diff] [blame] | 43 | actions::ActionIdMap::AddStringToActionIdMappings( |
Andrew Paseltiner | 40b5491 | 2025-04-22 15:36:48 | [diff] [blame] | 44 | base::flat_map<std::string, actions::ActionId>( |
Joseph Park | f793176 | 2024-02-22 20:52:42 | [diff] [blame] | 45 | std::vector<std::pair<std::string, actions::ActionId>>{ |
| 46 | TOOLBAR_PINNABLE_ACTION_IDS})); |
| 47 | |
Joseph Park | 2d0781a1 | 2023-10-12 23:09:46 | [diff] [blame] | 48 | #include "ui/actions/action_id_macros.inc" |
| 49 | #undef MAP_STRING_TO_ACTION_IDS |
| 50 | } |