#include "chrome/browser/ui/tabs/existing_window_sub_menu_model.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.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 "ui/base/accelerators/accelerator.h"
#if BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/ui/tabs/existing_window_sub_menu_model_chromeos.h"
#endif
namespace {
static constexpr int kWindowTitleForMenuMaxWidth = …;
}
std::unique_ptr<ExistingWindowSubMenuModel> ExistingWindowSubMenuModel::Create(
ui::SimpleMenuModel::Delegate* parent_delegate,
TabMenuModelDelegate* tab_menu_model_delegate,
TabStripModel* model,
int context_index) { … }
ExistingWindowSubMenuModel::ExistingWindowSubMenuModel(
base::PassKey<ExistingWindowSubMenuModel> passkey,
ui::SimpleMenuModel::Delegate* parent_delegate,
TabMenuModelDelegate* tab_menu_model_delegate,
TabStripModel* model,
int context_index)
: … { … }
ExistingWindowSubMenuModel::~ExistingWindowSubMenuModel() = default;
bool ExistingWindowSubMenuModel::GetAcceleratorForCommandId(
int command_id,
ui::Accelerator* accelerator) const { … }
bool ExistingWindowSubMenuModel::IsCommandIdChecked(int command_id) const { … }
bool ExistingWindowSubMenuModel::IsCommandIdEnabled(int command_id) const { … }
bool ExistingWindowSubMenuModel::ShouldShowSubmenu(Profile* profile) { … }
bool ExistingWindowSubMenuModel::ShouldShowSubmenuForApp(
TabMenuModelDelegate* tab_menu_model_delegate) { … }
base::PassKey<ExistingWindowSubMenuModel>
ExistingWindowSubMenuModel::GetPassKey() { … }
std::vector<ExistingBaseSubMenuModel::MenuItemInfo>
ExistingWindowSubMenuModel::BuildMenuItemInfoVectorForBrowsers(
const std::vector<Browser*>& existing_browsers) { … }
void ExistingWindowSubMenuModel::ExecuteExistingCommand(size_t target_index) { … }