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.
5 import("//build/config/ui.gni")
6 import("//testing/test.gni")
8 static_library("dom_keycode_converter") {
10 "keycodes/dom/dom_code.h",
11 "keycodes/dom/dom_key.h",
12 "keycodes/dom/dom_key_data.inc",
13 "keycodes/dom/keycode_converter.cc",
14 "keycodes/dom/keycode_converter.h",
15 "keycodes/dom/keycode_converter_data.inc",
23 component("events_base") {
25 "android/scroller.cc",
27 "base_event_utils.cc",
32 "events_base_export.h",
34 "gesture_event_details.cc",
35 "gesture_event_details.h",
36 "gestures/fling_curve.cc",
37 "gestures/fling_curve.h",
38 "keycodes/dom_us_layout_data.h",
39 "keycodes/keyboard_code_conversion.cc",
40 "keycodes/keyboard_code_conversion.h",
41 "keycodes/keyboard_code_conversion_android.cc",
42 "keycodes/keyboard_code_conversion_android.h",
43 "keycodes/keyboard_code_conversion_mac.h",
44 "keycodes/keyboard_code_conversion_mac.mm",
45 "keycodes/keyboard_code_conversion_win.cc",
46 "keycodes/keyboard_code_conversion_win.h",
47 "keycodes/keyboard_codes.h",
52 defines = [ "EVENTS_BASE_IMPLEMENTATION" ]
55 ":dom_keycode_converter",
56 "//base/third_party/dynamic_annotations",
62 "//ui/events/platform",
68 configs += [ "//build/config/linux:x11" ]
71 "keycodes/keyboard_code_conversion_x.cc",
72 "keycodes/keyboard_code_conversion_x.h",
73 "x/keysym_to_unicode.cc",
74 "x/keysym_to_unicode.h",
77 deps += [ "//ui/gfx/x" ]
80 if (use_x11 || use_ozone) {
82 "keycodes/keyboard_code_conversion_xkb.cc",
83 "keycodes/keyboard_code_conversion_xkb.h",
84 "keycodes/xkb_keysym.h",
91 "cocoa/cocoa_event_utils.h",
92 "cocoa/cocoa_event_utils.mm",
93 "cocoa/events_mac.mm",
96 "event_dispatcher.cc",
100 "event_processor.cc",
107 "event_target_iterator.h",
113 "gestures/gesture_recognizer_impl_mac.cc",
114 "gestures/gesture_types.h",
115 "null_event_targeter.cc",
116 "null_event_targeter.h",
120 defines = [ "EVENTS_IMPLEMENTATION" ]
126 ":dom_keycode_converter",
127 ":gesture_detection",
128 "//base/third_party/dynamic_annotations",
135 sources += [ "x/events_x.cc" ]
137 "//build/config/linux:glib",
138 "//build/config/linux:x11",
141 "//ui/events/devices",
146 if (!is_chromeos && is_linux) {
148 "linux/text_edit_command_auralinux.cc",
149 "linux/text_edit_command_auralinux.h",
150 "linux/text_edit_key_bindings_delegate_auralinux.cc",
151 "linux/text_edit_key_bindings_delegate_auralinux.h",
156 sources += [ "ozone/events_ozone.cc" ]
157 deps += [ "//ui/events/ozone:events_ozone_layout" ]
162 "gestures/gesture_provider_aura.cc",
163 "gestures/gesture_provider_aura.h",
164 "gestures/gesture_recognizer.h",
165 "gestures/gesture_recognizer_impl.cc",
166 "gestures/gesture_recognizer_impl.h",
167 "gestures/motion_event_aura.cc",
168 "gestures/motion_event_aura.h",
172 if (is_win || is_mac || use_x11 || use_ozone) {
173 sources -= [ "events_stub.cc" ]
177 component("gesture_detection") {
179 "gesture_detection/bitset_32.h",
180 "gesture_detection/filtered_gesture_provider.cc",
181 "gesture_detection/filtered_gesture_provider.h",
182 "gesture_detection/gesture_configuration.cc",
183 "gesture_detection/gesture_configuration.h",
184 "gesture_detection/gesture_detection_export.h",
185 "gesture_detection/gesture_detector.cc",
186 "gesture_detection/gesture_detector.h",
187 "gesture_detection/gesture_event_data.cc",
188 "gesture_detection/gesture_event_data.h",
189 "gesture_detection/gesture_event_data_packet.cc",
190 "gesture_detection/gesture_event_data_packet.h",
191 "gesture_detection/gesture_listeners.cc",
192 "gesture_detection/gesture_listeners.h",
193 "gesture_detection/gesture_provider.cc",
194 "gesture_detection/gesture_provider.h",
195 "gesture_detection/gesture_provider_config_helper.cc",
196 "gesture_detection/gesture_provider_config_helper.h",
197 "gesture_detection/gesture_touch_uma_histogram.cc",
198 "gesture_detection/gesture_touch_uma_histogram.h",
199 "gesture_detection/motion_event.cc",
200 "gesture_detection/motion_event.h",
201 "gesture_detection/motion_event_buffer.cc",
202 "gesture_detection/motion_event_buffer.h",
203 "gesture_detection/motion_event_generic.cc",
204 "gesture_detection/motion_event_generic.h",
205 "gesture_detection/scale_gesture_detector.cc",
206 "gesture_detection/scale_gesture_detector.h",
207 "gesture_detection/scale_gesture_listeners.cc",
208 "gesture_detection/scale_gesture_listeners.h",
209 "gesture_detection/snap_scroll_controller.cc",
210 "gesture_detection/snap_scroll_controller.h",
211 "gesture_detection/touch_disposition_gesture_filter.cc",
212 "gesture_detection/touch_disposition_gesture_filter.h",
213 "gesture_detection/velocity_tracker.cc",
214 "gesture_detection/velocity_tracker.h",
215 "gesture_detection/velocity_tracker_state.cc",
216 "gesture_detection/velocity_tracker_state.h",
222 "//base/third_party/dynamic_annotations",
227 defines = [ "GESTURE_DETECTION_IMPLEMENTATION" ]
230 sources += [ "gesture_detection/gesture_configuration_android.cc" ]
231 } else if (use_aura) {
232 sources += [ "gesture_detection/gesture_configuration_aura.cc" ]
234 sources += [ "gesture_detection/gesture_configuration_default.cc" ]
238 source_set("test_support") {
240 "test/cocoa_test_event_utils.h",
241 "test/cocoa_test_event_utils.mm",
242 "test/device_data_manager_test_api.h",
243 "test/event_generator.cc",
244 "test/event_generator.h",
245 "test/events_test_utils.cc",
246 "test/events_test_utils.h",
247 "test/motion_event_test_utils.cc",
248 "test/motion_event_test_utils.h",
249 "test/platform_event_waiter.cc",
250 "test/platform_event_waiter.h",
251 "test/test_event_handler.cc",
252 "test/test_event_handler.h",
253 "test/test_event_processor.cc",
254 "test/test_event_processor.h",
255 "test/test_event_target.cc",
256 "test/test_event_target.h",
257 "test/test_event_targeter.cc",
258 "test/test_event_targeter.h",
264 ":gesture_detection",
269 "//ui/events/platform",
275 "test/cocoa_test_event_utils.h",
276 "test/cocoa_test_event_utils.mm",
282 "test/events_test_utils_x11.cc",
283 "test/events_test_utils_x11.h",
286 "//ui/events/devices",
291 if (use_x11 || use_ozone) {
292 sources += [ "test/device_data_manager_test_api_impl.cc" ]
293 deps += [ "//ui/events/devices" ]
295 sources += [ "test/device_data_manager_test_api_stub.cc" ]
299 # TODO(GYP): Delete this after we've converted everything to GN.
300 # The _run targets exist only for compatibility w/ GYP.
301 group("events_unittests_run") {
308 test("events_unittests") {
310 "android/scroller_unittest.cc",
311 "cocoa/events_mac_unittest.mm",
312 "event_dispatcher_unittest.cc",
313 "event_processor_unittest.cc",
314 "event_rewriter_unittest.cc",
316 "gesture_detection/bitset_32_unittest.cc",
317 "gesture_detection/filtered_gesture_provider_unittest.cc",
318 "gesture_detection/gesture_event_data_packet_unittest.cc",
319 "gesture_detection/gesture_provider_unittest.cc",
320 "gesture_detection/motion_event_buffer_unittest.cc",
321 "gesture_detection/motion_event_generic_unittest.cc",
322 "gesture_detection/snap_scroll_controller_unittest.cc",
323 "gesture_detection/touch_disposition_gesture_filter_unittest.cc",
324 "gesture_detection/velocity_tracker_unittest.cc",
325 "gestures/fling_curve_unittest.cc",
326 "ipc/latency_info_param_traits_unittest.cc",
327 "keycodes/dom/keycode_converter_unittest.cc",
328 "keycodes/keyboard_code_conversion_unittest.cc",
329 "latency_info_unittest.cc",
330 "platform/platform_event_source_unittest.cc",
334 ":dom_keycode_converter",
337 ":gesture_detection",
340 "//base/test:run_all_unittests",
341 "//ipc:test_support",
344 "//ui/events/devices",
345 "//ui/events/ipc:events_ipc",
346 "//ui/events/platform",
347 "//ui/gfx:test_support",
351 sources += [ "gestures/blink/web_gesture_curve_impl_unittest.cc" ]
353 "//third_party/WebKit/public:blink_headers",
354 "//ui/events/gestures/blink",
358 data_deps = [ "//third_party/mesa:osmesa" ]
360 include_dirs = [ "//testing/gmock/include" ]
364 "devices/x11/device_data_manager_x11_unittest.cc",
365 "x/events_x_unittest.cc",
367 configs += [ "//build/config/linux:x11" ]
368 deps += [ "//ui/gfx/x" ]
373 "ozone/chromeos/cursor_controller_unittest.cc",
374 "ozone/evdev/event_converter_evdev_impl_unittest.cc",
375 "ozone/evdev/event_converter_test_util.cc",
376 "ozone/evdev/event_device_info_unittest.cc",
377 "ozone/evdev/event_device_test_util.cc",
378 "ozone/evdev/input_injector_evdev_unittest.cc",
379 "ozone/evdev/tablet_event_converter_evdev_unittest.cc",
380 "ozone/evdev/touch_event_converter_evdev_unittest.cc",
381 "ozone/evdev/touch_noise/touch_noise_finder_unittest.cc",
382 "ozone/layout/xkb/xkb_keyboard_layout_engine_unittest.cc",
385 "//ui/events/ozone:events_ozone",
386 "//ui/events/ozone:events_ozone_evdev",
387 "//ui/events/ozone:events_ozone_layout",
392 sources += [ "gestures/gesture_provider_aura_unittest.cc" ]