diff --git a/shell/browser/ui/views/menu_bar.cc b/shell/browser/ui/views/menu_bar.cc index 8e72000d131b..b8d254ee665a 100644 --- a/shell/browser/ui/views/menu_bar.cc +++ b/shell/browser/ui/views/menu_bar.cc @@ -193,7 +193,7 @@ void MenuBar::ButtonPressed(int id, const ui::Event& event) { SubmenuButton* source = nullptr; for (auto* child : children()) { auto* button = static_cast(child); - if (button->tag() == id) { + if (button->GetID() == id) { source = button; break; } @@ -226,7 +226,7 @@ void MenuBar::RebuildChildren() { auto* button = new SubmenuButton( base::BindRepeating(&MenuBar::ButtonPressed, base::Unretained(this), i), menu_model_->GetLabelAt(i), background_color_); - button->set_tag(i); + button->SetID(i); AddChildView(button); } UpdateViewColors(); diff --git a/shell/browser/ui/views/menu_delegate.cc b/shell/browser/ui/views/menu_delegate.cc index c6effd2707aa..e6f4c49b57f8 100644 --- a/shell/browser/ui/views/menu_delegate.cc +++ b/shell/browser/ui/views/menu_delegate.cc @@ -34,7 +34,7 @@ void MenuDelegate::RunMenu(ElectronMenuModel* model, hold_first_switch_ = true; } - id_ = button->tag(); + id_ = button->GetID(); adapter_ = std::make_unique(model); auto* item = new views::MenuItemView(this); @@ -127,7 +127,7 @@ views::MenuItemView* MenuDelegate::GetSiblingMenu( views::MenuButton* button; ElectronMenuModel* model; if (menu_bar_->GetMenuButtonFromScreenPoint(screen_point, &model, &button) && - button->tag() != id_) { + button->GetID() != id_) { bool switch_in_progress = !!button_to_open_; // Always update target to open. button_to_open_ = button;