Extensions: Store disable reasons in Sync
[chromium-blink-merge.git] / ui / events / BUILD.gn
blob4fe11f40356988b892bb2599259b42e8ccfc87e1
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") {
9   sources = [
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",
16   ]
18   deps = [
19     "//base",
20   ]
23 component("events_base") {
24   sources = [
25     "android/scroller.cc",
26     "android/scroller.h",
27     "base_event_utils.cc",
28     "base_event_utils.h",
29     "event_constants.h",
30     "event_switches.cc",
31     "event_switches.h",
32     "events_base_export.h",
33     "gesture_curve.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",
48     "latency_info.cc",
49     "latency_info.h",
50   ]
52   defines = [ "EVENTS_BASE_IMPLEMENTATION" ]
54   deps = [
55     ":dom_keycode_converter",
56     "//base/third_party/dynamic_annotations",
57     "//skia",
58   ]
60   public_deps = [
61     "//base",
62     "//ui/events/platform",
63     "//ui/gfx",
64     "//ui/gfx/geometry",
65   ]
67   if (use_x11) {
68     configs += [ "//build/config/linux:x11" ]
70     sources += [
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",
75     ]
77     deps += [ "//ui/gfx/x" ]
78   }
80   if (use_x11 || use_ozone) {
81     sources += [
82       "keycodes/keyboard_code_conversion_xkb.cc",
83       "keycodes/keyboard_code_conversion_xkb.h",
84       "keycodes/xkb_keysym.h",
85     ]
86   }
89 component("events") {
90   sources = [
91     "cocoa/cocoa_event_utils.h",
92     "cocoa/cocoa_event_utils.mm",
93     "cocoa/events_mac.mm",
94     "event.cc",
95     "event.h",
96     "event_dispatcher.cc",
97     "event_dispatcher.h",
98     "event_handler.cc",
99     "event_handler.h",
100     "event_processor.cc",
101     "event_processor.h",
102     "event_rewriter.h",
103     "event_source.cc",
104     "event_source.h",
105     "event_target.cc",
106     "event_target.h",
107     "event_target_iterator.h",
108     "event_targeter.cc",
109     "event_targeter.h",
110     "event_utils.cc",
111     "event_utils.h",
112     "events_export.h",
113     "events_stub.cc",
114     "gestures/gesture_recognizer_impl_mac.cc",
115     "gestures/gesture_types.h",
116     "null_event_targeter.cc",
117     "null_event_targeter.h",
118     "win/events_win.cc",
119   ]
121   defines = [ "EVENTS_IMPLEMENTATION" ]
123   public_deps = [
124     ":events_base",
125   ]
126   deps = [
127     ":dom_keycode_converter",
128     ":gesture_detection",
129     "//base/third_party/dynamic_annotations",
130     "//skia",
131     "//ui/gfx",
132     "//ui/gfx/geometry",
133   ]
135   if (use_x11) {
136     sources += [ "x/events_x.cc" ]
137     configs += [
138       "//build/config/linux:glib",
139       "//build/config/linux:x11",
140     ]
141     deps += [
142       "//ui/events/devices",
143       "//ui/gfx/x",
144     ]
145   }
147   if (!is_chromeos && is_linux) {
148     sources += [
149       "linux/text_edit_command_auralinux.cc",
150       "linux/text_edit_command_auralinux.h",
151       "linux/text_edit_key_bindings_delegate_auralinux.cc",
152       "linux/text_edit_key_bindings_delegate_auralinux.h",
153     ]
154   }
156   if (use_ozone) {
157     sources += [ "ozone/events_ozone.cc" ]
158     deps += [ "//ui/events/ozone:events_ozone_layout" ]
159   }
161   if (use_aura) {
162     sources += [
163       "gestures/gesture_provider_aura.cc",
164       "gestures/gesture_provider_aura.h",
165       "gestures/gesture_recognizer.h",
166       "gestures/gesture_recognizer_impl.cc",
167       "gestures/gesture_recognizer_impl.h",
168       "gestures/motion_event_aura.cc",
169       "gestures/motion_event_aura.h",
170     ]
171   }
173   if (is_win || is_mac || use_x11 || use_ozone) {
174     sources -= [ "events_stub.cc" ]
175   }
178 component("gesture_detection") {
179   sources = [
180     "gesture_detection/bitset_32.h",
181     "gesture_detection/filtered_gesture_provider.cc",
182     "gesture_detection/filtered_gesture_provider.h",
183     "gesture_detection/gesture_configuration.cc",
184     "gesture_detection/gesture_configuration.h",
185     "gesture_detection/gesture_detection_export.h",
186     "gesture_detection/gesture_detector.cc",
187     "gesture_detection/gesture_detector.h",
188     "gesture_detection/gesture_event_data.cc",
189     "gesture_detection/gesture_event_data.h",
190     "gesture_detection/gesture_event_data_packet.cc",
191     "gesture_detection/gesture_event_data_packet.h",
192     "gesture_detection/gesture_listeners.cc",
193     "gesture_detection/gesture_listeners.h",
194     "gesture_detection/gesture_provider.cc",
195     "gesture_detection/gesture_provider.h",
196     "gesture_detection/gesture_provider_config_helper.cc",
197     "gesture_detection/gesture_provider_config_helper.h",
198     "gesture_detection/gesture_touch_uma_histogram.cc",
199     "gesture_detection/gesture_touch_uma_histogram.h",
200     "gesture_detection/motion_event.cc",
201     "gesture_detection/motion_event.h",
202     "gesture_detection/motion_event_buffer.cc",
203     "gesture_detection/motion_event_buffer.h",
204     "gesture_detection/motion_event_generic.cc",
205     "gesture_detection/motion_event_generic.h",
206     "gesture_detection/scale_gesture_detector.cc",
207     "gesture_detection/scale_gesture_detector.h",
208     "gesture_detection/scale_gesture_listeners.cc",
209     "gesture_detection/scale_gesture_listeners.h",
210     "gesture_detection/snap_scroll_controller.cc",
211     "gesture_detection/snap_scroll_controller.h",
212     "gesture_detection/touch_disposition_gesture_filter.cc",
213     "gesture_detection/touch_disposition_gesture_filter.h",
214     "gesture_detection/velocity_tracker.cc",
215     "gesture_detection/velocity_tracker.h",
216     "gesture_detection/velocity_tracker_state.cc",
217     "gesture_detection/velocity_tracker_state.h",
218   ]
220   deps = [
221     ":events_base",
222     "//base",
223     "//base/third_party/dynamic_annotations",
224     "//ui/gfx",
225     "//ui/gfx/geometry",
226   ]
228   defines = [ "GESTURE_DETECTION_IMPLEMENTATION" ]
230   if (is_android) {
231     sources += [ "gesture_detection/gesture_configuration_android.cc" ]
232   } else if (use_aura) {
233     sources += [ "gesture_detection/gesture_configuration_aura.cc" ]
234   } else {
235     sources += [ "gesture_detection/gesture_configuration_default.cc" ]
236   }
239 source_set("test_support") {
240   sources = [
241     "test/cocoa_test_event_utils.h",
242     "test/cocoa_test_event_utils.mm",
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   ]
259   public_deps = [
260     ":events",
261     ":events_base",
262     ":gesture_detection",
263   ]
264   deps = [
265     "//base",
266     "//skia",
267     "//ui/events/platform",
268     "//ui/gfx/geometry",
269   ]
271   if (is_ios) {
272     sources -= [
273       "test/cocoa_test_event_utils.h",
274       "test/cocoa_test_event_utils.mm",
275     ]
276   }
278   if (use_x11) {
279     sources += [
280       "test/events_test_utils_x11.cc",
281       "test/events_test_utils_x11.h",
282     ]
283     deps += [
284       "//ui/events/devices",
285       "//ui/gfx/x",
286     ]
287   }
290 test("events_unittests") {
291   sources = [
292     "android/scroller_unittest.cc",
293     "cocoa/events_mac_unittest.mm",
294     "devices/x11/device_data_manager_x11_unittest.cc",
295     "event_dispatcher_unittest.cc",
296     "event_processor_unittest.cc",
297     "event_rewriter_unittest.cc",
298     "event_unittest.cc",
299     "gesture_detection/bitset_32_unittest.cc",
300     "gesture_detection/filtered_gesture_provider_unittest.cc",
301     "gesture_detection/gesture_event_data_packet_unittest.cc",
302     "gesture_detection/gesture_provider_unittest.cc",
303     "gesture_detection/motion_event_buffer_unittest.cc",
304     "gesture_detection/motion_event_generic_unittest.cc",
305     "gesture_detection/snap_scroll_controller_unittest.cc",
306     "gesture_detection/touch_disposition_gesture_filter_unittest.cc",
307     "gesture_detection/velocity_tracker_unittest.cc",
308     "gestures/blink/web_gesture_curve_impl_unittest.cc",
309     "gestures/fling_curve_unittest.cc",
310     "keycodes/dom/keycode_converter_unittest.cc",
311     "keycodes/keyboard_code_conversion_unittest.cc",
312     "latency_info_unittest.cc",
313     "platform/platform_event_source_unittest.cc",
314     "x/events_x_unittest.cc",
315   ]
317   deps = [
318     ":dom_keycode_converter",
319     ":events",
320     ":events_base",
321     ":gesture_detection",
322     ":test_support",
323     "//base",
324     "//base/test:run_all_unittests",
325     "//skia",
326     "//testing/gtest",
327     "//third_party/WebKit/public:blink_headers",
328     "//ui/events/devices",
329     "//ui/events/gestures/blink",
330     "//ui/events/platform",
331     "//ui/gfx:test_support",
332   ]
334   include_dirs = [ "//testing/gmock/include" ]
336   if (use_x11) {
337     configs += [ "//build/config/linux:x11" ]
338     deps += [ "//ui/gfx/x" ]
339   } else {
340     sources -= [
341       "devices/x11/device_data_manager_x11_unittest.cc",
342       "x/events_x_unittest.cc",
343     ]
344   }
346   if (use_ozone) {
347     sources += [
348       "ozone/chromeos/cursor_controller_unittest.cc",
349       "ozone/evdev/event_converter_evdev_impl_unittest.cc",
350       "ozone/evdev/event_converter_test_util.cc",
351       "ozone/evdev/event_device_info_unittest.cc",
352       "ozone/evdev/event_device_test_util.cc",
353       "ozone/evdev/input_injector_evdev_unittest.cc",
354       "ozone/evdev/tablet_event_converter_evdev_unittest.cc",
355       "ozone/evdev/touch_event_converter_evdev_unittest.cc",
356       "ozone/evdev/touch_noise/touch_noise_finder_unittest.cc",
357       "ozone/layout/xkb/xkb_keyboard_layout_engine_unittest.cc",
358     ]
359     deps += [
360       "//ui/events/ozone:events_ozone",
361       "//ui/events/ozone:events_ozone_evdev",
362       "//ui/events/ozone:events_ozone_layout",
363     ]
364   }
366   if (use_aura) {
367     sources += [ "gestures/gesture_provider_aura_unittest.cc" ]
368   }
371 if (is_nacl) {
372   source_set("latency_info") {
373     sources = [
374       "ipc/latency_info_param_traits.cc",
375       "ipc/latency_info_param_traits.h",
376       "latency_info.cc",
377       "latency_info.h",
378     ]
379   }