OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 "base/bind.h" | |
6 #include "base/logging.h" | |
7 #include "ui/aura/test/ui_controls_factory_aura.h" | |
8 #include "ui/aura/window_tree_host.h" | |
9 #include "ui/base/test/ui_controls_aura.h" | |
10 | |
11 namespace aura { | |
12 namespace test { | |
13 namespace { | |
14 | |
15 class UIControlsOzone : public ui_controls::UIControlsAura { | |
16 public: | |
17 UIControlsOzone(WindowTreeHost* host) : host_(host) {} | |
sky
2014/07/09 20:17:49
explicit
| |
18 | |
19 virtual bool SendKeyPress(gfx::NativeWindow window, | |
20 ui::KeyboardCode key, | |
21 bool control, | |
22 bool shift, | |
23 bool alt, | |
24 bool command) OVERRIDE { | |
25 return SendKeyPressNotifyWhenDone( | |
26 window, key, control, shift, alt, command, base::Closure()); | |
27 } | |
28 virtual bool SendKeyPressNotifyWhenDone( | |
29 gfx::NativeWindow window, | |
30 ui::KeyboardCode key, | |
31 bool control, | |
32 bool shift, | |
33 bool alt, | |
34 bool command, | |
35 const base::Closure& closure) OVERRIDE { | |
36 DCHECK(!command); // No command key on Aura | |
37 NOTIMPLEMENTED(); | |
38 RunClosureAfterAllPendingUIEvents(closure); | |
39 return true; | |
40 } | |
41 | |
42 virtual bool SendMouseMove(long screen_x, long screen_y) OVERRIDE { | |
43 return SendMouseMoveNotifyWhenDone(screen_x, screen_y, base::Closure()); | |
44 } | |
45 virtual bool SendMouseMoveNotifyWhenDone( | |
46 long screen_x, | |
47 long screen_y, | |
48 const base::Closure& closure) OVERRIDE { | |
49 NOTIMPLEMENTED(); | |
50 RunClosureAfterAllPendingUIEvents(closure); | |
51 return true; | |
52 } | |
53 virtual bool SendMouseEvents(ui_controls::MouseButton type, | |
54 int state) OVERRIDE { | |
55 return SendMouseEventsNotifyWhenDone(type, state, base::Closure()); | |
56 } | |
57 virtual bool SendMouseEventsNotifyWhenDone( | |
58 ui_controls::MouseButton type, | |
59 int state, | |
60 const base::Closure& closure) OVERRIDE { | |
61 NOTIMPLEMENTED(); | |
62 RunClosureAfterAllPendingUIEvents(closure); | |
63 return true; | |
64 } | |
65 virtual bool SendMouseClick(ui_controls::MouseButton type) OVERRIDE { | |
66 return SendMouseEvents(type, ui_controls::UP | ui_controls::DOWN); | |
67 } | |
68 virtual void RunClosureAfterAllPendingUIEvents( | |
69 const base::Closure& closure) OVERRIDE { | |
70 if (!closure.is_null()) | |
71 closure.Run(); | |
72 } | |
73 | |
74 private: | |
75 WindowTreeHost* host_; | |
76 | |
77 DISALLOW_COPY_AND_ASSIGN(UIControlsOzone); | |
78 }; | |
79 | |
80 } // namespace | |
81 | |
82 ui_controls::UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { | |
83 return new UIControlsOzone(host); | |
84 } | |
85 | |
86 } // namespace test | |
87 } // namespace aura | |
OLD | NEW |