diff --git a/atom/browser/ui/views/menu_bar.cc b/atom/browser/ui/views/menu_bar.cc index ba0a542c1e8d..872375ccbbd1 100644 --- a/atom/browser/ui/views/menu_bar.cc +++ b/atom/browser/ui/views/menu_bar.cc @@ -104,7 +104,7 @@ int MenuBar::GetAcceleratorIndex(base::char16 key) { void MenuBar::ActivateAccelerator(base::char16 key) { int i = GetAcceleratorIndex(key); if (i != -1) - static_cast(child_at(i))->Activate(); + static_cast(child_at(i))->Activate(nullptr); } int MenuBar::GetItemCount() const { @@ -141,22 +141,22 @@ const char* MenuBar::GetClassName() const { void MenuBar::ButtonPressed(views::Button* sender, const ui::Event& event) { } -void MenuBar::OnMenuButtonClicked(views::View* source, - const gfx::Point& point) { +void MenuBar::OnMenuButtonClicked(views::MenuButton* source, + const gfx::Point& point, + const ui::Event* event) { // Hide the accelerator when a submenu is activated. SetAcceleratorVisibility(false); if (!menu_model_) return; - views::MenuButton* button = static_cast(source); - int id = button->tag(); + int id = source->tag(); ui::MenuModel::ItemType type = menu_model_->GetTypeAt(id); if (type != ui::MenuModel::TYPE_SUBMENU) return; MenuDelegate menu_delegate(this); - menu_delegate.RunMenu(menu_model_->GetSubmenuModelAt(id), button); + menu_delegate.RunMenu(menu_model_->GetSubmenuModelAt(id), source); } } // namespace atom diff --git a/atom/browser/ui/views/menu_bar.h b/atom/browser/ui/views/menu_bar.h index 9d77cfdf2a22..9f38a5981c7f 100644 --- a/atom/browser/ui/views/menu_bar.h +++ b/atom/browser/ui/views/menu_bar.h @@ -57,8 +57,10 @@ class MenuBar : public views::View, void ButtonPressed(views::Button* sender, const ui::Event& event) override; // views::MenuButtonListener: - void OnMenuButtonClicked(views::View* source, - const gfx::Point& point) override; + void OnMenuButtonClicked(views::MenuButton* source, + const gfx::Point& point, + const ui::Event* event) override; + private: SkColor background_color_; diff --git a/atom/browser/ui/views/menu_delegate.cc b/atom/browser/ui/views/menu_delegate.cc index f0ecf13b36b6..a107a696250b 100644 --- a/atom/browser/ui/views/menu_delegate.cc +++ b/atom/browser/ui/views/menu_delegate.cc @@ -112,7 +112,7 @@ views::MenuItemView* MenuDelegate::GetSiblingMenu( content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, base::Bind(base::IgnoreResult(&views::MenuButton::Activate), - base::Unretained(button))); + base::Unretained(button), nullptr)); } return nullptr; diff --git a/atom/browser/ui/views/submenu_button.cc b/atom/browser/ui/views/submenu_button.cc index 72cab258cbec..ca06d7d627ef 100644 --- a/atom/browser/ui/views/submenu_button.cc +++ b/atom/browser/ui/views/submenu_button.cc @@ -26,7 +26,7 @@ base::string16 FilterAccelerator(const base::string16& label) { SubmenuButton::SubmenuButton(views::ButtonListener* listener, const base::string16& title, views::MenuButtonListener* menu_button_listener) - : views::MenuButton(listener, FilterAccelerator(title), + : views::MenuButton(FilterAccelerator(title), menu_button_listener, false), accelerator_(0), show_underline_(false),