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

Unified Diff: ui/views/controls/menu/menu_controller.cc

Issue 9384024: Prefer ScopedNestableTaskAllower over manual save/restore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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
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)

Powered by Google App Engine
This is Rietveld 408576698