summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc12
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.h4
-rw-r--r--chrome/browser/ui/cocoa/menu_controller_unittest.mm4
-rw-r--r--chrome/browser/ui/views/button_dropdown_test.cc4
-rw-r--r--chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc2
5 files changed, 17 insertions, 9 deletions
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 99d93bad3..1db6885 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -1725,13 +1725,21 @@ RenderViewContextMenu::GetHandlersForLinkUrl() {
return handlers;
}
-void RenderViewContextMenu::MenuWillShow() {
+void RenderViewContextMenu::MenuWillShow(ui::SimpleMenuModel* source) {
+ // Ignore notifications from submenus.
+ if (source != &menu_model_)
+ return;
+
RenderWidgetHostView* view = source_tab_contents_->GetRenderWidgetHostView();
if (view)
view->ShowingContextMenu(true);
}
-void RenderViewContextMenu::MenuClosed() {
+void RenderViewContextMenu::MenuClosed(ui::SimpleMenuModel* source) {
+ // Ignore notifications from submenus.
+ if (source != &menu_model_)
+ return;
+
RenderWidgetHostView* view = source_tab_contents_->GetRenderWidgetHostView();
if (view)
view->ShowingContextMenu(false);
diff --git a/chrome/browser/tab_contents/render_view_context_menu.h b/chrome/browser/tab_contents/render_view_context_menu.h
index 31bb1f1..65bb3dd 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.h
+++ b/chrome/browser/tab_contents/render_view_context_menu.h
@@ -52,8 +52,8 @@ class RenderViewContextMenu : public ui::SimpleMenuModel::Delegate {
virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
virtual void ExecuteCommand(int command_id) OVERRIDE;
- virtual void MenuWillShow() OVERRIDE;
- virtual void MenuClosed() OVERRIDE;
+ virtual void MenuWillShow(ui::SimpleMenuModel* source) OVERRIDE;
+ virtual void MenuClosed(ui::SimpleMenuModel* source) OVERRIDE;
protected:
void InitMenu();
diff --git a/chrome/browser/ui/cocoa/menu_controller_unittest.mm b/chrome/browser/ui/cocoa/menu_controller_unittest.mm
index 928923d..d838531 100644
--- a/chrome/browser/ui/cocoa/menu_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/menu_controller_unittest.mm
@@ -40,7 +40,7 @@ class Delegate : public ui::SimpleMenuModel::Delegate {
ui::Accelerator* accelerator) { return false; }
virtual void ExecuteCommand(int command_id) { ++execute_count_; }
- virtual void MenuWillShow() {
+ virtual void MenuWillShow(ui::SimpleMenuModel* /*source*/) {
EXPECT_FALSE(did_show_);
EXPECT_FALSE(did_close_);
did_show_ = true;
@@ -53,7 +53,7 @@ class Delegate : public ui::SimpleMenuModel::Delegate {
inModes:modes];
}
- virtual void MenuClosed() {
+ virtual void MenuClosed(ui::SimpleMenuModel* /*source*/) {
EXPECT_TRUE(did_show_);
EXPECT_FALSE(did_close_);
did_close_ = true;
diff --git a/chrome/browser/ui/views/button_dropdown_test.cc b/chrome/browser/ui/views/button_dropdown_test.cc
index d0650452..2e737db 100644
--- a/chrome/browser/ui/views/button_dropdown_test.cc
+++ b/chrome/browser/ui/views/button_dropdown_test.cc
@@ -59,11 +59,11 @@ class ButtonDropDownDragTest : public ViewEventTestBase,
virtual void ExecuteCommand(int id) OVERRIDE {
}
- virtual void MenuWillShow() OVERRIDE {
+ virtual void MenuWillShow(ui::SimpleMenuModel* /*source*/) OVERRIDE {
menu_shown_ = true;
}
- virtual void MenuClosed() OVERRIDE {
+ virtual void MenuClosed(ui::SimpleMenuModel* /*source*/) OVERRIDE {
menu_closed_ = true;
}
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index 92b8414..686124a 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -105,7 +105,7 @@ class BrowserTabStripController::TabContextMenuContents
tab_);
}
- virtual void MenuClosed() OVERRIDE {
+ virtual void MenuClosed(ui::SimpleMenuModel* /*source*/) OVERRIDE {
if (controller_)
controller_->tabstrip_->StopAllHighlighting();
}