OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/accelerators/nested_dispatcher_controller.h" |
| 6 |
| 7 #include "ash/accelerators/accelerator_dispatcher.h" |
| 8 |
| 9 namespace ash { |
| 10 |
| 11 NestedDispatcherController::NestedDispatcherController() { |
| 12 aura::client::SetDispatcherClient(this); |
| 13 } |
| 14 |
| 15 void NestedDispatcherController::RunWithDispatcher( |
| 16 MessageLoop::Dispatcher* nested_dispatcher, |
| 17 bool nestable_tasks_allowed) { |
| 18 MessageLoopForUI* loop = MessageLoopForUI::current(); |
| 19 bool did_allow_task_nesting = loop->NestableTasksAllowed(); |
| 20 loop->SetNestableTasksAllowed(nestable_tasks_allowed); |
| 21 |
| 22 AcceleratorDispatcher dispatcher(nested_dispatcher); |
| 23 |
| 24 loop->RunWithDispatcher(&dispatcher); |
| 25 loop->SetNestableTasksAllowed(did_allow_task_nesting); |
| 26 } |
| 27 |
| 28 } // namespace ash |
OLD | NEW |