Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(859)

Unified Diff: ui/views/controls/scrollbar/base_scroll_bar.cc

Issue 390183002: MacViews: Move menu run types parameter to constructor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/menu/menu_runner.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « ui/views/controls/menu/menu_runner.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698