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

Unified Diff: ui/views/examples/menu_example.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/textfield/textfield.cc ('k') | ui/views/examples/tree_view_example.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/menu_example.cc
diff --git a/ui/views/examples/menu_example.cc b/ui/views/examples/menu_example.cc
index 7f38c5d853fdca18fa40e2086f49afae6229ab48..c8c8368a73f83033d9e9068e4ece327116721760 100644
--- a/ui/views/examples/menu_example.cc
+++ b/ui/views/examples/menu_example.cc
@@ -179,16 +179,12 @@ ExampleMenuButton::~ExampleMenuButton() {
void ExampleMenuButton::OnMenuButtonClicked(MenuButton* source,
const gfx::Point& point,
const ui::Event* event) {
- menu_runner_.reset(new MenuRunner(GetMenuModel(), MenuRunner::HAS_MNEMONICS));
-
- if (menu_runner_->RunMenuAt(source->GetWidget()->GetTopLevelWidget(),
- this,
- gfx::Rect(point, gfx::Size()),
- MENU_ANCHOR_TOPRIGHT,
- ui::MENU_SOURCE_NONE) ==
- MenuRunner::MENU_DELETED) {
- return;
- }
+ menu_runner_.reset(new MenuRunner(
+ GetMenuModel(), MenuRunner::HAS_MNEMONICS | MenuRunner::ASYNC));
+
+ menu_runner_->RunMenuAt(source->GetWidget()->GetTopLevelWidget(), this,
+ gfx::Rect(point, gfx::Size()), MENU_ANCHOR_TOPRIGHT,
+ ui::MENU_SOURCE_NONE);
}
ui::SimpleMenuModel* ExampleMenuButton::GetMenuModel() {
« no previous file with comments | « ui/views/controls/textfield/textfield.cc ('k') | ui/views/examples/tree_view_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698