Avi Drissman | 4a8573c | 2022-09-09 19:35:54 | [diff] [blame] | 1 | // Copyright 2022 The Chromium Authors |
avynn | 588605d1 | 2022-06-15 21:28:15 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_UI_ASH_DESKS_CHROME_DESKS_UTIL_H_ |
| 6 | #define CHROME_BROWSER_UI_ASH_DESKS_CHROME_DESKS_UTIL_H_ |
| 7 | |
| 8 | #include <memory> |
| 9 | |
| 10 | class TabGroupModel; |
| 11 | |
| 12 | namespace app_restore { |
| 13 | struct TabGroupInfo; |
| 14 | } // namespace app_restore |
| 15 | |
| 16 | namespace chrome_desks_util { |
| 17 | |
avynn | d5c3adc7 | 2023-09-13 23:09:55 | [diff] [blame] | 18 | // Name for app not available toast. |
Lei Zhang | da99b40 | 2025-05-06 21:11:48 | [diff] [blame] | 19 | inline constexpr char kAppNotAvailableTemplateToastName[] = |
avynn | d5c3adc7 | 2023-09-13 23:09:55 | [diff] [blame] | 20 | "AppNotAvailableTemplateToast"; |
| 21 | |
avynn | 588605d1 | 2022-06-15 21:28:15 | [diff] [blame] | 22 | // Given a TabGroupModel that contains at least a single TabGroup this method |
Andrew Pantera | 7b4e99b9 | 2023-04-21 18:54:56 | [diff] [blame] | 23 | // returns a vector that contains tab_groups::TabGroupInfo representations of |
| 24 | // the TabGroups contained within the model. |
| 25 | std::vector<tab_groups::TabGroupInfo> ConvertTabGroupsToTabGroupInfos( |
| 26 | const TabGroupModel* group_model); |
avynn | 588605d1 | 2022-06-15 21:28:15 | [diff] [blame] | 27 | |
| 28 | // Given a vector of TabGroupInfo this function attaches tab groups to the |
| 29 | // out_browser instance passed as the second parameter. |
| 30 | void AttachTabGroupsToBrowserInstance( |
avynn | 1db65c8 | 2022-12-07 20:30:59 | [diff] [blame] | 31 | const std::vector<tab_groups::TabGroupInfo>& tab_groups, |
avynn | 588605d1 | 2022-06-15 21:28:15 | [diff] [blame] | 32 | Browser* browser); |
| 33 | |
avynn | e6bc27b | 2022-07-12 01:30:13 | [diff] [blame] | 34 | // Sets tabs in `browser` to be pinned up to the `first_non_pinned_tab_index`. |
| 35 | void SetBrowserPinnedTabs(int32_t first_non_pinned_tab_index, Browser* browser); |
| 36 | |
avynn | 588605d1 | 2022-06-15 21:28:15 | [diff] [blame] | 37 | } // namespace chrome_desks_util |
| 38 | |
shaochenguang | 77a7a02b | 2023-11-22 19:33:56 | [diff] [blame] | 39 | #endif // CHROME_BROWSER_UI_ASH_DESKS_CHROME_DESKS_UTIL_H_ |