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 "ui/events/test/events_test_utils_x11.h" | 5 #include "ui/events/test/events_test_utils_x11.h" |
6 | 6 |
7 #include <X11/extensions/XI2.h> | 7 #include <X11/extensions/XI2.h> |
8 #include <X11/keysym.h> | 8 #include <X11/keysym.h> |
9 #include <X11/X.h> | 9 #include <X11/X.h> |
10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
11 | 11 |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "ui/events/devices/x11/touch_factory_x11.h" |
13 #include "ui/events/event_constants.h" | 14 #include "ui/events/event_constants.h" |
14 #include "ui/events/event_utils.h" | 15 #include "ui/events/event_utils.h" |
15 #include "ui/events/keycodes/keyboard_code_conversion_x.h" | 16 #include "ui/events/keycodes/keyboard_code_conversion_x.h" |
16 #include "ui/events/x/touch_factory_x11.h" | |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // Converts ui::EventType to state for X*Events. | 20 // Converts ui::EventType to state for X*Events. |
21 unsigned int XEventState(int flags) { | 21 unsigned int XEventState(int flags) { |
22 return | 22 return |
23 ((flags & ui::EF_SHIFT_DOWN) ? ShiftMask : 0) | | 23 ((flags & ui::EF_SHIFT_DOWN) ? ShiftMask : 0) | |
24 ((flags & ui::EF_CONTROL_DOWN) ? ControlMask : 0) | | 24 ((flags & ui::EF_CONTROL_DOWN) ? ControlMask : 0) | |
25 ((flags & ui::EF_ALT_DOWN) ? Mod1Mask : 0) | | 25 ((flags & ui::EF_ALT_DOWN) ? Mod1Mask : 0) | |
26 ((flags & ui::EF_CAPS_LOCK_DOWN) ? LockMask : 0) | | 26 ((flags & ui::EF_CAPS_LOCK_DOWN) ? LockMask : 0) | |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 manager->SetDeviceListForTest(std::vector<unsigned int>(), device_list); | 295 manager->SetDeviceListForTest(std::vector<unsigned int>(), device_list); |
296 } | 296 } |
297 | 297 |
298 void SetUpTouchDevicesForTest(const std::vector<unsigned int>& devices) { | 298 void SetUpTouchDevicesForTest(const std::vector<unsigned int>& devices) { |
299 TouchFactory::GetInstance()->SetTouchDeviceForTest(devices); | 299 TouchFactory::GetInstance()->SetTouchDeviceForTest(devices); |
300 ui::DeviceDataManagerX11* manager = ui::DeviceDataManagerX11::GetInstance(); | 300 ui::DeviceDataManagerX11* manager = ui::DeviceDataManagerX11::GetInstance(); |
301 manager->SetDeviceListForTest(devices, std::vector<unsigned int>()); | 301 manager->SetDeviceListForTest(devices, std::vector<unsigned int>()); |
302 } | 302 } |
303 | 303 |
304 } // namespace ui | 304 } // namespace ui |
OLD | NEW |