Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / ash / accelerators / nested_dispatcher_controller.cc
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 #include "ash/shell.h"
9 #include "base/run_loop.h"
10
11 namespace ash {
12
13 NestedDispatcherController::NestedDispatcherController() {
14 }
15
16 NestedDispatcherController::~NestedDispatcherController() {
17 }
18
19 void NestedDispatcherController::RunWithDispatcher(
20     base::MessagePumpDispatcher* nested_dispatcher,
21     aura::Window* associated_window) {
22   base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
23   base::MessageLoopForUI::ScopedNestableTaskAllower allow_nested(loop);
24
25   AcceleratorDispatcher dispatcher(nested_dispatcher, associated_window);
26
27   // TODO(jbates) crbug.com/134753 Find quitters of this RunLoop and have them
28   //              use run_loop.QuitClosure().
29   base::RunLoop run_loop(&dispatcher);
30   run_loop.Run();
31 }
32
33 }  // namespace ash