OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/widget/desktop_aura/desktop_dispatcher_client.h" | 5 #include "ui/views/widget/desktop_aura/desktop_dispatcher_client.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 | 8 |
9 namespace views { | 9 namespace views { |
10 | 10 |
11 DesktopDispatcherClient::DesktopDispatcherClient() {} | 11 DesktopDispatcherClient::DesktopDispatcherClient() {} |
12 | 12 |
13 DesktopDispatcherClient::~DesktopDispatcherClient() {} | 13 DesktopDispatcherClient::~DesktopDispatcherClient() {} |
14 | 14 |
15 void DesktopDispatcherClient::RunWithDispatcher( | 15 void DesktopDispatcherClient::RunWithDispatcher( |
16 base::MessageLoop::Dispatcher* nested_dispatcher, | 16 base::MessagePumpDispatcher* nested_dispatcher, |
17 aura::Window* associated_window, | 17 aura::Window* associated_window, |
18 bool nestable_tasks_allowed) { | 18 bool nestable_tasks_allowed) { |
19 // TODO(erg): This class has been copypastad from | 19 // TODO(erg): This class has been copypastad from |
20 // ash/accelerators/nested_dispatcher_controller.cc. I have left my changes | 20 // ash/accelerators/nested_dispatcher_controller.cc. I have left my changes |
21 // commented out because I don't entirely understand the implications of the | 21 // commented out because I don't entirely understand the implications of the |
22 // change. | 22 // change. |
23 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); | 23 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); |
24 bool did_allow_task_nesting = loop->NestableTasksAllowed(); | 24 bool did_allow_task_nesting = loop->NestableTasksAllowed(); |
25 loop->SetNestableTasksAllowed(nestable_tasks_allowed); | 25 loop->SetNestableTasksAllowed(nestable_tasks_allowed); |
26 | 26 |
27 // DefaultAcceleratorDispatcher dispatcher(nested_dispatcher, | 27 // DefaultAcceleratorDispatcher dispatcher(nested_dispatcher, |
28 // associated_window); | 28 // associated_window); |
29 base::RunLoop run_loop(nested_dispatcher); | 29 base::RunLoop run_loop(nested_dispatcher); |
30 run_loop.Run(); | 30 run_loop.Run(); |
31 loop->SetNestableTasksAllowed(did_allow_task_nesting); | 31 loop->SetNestableTasksAllowed(did_allow_task_nesting); |
32 } | 32 } |
33 | 33 |
34 } // namespace views | 34 } // namespace views |
OLD | NEW |