#include "chrome/browser/ui/tabs/existing_tab_group_sub_menu_model.h"
#include <optional>
#include <vector>
#include "base/containers/contains.h"
#include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h"
#include "base/notreached.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_group.h"
#include "chrome/browser/ui/tabs/tab_group_model.h"
#include "chrome/browser/ui/tabs/tab_group_theme.h"
#include "chrome/browser/ui/tabs/tab_menu_model_delegate.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model_delegate.h"
#include "chrome/grit/generated_resources.h"
#include "components/tab_groups/tab_group_color.h"
#include "components/tab_groups/tab_group_id.h"
#include "components/tab_groups/tab_group_visual_data.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/accelerators/menu_label_accelerator_util.h"
#include "ui/base/models/image_model.h"
#include "ui/base/models/list_selection_model.h"
#include "ui/color/color_provider.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/canvas_image_source.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/paint_vector_icon.h"
namespace {
constexpr int kIconSize = …;
}
ExistingTabGroupSubMenuModel::ExistingTabGroupSubMenuModel(
ui::SimpleMenuModel::Delegate* parent_delegate,
TabMenuModelDelegate* tab_menu_model_delegate,
TabStripModel* model,
int context_index)
: … { … }
ExistingTabGroupSubMenuModel::~ExistingTabGroupSubMenuModel() = default;
const std::vector<tab_groups::TabGroupId>
ExistingTabGroupSubMenuModel::GetGroupsFromModel(TabStripModel* current_model) { … }
const std::vector<ExistingTabGroupSubMenuModel::MenuItemInfo>
ExistingTabGroupSubMenuModel::GetMenuItemsFromModel(
TabStripModel* current_model) { … }
bool ExistingTabGroupSubMenuModel::ShouldShowSubmenu(
TabStripModel* model,
int context_index,
TabMenuModelDelegate* tab_menu_model_delegate) { … }
void ExistingTabGroupSubMenuModel::ExecuteExistingCommand(size_t target_index) { … }
bool ExistingTabGroupSubMenuModel::ShouldShowGroup(
TabStripModel* model,
int context_index,
tab_groups::TabGroupId group) { … }
void ExistingTabGroupSubMenuModel::ExecuteExistingCommandForTesting(
size_t target_index) { … }