OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" |
9 #include "ui/aura/test/ui_controls_factory_aura.h" | 10 #include "ui/aura/test/ui_controls_factory_aura.h" |
10 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
11 #include "ui/aura/window_tree_host.h" | 12 #include "ui/aura/window_tree_host.h" |
12 #include "ui/base/test/ui_controls_aura.h" | 13 #include "ui/base/test/ui_controls_aura.h" |
13 #include "ui/base/test/ui_controls_internal_win.h" | 14 #include "ui/base/test/ui_controls_internal_win.h" |
14 | 15 |
15 namespace aura { | 16 namespace aura { |
16 namespace test { | 17 namespace test { |
17 | 18 |
18 namespace { | 19 namespace { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 int state, | 71 int state, |
71 const base::Closure& task) override { | 72 const base::Closure& task) override { |
72 return SendMouseEventsImpl(type, state, task); | 73 return SendMouseEventsImpl(type, state, task); |
73 } | 74 } |
74 bool SendMouseClick(MouseButton type) override { | 75 bool SendMouseClick(MouseButton type) override { |
75 return SendMouseEvents(type, UP | DOWN); | 76 return SendMouseEvents(type, UP | DOWN); |
76 } | 77 } |
77 void RunClosureAfterAllPendingUIEvents( | 78 void RunClosureAfterAllPendingUIEvents( |
78 const base::Closure& closure) override { | 79 const base::Closure& closure) override { |
79 // On windows, posting UI events is synchronous so just post the closure. | 80 // On windows, posting UI events is synchronous so just post the closure. |
80 base::MessageLoopForUI::current()->task_runner()->PostTask(FROM_HERE, | 81 DCHECK(base::MessageLoopForUI::IsCurrent()); |
81 closure); | 82 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, closure); |
82 } | 83 } |
83 | 84 |
84 private: | 85 private: |
85 DISALLOW_COPY_AND_ASSIGN(UIControlsWin); | 86 DISALLOW_COPY_AND_ASSIGN(UIControlsWin); |
86 }; | 87 }; |
87 | 88 |
88 } // namespace | 89 } // namespace |
89 | 90 |
90 UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { | 91 UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { |
91 return new UIControlsWin(); | 92 return new UIControlsWin(); |
92 } | 93 } |
93 | 94 |
94 } // namespace test | 95 } // namespace test |
95 } // namespace aura | 96 } // namespace aura |
OLD | NEW |