#include "ui/views/controls/menu/menu_model_adapter.h"
#include <list>
#include <memory>
#include <utility>
#include "base/check.h"
#include "base/notreached.h"
#include "ui/base/interaction/element_identifier.h"
#include "ui/base/models/menu_model.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/controls/menu/menu_item_view.h"
#include "ui/views/controls/menu/submenu_view.h"
#include "ui/views/view_class_properties.h"
namespace views {
MenuModelAdapter::MenuModelAdapter(
ui::MenuModel* menu_model,
base::RepeatingClosure on_menu_closed_callback)
: … { … }
MenuModelAdapter::~MenuModelAdapter() { … }
void MenuModelAdapter::BuildMenu(MenuItemView* menu) { … }
std::unique_ptr<MenuItemView> MenuModelAdapter::CreateMenu() { … }
std::optional<SkColor> MenuModelAdapter::GetLabelColor(int command_id) const { … }
bool MenuModelAdapter::IsTearingDown() const { … }
MenuItemView* MenuModelAdapter::AddMenuItemFromModelAt(ui::MenuModel* model,
size_t model_index,
MenuItemView* menu,
size_t menu_index,
int item_id) { … }
MenuItemView* MenuModelAdapter::AppendMenuItemFromModel(ui::MenuModel* model,
size_t model_index,
MenuItemView* menu,
int item_id) { … }
MenuItemView* MenuModelAdapter::AppendMenuItem(MenuItemView* menu,
ui::MenuModel* model,
size_t index) { … }
void MenuModelAdapter::ExecuteCommand(int id) { … }
void MenuModelAdapter::ExecuteCommand(int id, int mouse_event_flags) { … }
bool MenuModelAdapter::IsTriggerableEvent(MenuItemView* source,
const ui::Event& e) { … }
bool MenuModelAdapter::GetAccelerator(int id,
ui::Accelerator* accelerator) const { … }
std::u16string MenuModelAdapter::GetLabel(int id) const { … }
const gfx::FontList* MenuModelAdapter::GetLabelFontList(int id) const { … }
bool MenuModelAdapter::IsCommandEnabled(int id) const { … }
bool MenuModelAdapter::IsCommandVisible(int id) const { … }
bool MenuModelAdapter::IsItemChecked(int id) const { … }
void MenuModelAdapter::WillShowMenu(MenuItemView* menu) { … }
void MenuModelAdapter::WillHideMenu(MenuItemView* menu) { … }
void MenuModelAdapter::OnMenuClosed(MenuItemView* menu) { … }
void MenuModelAdapter::OnMenuStructureChanged() { … }
void MenuModelAdapter::OnMenuClearingDelegate() { … }
void MenuModelAdapter::BuildMenuImpl(MenuItemView* menu, ui::MenuModel* model) { … }
}