Index: ui/views/controls/menu/menu_controller.cc |
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc |
index 7850c5826c59a9f39c11b84d8751ce6dd2310060..021164fc02607f636bef03b6c91fe0ba0fc00f3d 100644 |
--- a/ui/views/controls/menu/menu_controller.cc |
+++ b/ui/views/controls/menu/menu_controller.cc |
@@ -322,11 +322,11 @@ MenuItemView* MenuController::Run(Widget* parent, |
#if defined(USE_AURA) |
aura::client::GetDispatcherClient()->RunWithDispatcher(this, true); |
#else |
- MessageLoopForUI* loop = MessageLoopForUI::current(); |
- bool did_allow_task_nesting = loop->NestableTasksAllowed(); |
- loop->SetNestableTasksAllowed(true); |
- loop->RunWithDispatcher(this); |
- loop->SetNestableTasksAllowed(did_allow_task_nesting); |
+ { |
+ MessageLoopForUI* loop = MessageLoopForUI::current(); |
+ MessageLoop::ScopedNestableTaskAllower allow(loop); |
+ loop->RunWithDispatcher(this); |
+ } |
#endif |
if (ViewsDelegate::views_delegate) |