OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/features.gni") | 5 import("//build/config/features.gni") |
6 import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni") | 6 import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni") |
7 | 7 |
| 8 if (is_android) { |
| 9 import("//build/config/android/config.gni") |
| 10 import("//build/config/android/rules.gni") # For generate_jni(). |
| 11 } |
| 12 |
8 component("vibration") { | 13 component("vibration") { |
9 output_name = "device_vibration" | 14 output_name = "device_vibration" |
10 | 15 |
11 sources = [ | 16 sources = [ |
12 "vibration_export.h", | 17 "vibration_export.h", |
13 "vibration_manager_impl.h", | 18 "vibration_manager_impl.h", |
14 "vibration_manager_impl_android.cc", | |
15 "vibration_manager_impl_android.h", | |
16 "vibration_manager_impl_default.cc", | |
17 ] | 19 ] |
18 | 20 |
19 defines = [ "DEVICE_VIBRATION_IMPLEMENTATION" ] | 21 defines = [ "DEVICE_VIBRATION_IMPLEMENTATION" ] |
20 | 22 |
21 deps = [ | 23 deps = [ |
22 ":mojo_bindings", | 24 ":mojo_bindings", |
23 "//base", | 25 "//base", |
24 "//base/third_party/dynamic_annotations", | 26 "//base/third_party/dynamic_annotations", |
25 "//mojo/environment:chromium", | 27 "//mojo/environment:chromium", |
26 "//third_party/mojo/src/mojo/public/cpp/bindings", | 28 "//third_party/mojo/src/mojo/public/cpp/bindings", |
27 "//third_party/mojo/src/mojo/edk/system", | 29 "//third_party/mojo/src/mojo/edk/system", |
28 ] | 30 ] |
29 | 31 |
30 if (is_android) { | 32 if (is_android) { |
31 sources -= [ "vibration_manager_impl_default.cc" ] | 33 sources += [ |
32 deps += [ | 34 "android/vibration_jni_registrar.cc", |
33 "//device/vibration/android", | 35 "android/vibration_jni_registrar.h", |
34 "//device/vibration/android:vibration_jni_headers", | 36 "vibration_manager_impl_android.cc", |
| 37 "vibration_manager_impl_android.h", |
35 ] | 38 ] |
36 allow_circular_includes_from = [ "//device/vibration/android" ] | 39 deps += [ ":vibration_jni_headers" ] |
| 40 } else { |
| 41 sources += [ "vibration_manager_impl_default.cc" ] |
37 } | 42 } |
38 } | 43 } |
39 | 44 |
40 mojom("mojo_bindings") { | 45 mojom("mojo_bindings") { |
41 sources = [ | 46 sources = [ |
42 "vibration_manager.mojom", | 47 "vibration_manager.mojom", |
43 ] | 48 ] |
44 } | 49 } |
| 50 |
| 51 if (is_android) { |
| 52 generate_jni("vibration_jni_headers") { |
| 53 sources = [ |
| 54 "android/java/src/org/chromium/device/vibration/VibrationProvider.java", |
| 55 ] |
| 56 jni_package = "vibration" |
| 57 } |
| 58 } |
OLD | NEW |