OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "ui/events/event_constants.h" | 6 #include "ui/events/event_constants.h" |
7 #include "ui/events/events_export.h" | 7 #include "ui/events/events_export.h" |
8 #include "ui/events/keycodes/keyboard_codes.h" | 8 #include "ui/events/keycodes/keyboard_codes.h" |
9 #include "ui/events/x/device_data_manager.h" | 9 #include "ui/events/x/device_data_manager.h" |
10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // the XEvent in a ScopedXI2Event, as XEvent is purely a struct and simply | 59 // the XEvent in a ScopedXI2Event, as XEvent is purely a struct and simply |
60 // deleting it will result in dangling pointers. | 60 // deleting it will result in dangling pointers. |
61 EVENTS_EXPORT XEvent* CreateScrollEventForTest( | 61 EVENTS_EXPORT XEvent* CreateScrollEventForTest( |
62 int deviceid, | 62 int deviceid, |
63 int x_offset, | 63 int x_offset, |
64 int y_offset, | 64 int y_offset, |
65 int x_offset_ordinal, | 65 int x_offset_ordinal, |
66 int y_offset_ordinal, | 66 int y_offset_ordinal, |
67 int finger_count); | 67 int finger_count); |
68 | 68 |
| 69 // Creates the native XInput2 based XEvent for an aura scroll event of type |
| 70 // ET_SCROLL_FLING_START or ET_SCROLL_FLING_CANCEL. The caller is responsible |
| 71 // for the ownership of the returned XEvent. |
| 72 EVENTS_EXPORT XEvent* CreateFlingEventForTest( |
| 73 int deviceid, |
| 74 int x_velocity, |
| 75 int y_velocity, |
| 76 int x_velocity_ordinal, |
| 77 int y_velocity_ordinal, |
| 78 bool is_cancel); |
| 79 |
69 // Initializes a test touchpad device for scroll events. | 80 // Initializes a test touchpad device for scroll events. |
70 EVENTS_EXPORT void SetUpScrollDeviceForTest(unsigned int deviceid); | 81 EVENTS_EXPORT void SetUpScrollDeviceForTest(unsigned int deviceid); |
71 | 82 |
72 #if defined(USE_XI2_MT) | 83 #if defined(USE_XI2_MT) |
73 | 84 |
74 EVENTS_EXPORT XEvent* CreateTouchEventForTest( | 85 EVENTS_EXPORT XEvent* CreateTouchEventForTest( |
75 int deviceid, | 86 int deviceid, |
76 int evtype, | 87 int evtype, |
77 int tracking_id, | 88 int tracking_id, |
78 const gfx::Point& location, | 89 const gfx::Point& location, |
79 const std::vector<Valuator>& valuators); | 90 const std::vector<Valuator>& valuators); |
80 | 91 |
81 EVENTS_EXPORT void SetupTouchDevicesForTest( | 92 EVENTS_EXPORT void SetupTouchDevicesForTest( |
82 const std::vector<unsigned int>& devices); | 93 const std::vector<unsigned int>& devices); |
83 | 94 |
84 #endif | 95 #endif |
85 | 96 |
86 } // namespace ui | 97 } // namespace ui |
OLD | NEW |