Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / events / BUILD.gn
blob208cc18317e5480bdab6ec0fe35d2b21719dac46
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("dom4_keycode_converter") {
9   sources = [
10     "keycodes/dom3/dom_code.h",
11     "keycodes/dom3/dom_key.h",
12     "keycodes/dom3/dom_key_data.h",
13     "keycodes/dom4/keycode_converter.cc",
14     "keycodes/dom4/keycode_converter.h",
15     "keycodes/dom4/keycode_converter_data.h",
16   ]
18   deps = [
19     "//base",
20   ]
23 component("events_base") {
24   sources = [
25     "android/scroller.cc",
26     "android/scroller.h",
27     "event_constants.h",
28     "event_switches.cc",
29     "event_switches.h",
30     "events_base_export.h",
31     "gesture_curve.h",
32     "gesture_event_details.cc",
33     "gesture_event_details.h",
34     "gestures/fling_curve.cc",
35     "gestures/fling_curve.h",
36     "keycodes/dom_us_layout_data.h",
37     "keycodes/keyboard_code_conversion.cc",
38     "keycodes/keyboard_code_conversion.h",
39     "keycodes/keyboard_code_conversion_android.cc",
40     "keycodes/keyboard_code_conversion_android.h",
41     "keycodes/keyboard_code_conversion_mac.h",
42     "keycodes/keyboard_code_conversion_mac.mm",
43     "keycodes/keyboard_code_conversion_win.cc",
44     "keycodes/keyboard_code_conversion_win.h",
45     "keycodes/keyboard_codes.h",
46     "latency_info.cc",
47     "latency_info.h",
48   ]
50   defines = [ "EVENTS_BASE_IMPLEMENTATION" ]
52   deps = [
53     ":dom4_keycode_converter",
54     "//base/third_party/dynamic_annotations",
55     "//skia",
56   ]
58   public_deps = [
59     "//base",
60     "//ui/events/platform",
61     "//ui/gfx",
62     "//ui/gfx/geometry",
63   ]
65   if (use_x11) {
66     configs += [ "//build/config/linux:x11" ]
68     sources += [
69       "keycodes/keyboard_code_conversion_x.cc",
70       "keycodes/keyboard_code_conversion_x.h",
71       "x/keysym_to_unicode.cc",
72       "x/keysym_to_unicode.h",
73     ]
75     deps += [ "//ui/gfx/x" ]
76   }
79 component("events") {
80   sources = [
81     "cocoa/cocoa_event_utils.h",
82     "cocoa/cocoa_event_utils.mm",
83     "cocoa/events_mac.mm",
84     "event.cc",
85     "event.h",
86     "event_dispatcher.cc",
87     "event_dispatcher.h",
88     "event_handler.cc",
89     "event_handler.h",
90     "event_processor.cc",
91     "event_processor.h",
92     "event_rewriter.h",
93     "event_source.cc",
94     "event_source.h",
95     "event_target.cc",
96     "event_target.h",
97     "event_target_iterator.h",
98     "event_targeter.cc",
99     "event_targeter.h",
100     "event_utils.cc",
101     "event_utils.h",
102     "events_export.h",
103     "events_stub.cc",
104     "gestures/gesture_recognizer_impl_mac.cc",
105     "gestures/gesture_types.h",
106     "null_event_targeter.cc",
107     "null_event_targeter.h",
108     "win/events_win.cc",
109   ]
111   defines = [ "EVENTS_IMPLEMENTATION" ]
113   public_deps = [
114     ":events_base",
115   ]
116   deps = [
117     ":dom4_keycode_converter",
118     ":gesture_detection",
119     "//base/third_party/dynamic_annotations",
120     "//skia",
121     "//ui/gfx",
122     "//ui/gfx/geometry",
123   ]
125   if (use_x11) {
126     sources += [ "x/events_x.cc" ]
127     configs += [
128       "//build/config/linux:glib",
129       "//build/config/linux:x11",
130     ]
131     deps += [
132       "//ui/events/devices",
133       "//ui/gfx/x",
134     ]
135   }
137   if (!is_chromeos && is_linux) {
138     sources += [
139       "linux/text_edit_command_auralinux.cc",
140       "linux/text_edit_command_auralinux.h",
141       "linux/text_edit_key_bindings_delegate_auralinux.cc",
142       "linux/text_edit_key_bindings_delegate_auralinux.h",
143     ]
144   }
146   if (use_ozone) {
147     sources += [ "ozone/events_ozone.cc" ]
148     deps += [ "//ui/events/ozone:events_ozone_layout" ]
149   }
151   if (use_aura) {
152     sources += [
153       "gestures/gesture_provider_aura.cc",
154       "gestures/gesture_provider_aura.h",
155       "gestures/gesture_recognizer.h",
156       "gestures/gesture_recognizer_impl.cc",
157       "gestures/gesture_recognizer_impl.h",
158       "gestures/motion_event_aura.cc",
159       "gestures/motion_event_aura.h",
160     ]
161   }
163   if (is_win || is_mac || use_x11 || use_ozone) {
164     sources -= [ "events_stub.cc" ]
165   }
168 component("gesture_detection") {
169   sources = [
170     "gesture_detection/bitset_32.h",
171     "gesture_detection/filtered_gesture_provider.cc",
172     "gesture_detection/filtered_gesture_provider.h",
173     "gesture_detection/gesture_configuration.cc",
174     "gesture_detection/gesture_configuration.h",
175     "gesture_detection/gesture_detection_export.h",
176     "gesture_detection/gesture_detector.cc",
177     "gesture_detection/gesture_detector.h",
178     "gesture_detection/gesture_event_data.cc",
179     "gesture_detection/gesture_event_data.h",
180     "gesture_detection/gesture_event_data_packet.cc",
181     "gesture_detection/gesture_event_data_packet.h",
182     "gesture_detection/gesture_listeners.cc",
183     "gesture_detection/gesture_listeners.h",
184     "gesture_detection/gesture_provider.cc",
185     "gesture_detection/gesture_provider.h",
186     "gesture_detection/gesture_provider_config_helper.cc",
187     "gesture_detection/gesture_provider_config_helper.h",
188     "gesture_detection/gesture_touch_uma_histogram.cc",
189     "gesture_detection/gesture_touch_uma_histogram.h",
190     "gesture_detection/motion_event.cc",
191     "gesture_detection/motion_event.h",
192     "gesture_detection/motion_event_buffer.cc",
193     "gesture_detection/motion_event_buffer.h",
194     "gesture_detection/motion_event_generic.cc",
195     "gesture_detection/motion_event_generic.h",
196     "gesture_detection/scale_gesture_detector.cc",
197     "gesture_detection/scale_gesture_detector.h",
198     "gesture_detection/scale_gesture_listeners.cc",
199     "gesture_detection/scale_gesture_listeners.h",
200     "gesture_detection/snap_scroll_controller.cc",
201     "gesture_detection/snap_scroll_controller.h",
202     "gesture_detection/touch_disposition_gesture_filter.cc",
203     "gesture_detection/touch_disposition_gesture_filter.h",
204     "gesture_detection/velocity_tracker.cc",
205     "gesture_detection/velocity_tracker.h",
206     "gesture_detection/velocity_tracker_state.cc",
207     "gesture_detection/velocity_tracker_state.h",
208   ]
210   deps = [
211     ":events_base",
212     "//base",
213     "//base/third_party/dynamic_annotations",
214     "//ui/gfx",
215     "//ui/gfx/geometry",
216   ]
218   defines = [ "GESTURE_DETECTION_IMPLEMENTATION" ]
220   if (is_android) {
221     sources += [ "gesture_detection/gesture_configuration_android.cc" ]
222   } else if (use_aura) {
223     sources += [ "gesture_detection/gesture_configuration_aura.cc" ]
224   } else {
225     sources += [ "gesture_detection/gesture_configuration_default.cc" ]
226   }
229 source_set("test_support") {
230   sources = [
231     "test/cocoa_test_event_utils.h",
232     "test/cocoa_test_event_utils.mm",
233     "test/event_generator.cc",
234     "test/event_generator.h",
235     "test/events_test_utils.cc",
236     "test/events_test_utils.h",
237     "test/motion_event_test_utils.cc",
238     "test/motion_event_test_utils.h",
239     "test/platform_event_waiter.cc",
240     "test/platform_event_waiter.h",
241     "test/test_event_handler.cc",
242     "test/test_event_handler.h",
243     "test/test_event_processor.cc",
244     "test/test_event_processor.h",
245     "test/test_event_target.cc",
246     "test/test_event_target.h",
247   ]
249   public_deps = [
250     ":events",
251     ":events_base",
252     ":gesture_detection",
253   ]
254   deps = [
255     "//base",
256     "//skia",
257     "//ui/events/platform",
258     "//ui/gfx/geometry",
259   ]
261   if (is_ios) {
262     sources -= [
263       "test/cocoa_test_event_utils.h",
264       "test/cocoa_test_event_utils.mm",
265     ]
266   }
268   if (use_x11) {
269     sources += [
270       "test/events_test_utils_x11.cc",
271       "test/events_test_utils_x11.h",
272     ]
273     deps += [
274       "//ui/events/devices",
275       "//ui/gfx/x",
276     ]
277   }
280 test("events_unittests") {
281   sources = [
282     "android/scroller_unittest.cc",
283     "cocoa/events_mac_unittest.mm",
284     "devices/x11/device_data_manager_x11_unittest.cc",
285     "event_dispatcher_unittest.cc",
286     "event_processor_unittest.cc",
287     "event_rewriter_unittest.cc",
288     "event_unittest.cc",
289     "gesture_detection/bitset_32_unittest.cc",
290     "gesture_detection/filtered_gesture_provider_unittest.cc",
291     "gesture_detection/gesture_event_data_packet_unittest.cc",
292     "gesture_detection/gesture_provider_unittest.cc",
293     "gesture_detection/motion_event_buffer_unittest.cc",
294     "gesture_detection/motion_event_generic_unittest.cc",
295     "gesture_detection/snap_scroll_controller_unittest.cc",
296     "gesture_detection/touch_disposition_gesture_filter_unittest.cc",
297     "gesture_detection/velocity_tracker_unittest.cc",
298     "gestures/blink/web_gesture_curve_impl_unittest.cc",
299     "gestures/fling_curve_unittest.cc",
300     "keycodes/dom4/keycode_converter_unittest.cc",
301     "keycodes/keyboard_code_conversion_unittest.cc",
302     "latency_info_unittest.cc",
303     "platform/platform_event_source_unittest.cc",
304     "x/events_x_unittest.cc",
305   ]
307   deps = [
308     ":dom4_keycode_converter",
309     ":events",
310     ":events_base",
311     ":gesture_detection",
312     ":test_support",
313     "//base",
314     "//base/test:run_all_unittests",
315     "//skia",
316     "//testing/gtest",
317     "//third_party/WebKit/public:blink_headers",
318     "//ui/events/devices",
319     "//ui/events/gestures/blink",
320     "//ui/events/platform",
321     "//ui/gfx:test_support",
322   ]
324   include_dirs = [ "//testing/gmock/include" ]
326   if (use_x11) {
327     configs += [ "//build/config/linux:x11" ]
328     deps += [ "//ui/gfx/x" ]
329   } else {
330     sources -= [
331       "devices/x11/device_data_manager_x11_unittest.cc",
332       "x/events_x_unittest.cc",
333     ]
334   }
336   if (use_ozone) {
337     sources += [
338       "ozone/chromeos/cursor_controller_unittest.cc",
339       "ozone/evdev/event_converter_evdev_impl_unittest.cc",
340       "ozone/evdev/event_converter_test_util.cc",
341       "ozone/evdev/event_device_info_unittest.cc",
342       "ozone/evdev/event_device_test_util.cc",
343       "ozone/evdev/input_injector_evdev_unittest.cc",
344       "ozone/evdev/tablet_event_converter_evdev_unittest.cc",
345       "ozone/evdev/touch_event_converter_evdev_unittest.cc",
346       "ozone/evdev/touch_noise/touch_noise_finder_unittest.cc",
347       "ozone/layout/xkb/xkb_keyboard_layout_engine_unittest.cc",
348     ]
349     deps += [
350       "//ui/events/ozone:events_ozone",
351       "//ui/events/ozone:events_ozone_evdev",
352       "//ui/events/ozone:events_ozone_layout",
353     ]
354   }
356   if (use_aura) {
357     sources += [ "gestures/gesture_provider_aura_unittest.cc" ]
358   }
361 if (is_nacl) {
362   source_set("latency_info") {
363     sources = [
364       "ipc/latency_info_param_traits.cc",
365       "ipc/latency_info_param_traits.h",
366       "latency_info.cc",
367       "latency_info.h",
368     ]
369   }