[Android] memory_inspector: update PRESUBMIT.py to check prebuilts.
[chromium-blink-merge.git] / ui / events / BUILD.gn
blob99372b33ef36c5caa2da80ac481a3d6a45e21daa
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")
7 static_library("dom4_keycode_converter") {
8   sources = [
9     "keycodes/dom4/keycode_converter.cc",
10     "keycodes/dom4/keycode_converter.h",
11     "keycodes/dom4/keycode_converter_data.h",
12   ]
14   deps = [ "//base" ]
17 component("events_base") {
18   sources = [
19     "device_data_manager.cc",
20     "device_data_manager.h",
21     "device_hotplug_event_observer.h",
22     "event_constants.h",
23     "event_switches.cc",
24     "event_switches.h",
25     "events_base_export.h",
26     "gesture_event_details.cc",
27     "gesture_event_details.h",
28     "gestures/gesture_configuration.cc",
29     "gestures/gesture_configuration.h",
30     "keycodes/keyboard_code_conversion.cc",
31     "keycodes/keyboard_code_conversion.h",
32     "keycodes/keyboard_code_conversion_android.cc",
33     "keycodes/keyboard_code_conversion_android.h",
34     "keycodes/keyboard_code_conversion_mac.h",
35     "keycodes/keyboard_code_conversion_mac.mm",
36     "keycodes/keyboard_code_conversion_win.cc",
37     "keycodes/keyboard_code_conversion_win.h",
38     "keycodes/keyboard_codes.h",
39     "latency_info.cc",
40     "latency_info.h",
41     "touchscreen_device.cc",
42     "touchscreen_device.h",
43   ]
45   defines = [ "EVENTS_BASE_IMPLEMENTATION" ]
47   deps = [
48     ":dom4_keycode_converter",
49     "//base",
50     "//base/third_party/dynamic_annotations",
51     "//skia",
52     "//ui/events/platform",
53     "//ui/gfx",
54     "//ui/gfx/geometry",
55   ]
57   forward_dependent_configs_from = [ "//ui/gfx" ]
59   if (use_x11) {
60     configs += [ "//build/config/linux:x11" ]
62     sources += [
63       "keycodes/keyboard_code_conversion_x.cc",
64       "keycodes/keyboard_code_conversion_x.h",
65       "x/device_data_manager_x11.cc",
66       "x/device_data_manager_x11.h",
67       "x/device_list_cache_x.cc",
68       "x/device_list_cache_x.h",
69       "x/hotplug_event_handler_x11.cc",
70       "x/hotplug_event_handler_x11.h",
71       "x/keysym_to_unicode.cc",
72       "x/keysym_to_unicode.h",
73       "x/touch_factory_x11.cc",
74       "x/touch_factory_x11.h",
75     ]
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     "win/events_win.cc",
107     "x/events_x.cc",
108   ]
110   defines = [ "EVENTS_IMPLEMENTATION" ]
112   deps = [
113     ":dom4_keycode_converter",
114     ":events_base",
115     ":gesture_detection",
116     "//base/third_party/dynamic_annotations",
117     "//skia",
118     "//ui/gfx",
119     "//ui/gfx/geometry",
120   ]
122   forward_dependent_configs_from = [ ":events_base" ]
124   if (use_x11) {
125     configs += [
126       "//build/config/linux:glib",
127       "//build/config/linux:x11",
128     ]
129   } else {
130     sources -= [
131       "x/events_x.cc",
132     ]
133   }
135   if (!is_chromeos && is_linux) {
136     sources += [
137       "linux/text_edit_command_auralinux.cc",
138       "linux/text_edit_command_auralinux.h",
139       "linux/text_edit_key_bindings_delegate_auralinux.cc",
140       "linux/text_edit_key_bindings_delegate_auralinux.h",
141     ]
142   }
144   if (use_ozone) {
145     sources += [
146       "ozone/events_ozone.cc",
147     ]
148   }
150   if (use_aura) {
151     sources += [
152       "gestures/gesture_provider_aura.cc",
153       "gestures/gesture_provider_aura.h",
154       "gestures/motion_event_aura.cc",
155       "gestures/motion_event_aura.h",
156       "gestures/gesture_recognizer.h",
157       "gestures/gesture_recognizer_impl.cc",
158       "gestures/gesture_recognizer_impl.h",
159     ]
160   }
162   if (is_win || is_mac || use_x11 || use_ozone) {
163     sources -= [ "events_stub.cc" ]
164   }
167 component("gesture_detection") {
168   sources = [
169     "gesture_detection/bitset_32.h",
170     "gesture_detection/filtered_gesture_provider.cc",
171     "gesture_detection/filtered_gesture_provider.h",
172     "gesture_detection/gesture_detection_export.h",
173     "gesture_detection/gesture_detector.cc",
174     "gesture_detection/gesture_detector.h",
175     "gesture_detection/gesture_event_data.cc",
176     "gesture_detection/gesture_event_data.h",
177     "gesture_detection/gesture_event_data_packet.cc",
178     "gesture_detection/gesture_event_data_packet.h",
179     "gesture_detection/gesture_config_helper.h",
180     "gesture_detection/gesture_provider.cc",
181     "gesture_detection/gesture_provider.h",
182     "gesture_detection/gesture_touch_uma_histogram.cc",
183     "gesture_detection/gesture_touch_uma_histogram.h",
184     "gesture_detection/motion_event.cc",
185     "gesture_detection/motion_event.h",
186     "gesture_detection/motion_event_buffer.cc",
187     "gesture_detection/motion_event_buffer.h",
188     "gesture_detection/motion_event_generic.cc",
189     "gesture_detection/motion_event_generic.h",
190     "gesture_detection/scale_gesture_detector.cc",
191     "gesture_detection/scale_gesture_detector.h",
192     "gesture_detection/snap_scroll_controller.cc",
193     "gesture_detection/snap_scroll_controller.h",
194     "gesture_detection/touch_disposition_gesture_filter.cc",
195     "gesture_detection/touch_disposition_gesture_filter.h",
196     "gesture_detection/velocity_tracker_state.cc",
197     "gesture_detection/velocity_tracker_state.h",
198     "gesture_detection/velocity_tracker.cc",
199     "gesture_detection/velocity_tracker.h",
200   ]
202   deps = [
203     ":events_base",
204     "//base",
205     "//ui/gfx",
206     "//ui/gfx/geometry",
207   ]
209   defines = [ "GESTURE_DETECTION_IMPLEMENTATION" ]
211   if (is_android) {
212     sources += [ "gesture_detection/gesture_config_helper_android.cc" ]
213   } else if (use_aura) {
214     sources += [ "gesture_detection/gesture_config_helper_aura.cc" ]
215   } else {
216     sources += [ "gesture_detection/gesture_config_helper.cc" ]
217   }
220 source_set("test_support") {
221   sources = [
222     "test/cocoa_test_event_utils.h",
223     "test/cocoa_test_event_utils.mm",
224     "test/event_generator.cc",
225     "test/event_generator.h",
226     "test/events_test_utils.cc",
227     "test/events_test_utils.h",
228     "test/events_test_utils_x11.cc",
229     "test/events_test_utils_x11.h",
230     "test/mock_motion_event.cc",
231     "test/mock_motion_event.h",
232     "test/platform_event_waiter.cc",
233     "test/platform_event_waiter.h",
234     "test/test_event_handler.cc",
235     "test/test_event_handler.h",
236     "test/test_event_processor.cc",
237     "test/test_event_processor.h",
238     "test/test_event_target.cc",
239     "test/test_event_target.h",
240   ]
242   deps = [
243     ":events",
244     ":events_base",
245     ":gesture_detection",
246     "//base",
247     "//skia",
248     "//ui/events/platform",
249     "//ui/gfx/geometry",
250   ]
252   if (is_ios) {
253     sources -= [
254       "test/cocoa_test_event_utils.h",
255       "test/cocoa_test_event_utils.mm",
256     ]
257   }
259   if (!use_x11) {
260     sources -= [
261       "test/events_test_utils_x11.cc",
262       "test/events_test_utils_x11.h",
263     ]
264   }
267 test("events_unittests") {
268   sources = [
269     "cocoa/events_mac_unittest.mm",
270     "event_dispatcher_unittest.cc",
271     "event_processor_unittest.cc",
272     "event_rewriter_unittest.cc",
273     "event_unittest.cc",
274     "gesture_detection/bitset_32_unittest.cc",
275     "gesture_detection/gesture_event_data_packet_unittest.cc",
276     "gesture_detection/gesture_provider_unittest.cc",
277     "gesture_detection/motion_event_buffer_unittest.cc",
278     "gesture_detection/motion_event_generic_unittest.cc",
279     "gesture_detection/touch_disposition_gesture_filter_unittest.cc",
280     "gesture_detection/velocity_tracker_unittest.cc",
281     "keycodes/dom4/keycode_converter_unittest.cc",
282     "latency_info_unittest.cc",
283     "platform/platform_event_source_unittest.cc",
284     "x/events_x_unittest.cc",
285   ]
287   deps = [
288     ":dom4_keycode_converter",
289     ":events",
290     ":events_base",
291     ":gesture_detection",
292     ":test_support",
293     "//base",
294     "//base/test:run_all_unittests",
295     "//skia",
296     "//testing/gtest",
297     "//ui/events/platform",
298     "//ui/gfx:test_support",
299   ]
301   if (use_x11) {
302     configs += [ "//build/config/linux:x11" ]
303     deps += [ "//ui/gfx/x" ]
304   } else {
305     sources -= [
306       "x/events_x_unittest.cc",
307     ]
308   }
310   if (use_ozone) {
311     sources += [
312       "ozone/evdev/key_event_converter_evdev_unittest.cc",
313       "ozone/evdev/touch_event_converter_evdev_unittest.cc",
314     ]
315   }
317   if (use_aura) {
318     sources += [
319       "gestures/gesture_provider_aura_unittest.cc",
320     ]
321   }