Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / ui / views / widget / desktop_aura / desktop_dispatcher_client.cc
index 212a6a4..be251da 100644 (file)
@@ -14,21 +14,16 @@ DesktopDispatcherClient::~DesktopDispatcherClient() {}
 
 void DesktopDispatcherClient::RunWithDispatcher(
     base::MessagePumpDispatcher* nested_dispatcher,
-    aura::Window* associated_window,
-    bool nestable_tasks_allowed) {
+    aura::Window* associated_window) {
   // TODO(erg): This class has been copypastad from
   // ash/accelerators/nested_dispatcher_controller.cc. I have left my changes
   // commented out because I don't entirely understand the implications of the
   // change.
   base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
-  bool did_allow_task_nesting = loop->NestableTasksAllowed();
-  loop->SetNestableTasksAllowed(nestable_tasks_allowed);
+  base::MessageLoopForUI::ScopedNestableTaskAllower allow_nested(loop);
 
-  // DefaultAcceleratorDispatcher dispatcher(nested_dispatcher,
-  //                                         associated_window);
   base::RunLoop run_loop(nested_dispatcher);
   run_loop.Run();
-  loop->SetNestableTasksAllowed(did_allow_task_nesting);
 }
 
 }  // namespace views