Chromium Code Reviews| Index: ash/accelerators/nested_dispatcher_controller.cc |
| diff --git a/ash/accelerators/nested_dispatcher_controller.cc b/ash/accelerators/nested_dispatcher_controller.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9183c36ecf0e8194e4708edea15754ac82a265b9 |
| --- /dev/null |
| +++ b/ash/accelerators/nested_dispatcher_controller.cc |
| @@ -0,0 +1,27 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "ash/accelerators/nested_dispatcher_controller.h" |
| + |
| +#include "ash/accelerators/accelerator_dispatcher.h" |
| + |
| +namespace ash { |
| + |
| +NestedDispatcherController::NestedDispatcherController() { |
| + aura::client::SetDispatcherClient(this); |
| +} |
| + |
| +void NestedDispatcherController::RunWithDispatcher( |
| + MessageLoop::Dispatcher* nested_dispatcher, bool nestable_tasks_allowed) { |
|
oshima
2012/01/31 18:19:52
one argument per line. (This style has been banned
|
| + MessageLoopForUI* loop = MessageLoopForUI::current(); |
| + bool did_allow_task_nesting = loop->NestableTasksAllowed(); |
| + loop->SetNestableTasksAllowed(nestable_tasks_allowed); |
| + |
| + AcceleratorDispatcher dispatcher(nested_dispatcher); |
| + |
| + loop->RunWithDispatcher(&dispatcher); |
| + loop->SetNestableTasksAllowed(did_allow_task_nesting); |
| +} |
| + |
| +} // namespace ash |