Fix typo in AshWindowTreeHostOzone
[chromium-blink-merge.git] / ui / events / BUILD.gn
blob8c6d3d4c6fb79ba79ffad1a43c0bacfa523858ae
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     "event_constants.h",
20     "event_switches.cc",
21     "event_switches.h",
22     "events_base_export.h",
23     "gesture_event_details.cc",
24     "gesture_event_details.h",
25     "keycodes/keyboard_code_conversion.cc",
26     "keycodes/keyboard_code_conversion.h",
27     "keycodes/keyboard_code_conversion_android.cc",
28     "keycodes/keyboard_code_conversion_android.h",
29     "keycodes/keyboard_code_conversion_mac.h",
30     "keycodes/keyboard_code_conversion_mac.mm",
31     "keycodes/keyboard_code_conversion_win.cc",
32     "keycodes/keyboard_code_conversion_win.h",
33     "keycodes/keyboard_codes.h",
34     "latency_info.cc",
35     "latency_info.h",
36   ]
38   defines = [ "EVENTS_BASE_IMPLEMENTATION" ]
40   deps = [
41     ":dom4_keycode_converter",
42     "//base",
43     "//base/third_party/dynamic_annotations",
44     "//skia",
45     "//ui/gfx",
46     "//ui/gfx/geometry",
47   ]
49   if (use_x11) {
50     configs += [ "//build/config/linux:x11" ]
52     sources += [
53       "keycodes/keyboard_code_conversion_x.cc",
54       "keycodes/keyboard_code_conversion_x.h",
55       "x/device_data_manager.cc",
56       "x/device_data_manager.h",
57       "x/device_list_cache_x.cc",
58       "x/device_list_cache_x.h",
59       "x/touch_factory_x11.cc",
60       "x/touch_factory_x11.h",
61     ]
62   }
65 component("events") {
66   deps = [
67     ":dom4_keycode_converter",
68     ":events_base",
69     "//skia",
70     "//ui/gfx",
71     "//ui/gfx/geometry",
72   ]
74   defines = [ "EVENTS_IMPLEMENTATION" ]
76   sources = [
77     "cocoa/cocoa_event_utils.h",
78     "cocoa/cocoa_event_utils.mm",
79     "event.cc",
80     "event.h",
81     "event_dispatcher.cc",
82     "event_dispatcher.h",
83     "event_handler.cc",
84     "event_handler.h",
85     "event_processor.cc",
86     "event_processor.h",
87     "event_rewriter.h",
88     "event_source.cc",
89     "event_source.h",
90     "event_target.cc",
91     "event_target.h",
92     "event_target_iterator.h",
93     "event_targeter.cc",
94     "event_targeter.h",
95     "event_utils.cc",
96     "event_utils.h",
97     "events_export.h",
98     "events_stub.cc",
99     "gestures/gesture_configuration.cc",
100     "gestures/gesture_configuration.h",
101     "gestures/gesture_point.cc",
102     "gestures/gesture_point.h",
103     "gestures/gesture_recognizer.h",
104     "gestures/gesture_recognizer_impl.cc",
105     "gestures/gesture_recognizer_impl.h",
106     "gestures/gesture_sequence.cc",
107     "gestures/gesture_sequence.h",
108     "gestures/gesture_types.h",
109     "gestures/velocity_calculator.cc",
110     "gestures/velocity_calculator.h",
111     "platform/platform_event_dispatcher.h",
112     "platform/platform_event_observer.h",
113     "platform/platform_event_source.cc",
114     "platform/platform_event_source.h",
115     "platform/platform_event_source_stub.cc",
116     "platform/platform_event_types.h",
117     "platform/scoped_event_dispatcher.cc",
118     "platform/scoped_event_dispatcher.h",
119     "platform/x11/x11_event_source.cc",
120     "platform/x11/x11_event_source.h",
121     "win/events_win.cc",
122     "x/events_x.cc",
123   ]
125   if (use_x11) {
126     configs += [
127       "//build/config/linux:glib",
128       "//build/config/linux:x11",
129     ]
130   } else {
131     sources -= [
132       "platform/x11/x11_event_source.cc",
133       "platform/x11/x11_event_source.h",
134       "x/events_x.cc",
135     ]
136   }
138   if (!is_chromeos && is_linux) {
139     sources += [
140       "linux/text_edit_command_auralinux.cc",
141       "linux/text_edit_command_auralinux.h",
142       "linux/text_edit_key_bindings_delegate_auralinux.cc",
143       "linux/text_edit_key_bindings_delegate_auralinux.h",
144     ]
145   }
147   if (use_ozone) {
148     sources += [
149       "ozone/evdev/device_manager_evdev.cc",
150       "ozone/evdev/device_manager_evdev.h",
151       "ozone/evdev/device_manager_udev.cc",
152       "ozone/evdev/device_manager_udev.h",
153       "ozone/evdev/event_converter_evdev.cc",
154       "ozone/evdev/event_converter_evdev.h",
155       "ozone/evdev/event_device_info.cc",
156       "ozone/evdev/event_device_info.h",
157       "ozone/evdev/event_factory_evdev.cc",
158       "ozone/evdev/event_factory_evdev.h",
159       "ozone/evdev/event_modifiers_evdev.cc",
160       "ozone/evdev/event_modifiers_evdev.h",
161       "ozone/evdev/key_event_converter_evdev.cc",
162       "ozone/evdev/key_event_converter_evdev.h",
163       "ozone/evdev/touch_event_converter_evdev.cc",
164       "ozone/evdev/touch_event_converter_evdev.h",
165       "ozone/event_factory_ozone.cc",
166       "ozone/event_factory_ozone.h",
167       "ozone/events_ozone.cc",
168     ]
169   }
171   if (is_win || use_x11 || use_ozone) {
172     sources -= [ "events_stub.cc" ]
173   }
176 component("gesture_detection") {
177   sources = [
178     "gesture_detection/bitset_32.h",
179     "gesture_detection/filtered_gesture_provider.cc",
180     "gesture_detection/filtered_gesture_provider.h",
181     "gesture_detection/gesture_detection_export.h",
182     "gesture_detection/gesture_detector.cc",
183     "gesture_detection/gesture_detector.h",
184     "gesture_detection/gesture_event_data.cc",
185     "gesture_detection/gesture_event_data.h",
186     "gesture_detection/gesture_event_data_packet.cc",
187     "gesture_detection/gesture_event_data_packet.h",
188     "gesture_detection/gesture_config_helper.h",
189     "gesture_detection/gesture_config_helper_aura.cc",
190     "gesture_detection/gesture_config_helper_android.cc",
191     "gesture_detection/gesture_provider.cc",
192     "gesture_detection/gesture_provider.h",
193     "gesture_detection/motion_event.h",
194     "gesture_detection/scale_gesture_detector.cc",
195     "gesture_detection/scale_gesture_detector.h",
196     "gesture_detection/snap_scroll_controller.cc",
197     "gesture_detection/snap_scroll_controller.h",
198     "gesture_detection/touch_disposition_gesture_filter.cc",
199     "gesture_detection/touch_disposition_gesture_filter.h",
200     "gesture_detection/velocity_tracker_state.cc",
201     "gesture_detection/velocity_tracker_state.h",
202     "gesture_detection/velocity_tracker.cc",
203     "gesture_detection/velocity_tracker.h",
204   ]
206   deps = [
207     ":events_base",
208     "//base",
209     "//ui/gfx",
210     "//ui/gfx/geometry",
211   ]
213   defines = [ "GESTURE_DETECTION_IMPLEMENTATION" ]
215   if (use_aura) {
216     deps += [ ":events" ]
217   }
219   if (!use_aura && !is_android) {
220     sources -= [ "gesture_detection/gesture_config_helper_aura.cc" ]
221   }
224 source_set("events_test_support") {
225   sources = [
226     "test/cocoa_test_event_utils.h",
227     "test/cocoa_test_event_utils.mm",
228     "test/events_test_utils.cc",
229     "test/events_test_utils.h",
230     "test/events_test_utils_x11.cc",
231     "test/events_test_utils_x11.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     "//skia",
244     ":events_base",
245     ":events",
246   ]
248   if (is_ios) {
249     sources -= [
250       "test/cocoa_test_event_utils.h",
251       "test/cocoa_test_event_utils.mm",
252     ]
253   }
255   if (use_x11) {
256     configs += [ "//build/config/linux:x11" ]
257   } else {
258     sources -= [
259       "test/events_test_utils_x11.cc",
260       "test/events_test_utils_x11.h",
261     ]
262   }
265 test("events_unittests") {
266   sources = [
267     "cocoa/cocoa_event_utils_unittest.mm",
268     "event_dispatcher_unittest.cc",
269     "event_processor_unittest.cc",
270     "event_rewriter_unittest.cc",
271     "event_unittest.cc",
272     "gestures/velocity_calculator_unittest.cc",
273     "gesture_detection/bitset_32_unittest.cc",
274     "gesture_detection/gesture_provider_unittest.cc",
275     "gesture_detection/mock_motion_event.h",
276     "gesture_detection/mock_motion_event.cc",
277     "gesture_detection/velocity_tracker_unittest.cc",
278     "gesture_detection/touch_disposition_gesture_filter_unittest.cc",
279     "keycodes/dom4/keycode_converter_unittest.cc",
280     "latency_info_unittest.cc",
281     "platform/platform_event_source_unittest.cc",
282     "x/events_x_unittest.cc",
283   ]
285   if (!use_x11) {
286     sources -= [
287       "x/events_x_unittest.cc",
288     ]
289   }
291   if (use_ozone) {
292     sources += [
293       "ozone/evdev/key_event_converter_evdev_unittest.cc",
294       "ozone/evdev/touch_event_converter_evdev_unittest.cc",
295     ]
296   }
298   deps = [
299     ":events",
300     ":events_base",
301     ":events_test_support",
302     ":gesture_detection",
303     "//base",
304     "//base/test:run_all_unittests",
305     "//skia",
306     "//testing/gtest",
307     "//ui/gfx:gfx_test_support",
308   ]