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.
4
5if (is_android) {
6  import("//build/config/android/config.gni")
7  import("//build/config/android/rules.gni")
8}
9
10component("devices") {
11  sources = [
12    "device_data_manager.cc",
13    "device_data_manager.h",
14    "device_hotplug_event_observer.h",
15    "events_devices_export.h",
16    "gamepad_device.cc",
17    "gamepad_device.h",
18    "input_device.cc",
19    "input_device.h",
20    "input_device_event_observer.h",
21    "stylus_state.h",
22    "touch_device_transform.cc",
23    "touch_device_transform.h",
24    "touchscreen_device.cc",
25    "touchscreen_device.h",
26  ]
27
28  if (is_linux || is_chromeos) {
29    sources += [
30      "device_util_linux.cc",
31      "device_util_linux.h",
32    ]
33  }
34
35  if (is_android) {
36    sources += [
37      "input_device_observer_android.cc",
38      "input_device_observer_android.h",
39    ]
40  }
41
42  if (is_win) {
43    sources += [
44      "input_device_observer_win.cc",
45      "input_device_observer_win.h",
46    ]
47  }
48
49  defines = [ "EVENTS_DEVICES_IMPLEMENTATION" ]
50
51  public_deps = [
52    "//ui/display/types",
53    "//ui/gfx",
54  ]
55
56  deps = [
57    "//base",
58    "//base/third_party/dynamic_annotations",
59    "//skia",
60    "//ui/events:platform_event",
61    "//ui/gfx:geometry_skia",
62    "//ui/gfx/geometry",
63  ]
64
65  if (is_android) {
66    deps += [ ":ui_events_devices_jni_headers" ]
67  }
68}
69
70if (is_android) {
71  generate_jni("ui_events_devices_jni_headers") {
72    sources = [ "../../android/java/src/org/chromium/ui/events/devices/InputDeviceObserver.java" ]
73  }
74}
75
76source_set("test_support") {
77  sources = [
78    "device_data_manager_test_api.cc",
79    "device_data_manager_test_api.h",
80  ]
81
82  deps = [ "//base" ]
83
84  public_deps = [ ":devices" ]
85}
86