Index: ui/views/controls/scrollbar/base_scroll_bar.cc |
diff --git a/ui/views/controls/scrollbar/base_scroll_bar.cc b/ui/views/controls/scrollbar/base_scroll_bar.cc |
index 5e4d6a56fa384d09ee9687b319bf218a14e3ed17..c93f48e2bb540466047de39c048ac3e03eb74de3 100644 |
--- a/ui/views/controls/scrollbar/base_scroll_bar.cc |
+++ b/ui/views/controls/scrollbar/base_scroll_bar.cc |
@@ -294,7 +294,8 @@ void BaseScrollBar::ShowContextMenuForView(View* source, |
views::MenuItemView* menu = new views::MenuItemView(this); |
// MenuRunner takes ownership of |menu|. |
- menu_runner_.reset(new MenuRunner(menu)); |
+ menu_runner_.reset(new MenuRunner( |
+ menu, MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU)); |
menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollHere); |
menu->AppendSeparator(); |
menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollStart); |
@@ -305,14 +306,11 @@ void BaseScrollBar::ShowContextMenuForView(View* source, |
menu->AppendSeparator(); |
menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPrev); |
menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollNext); |
- if (menu_runner_->RunMenuAt( |
- GetWidget(), |
- NULL, |
- gfx::Rect(p, gfx::Size()), |
- MENU_ANCHOR_TOPLEFT, |
- source_type, |
- MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
- MenuRunner::MENU_DELETED) { |
+ if (menu_runner_->RunMenuAt(GetWidget(), |
+ NULL, |
+ gfx::Rect(p, gfx::Size()), |
+ MENU_ANCHOR_TOPLEFT, |
+ source_type) == MenuRunner::MENU_DELETED) { |
return; |
} |
} |