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