OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/location.h" | 6 #include "base/location.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
11 #include "ui/aura/client/screen_position_client.h" | 11 #include "ui/aura/client/screen_position_client.h" |
12 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
13 #include "ui/aura/test/aura_test_utils.h" | 13 #include "ui/aura/test/aura_test_utils.h" |
14 #include "ui/aura/test/ui_controls_factory_aura.h" | 14 #include "ui/aura/test/ui_controls_factory_aura.h" |
15 #include "ui/aura/window_tree_host.h" | 15 #include "ui/aura/window_tree_host.h" |
16 #include "ui/base/test/ui_controls_aura.h" | 16 #include "ui/base/test/ui_controls_aura.h" |
17 #include "ui/events/event_utils.h" | 17 #include "ui/events/event_utils.h" |
18 #include "ui/events/test/events_test_utils.h" | 18 #include "ui/events/test/events_test_utils.h" |
19 | 19 |
20 namespace aura { | 20 namespace aura { |
21 namespace test { | 21 namespace test { |
22 namespace { | 22 namespace { |
23 | 23 |
| 24 // Mask of the mouse buttons currently down. |
| 25 unsigned button_down_mask_ = 0; |
| 26 |
24 class UIControlsOzone : public ui_controls::UIControlsAura { | 27 class UIControlsOzone : public ui_controls::UIControlsAura { |
25 public: | 28 public: |
26 UIControlsOzone(WindowTreeHost* host) : host_(host) {} | 29 UIControlsOzone(WindowTreeHost* host) : host_(host) {} |
27 | 30 |
28 bool SendKeyPress(gfx::NativeWindow window, | 31 bool SendKeyPress(gfx::NativeWindow window, |
29 ui::KeyboardCode key, | 32 ui::KeyboardCode key, |
30 bool control, | 33 bool control, |
31 bool shift, | 34 bool shift, |
32 bool alt, | 35 bool alt, |
33 bool command) override { | 36 bool command) override { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 changed_button_flags); | 225 changed_button_flags); |
223 | 226 |
224 // This hack is necessary to set the repeat count for clicks. | 227 // This hack is necessary to set the repeat count for clicks. |
225 ui::MouseEvent mouse_event2(&mouse_event); | 228 ui::MouseEvent mouse_event2(&mouse_event); |
226 | 229 |
227 SendEventToSink(&mouse_event2); | 230 SendEventToSink(&mouse_event2); |
228 } | 231 } |
229 | 232 |
230 WindowTreeHost* host_; | 233 WindowTreeHost* host_; |
231 | 234 |
232 // Mask of the mouse buttons currently down. | |
233 unsigned button_down_mask_ = 0; | |
234 | |
235 DISALLOW_COPY_AND_ASSIGN(UIControlsOzone); | 235 DISALLOW_COPY_AND_ASSIGN(UIControlsOzone); |
236 }; | 236 }; |
237 | 237 |
238 } // namespace | 238 } // namespace |
239 | 239 |
240 ui_controls::UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { | 240 ui_controls::UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { |
241 return new UIControlsOzone(host); | 241 return new UIControlsOzone(host); |
242 } | 242 } |
243 | 243 |
244 } // namespace test | 244 } // namespace test |
245 } // namespace aura | 245 } // namespace aura |
OLD | NEW |