diff options
Diffstat (limited to 'chromium/ui/views/widget/desktop_aura/desktop_dispatcher_client.cc')
-rw-r--r-- | chromium/ui/views/widget/desktop_aura/desktop_dispatcher_client.cc | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/chromium/ui/views/widget/desktop_aura/desktop_dispatcher_client.cc b/chromium/ui/views/widget/desktop_aura/desktop_dispatcher_client.cc index bd4ba0229aa..4b8ca2db08d 100644 --- a/chromium/ui/views/widget/desktop_aura/desktop_dispatcher_client.cc +++ b/chromium/ui/views/widget/desktop_aura/desktop_dispatcher_client.cc @@ -4,31 +4,30 @@ #include "ui/views/widget/desktop_aura/desktop_dispatcher_client.h" +#include "base/auto_reset.h" +#include "base/bind.h" #include "base/run_loop.h" namespace views { -DesktopDispatcherClient::DesktopDispatcherClient() {} - -DesktopDispatcherClient::~DesktopDispatcherClient() {} +DesktopDispatcherClient::DesktopDispatcherClient() { +} -void DesktopDispatcherClient::RunWithDispatcher( - base::MessageLoop::Dispatcher* nested_dispatcher, - aura::Window* associated_window, - bool nestable_tasks_allowed) { - // 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); +DesktopDispatcherClient::~DesktopDispatcherClient() { +} - // DefaultAcceleratorDispatcher dispatcher(nested_dispatcher, - // associated_window); - base::RunLoop run_loop(nested_dispatcher); - run_loop.Run(); - loop->SetNestableTasksAllowed(did_allow_task_nesting); +void DesktopDispatcherClient::PrepareNestedLoopClosures( + base::MessagePumpDispatcher* dispatcher, + base::Closure* run_closure, + base::Closure* quit_closure) { +#if defined(OS_WIN) + scoped_ptr<base::RunLoop> run_loop(new base::RunLoop(dispatcher)); +#else + scoped_ptr<base::RunLoop> run_loop(new base::RunLoop()); +#endif + *quit_closure = run_loop->QuitClosure(); + *run_closure = + base::Bind(&base::RunLoop::Run, base::Owned(run_loop.release())); } } // namespace views |