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

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

Issue 2264403006: Update ui/views menus to use async (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review Updates Created 4 years, 4 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/combobox/combobox.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 28da57db9a829494805c51d75e789bf60fd30379..82d852944b656dadf77f632a2663201039b3eb64 100644
--- a/ui/views/controls/scrollbar/base_scroll_bar.cc
+++ b/ui/views/controls/scrollbar/base_scroll_bar.cc
@@ -290,8 +290,9 @@ void BaseScrollBar::ShowContextMenuForView(View* source,
views::MenuItemView* menu = new views::MenuItemView(this);
// MenuRunner takes ownership of |menu|.
- menu_runner_.reset(new MenuRunner(
- menu, MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU));
+ menu_runner_.reset(new MenuRunner(menu, MenuRunner::HAS_MNEMONICS |
+ views::MenuRunner::CONTEXT_MENU |
+ views::MenuRunner::ASYNC));
menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollHere);
menu->AppendSeparator();
menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollStart);
@@ -302,13 +303,8 @@ 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::MENU_DELETED) {
- return;
- }
+ menu_runner_->RunMenuAt(GetWidget(), nullptr, gfx::Rect(p, gfx::Size()),
+ MENU_ANCHOR_TOPLEFT, source_type);
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698