| # Copyright 2016 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/chromeos/ui_mode.gni") |
| import("//build/config/features.gni") |
| import("//mojo/public/tools/bindings/mojom.gni") |
| |
| mojom("mojom") { |
| generate_java = true |
| sources = [ |
| "battery_monitor.mojom", |
| "battery_status.mojom", |
| "bluetooth_system.mojom", |
| "device_posture_provider.mojom", |
| "fingerprint.mojom", |
| "geolocation.mojom", |
| "geolocation_config.mojom", |
| "geolocation_context.mojom", |
| "geolocation_control.mojom", |
| "geoposition.mojom", |
| "hid.mojom", |
| "input_service.mojom", |
| "nfc.mojom", |
| "nfc_provider.mojom", |
| "power_monitor.mojom", |
| "pressure_manager.mojom", |
| "pressure_state.mojom", |
| "public_ip_address_geolocation_provider.mojom", |
| "screen_orientation.mojom", |
| "screen_orientation_lock_types.mojom", |
| "serial.mojom", |
| "time_zone_monitor.mojom", |
| "vibration_manager.mojom", |
| "wake_lock.mojom", |
| "wake_lock_context.mojom", |
| "wake_lock_provider.mojom", |
| ] |
| |
| public_deps = [ |
| "//mojo/public/mojom/base", |
| "//services/network/public/mojom", |
| "//services/network/public/mojom:mojom_proxy_config", |
| "//services/network/public/mojom:url_loader_base", |
| "//url/mojom:url_mojom_gurl", |
| ] |
| |
| if (is_chromeos_ash) { |
| sources += [ |
| "mtp_file_entry.mojom", |
| "mtp_manager.mojom", |
| "mtp_storage_info.mojom", |
| ] |
| } |
| |
| cpp_typemaps = [ |
| { |
| types = [ |
| { |
| mojom = "device.mojom.BluetoothAddress" |
| cpp = "::std::array<::uint8_t, 6>" |
| }, |
| ] |
| traits_headers = [ "//services/device/public/cpp/bluetooth/bluetooth_system_mojom_traits.h" ] |
| traits_sources = [ "//services/device/public/cpp/bluetooth/bluetooth_system_mojom_traits.cc" ] |
| traits_public_deps = [ "//base" ] |
| }, |
| ] |
| |
| # The blink variant of the Device Service mojom are depended on by the |
| # blink platform target. All blink variant mojoms use WTF types, which are |
| # part of the blink platform component. In order to avoid a dependency cycle, |
| # these targets must be part of that component. |
| export_class_attribute_blink = "BLINK_PLATFORM_EXPORT" |
| export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1" |
| export_header_blink = "third_party/blink/public/platform/web_common.h" |
| |
| visibility_blink = [ |
| "//third_party/blink/renderer/platform:blink_platform_public_deps", |
| "//third_party/blink/renderer/platform/media:*", |
| "//third_party/blink/public/mojom:mojom_platform_blink", |
| ] |
| } |
| |
| mojom("device_service") { |
| sources = [ "device_service.mojom" ] |
| |
| # We can't depend on the Blink variant of ":generic_sensors", but we need the |
| # non-Blink variant as a dependency. Blink can never use the DeviceService |
| # interface directly anyway, so don't generate bindings for it. |
| disable_variants = true |
| |
| enabled_features = [] |
| if ((is_linux || is_chromeos) && use_udev) { |
| enabled_features += [ "enable_input_device_manager" ] |
| } |
| |
| if (!is_android) { |
| enabled_features += [ "enable_hid" ] |
| } |
| |
| # While the device posture API applies to all platforms, only Android and |
| # Windows can fetch posture information so we only build mojo bindings on |
| # these platforms |
| if (is_android || is_win) { |
| enabled_features += [ "enable_device_posture" ] |
| } |
| |
| public_deps = [ |
| ":generic_sensor", |
| ":mojom", |
| ":usb", |
| ":usb_test", |
| ] |
| } |
| |
| mojom("generic_sensor") { |
| generate_java = true |
| sources = [ |
| "sensor.mojom", |
| "sensor_provider.mojom", |
| ] |
| |
| export_class_attribute_blink = "BLINK_PLATFORM_EXPORT" |
| export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1" |
| export_header_blink = "third_party/blink/public/platform/web_common.h" |
| |
| visibility_blink = [ |
| ":mojom_blink", |
| "//third_party/blink/renderer/platform:blink_platform_public_deps", |
| ] |
| |
| # Generic Sensor Mojom interfaces are exposed publicly to layout tests which |
| # use prepackaged redistributable JS bindings. It is therefore not desirable |
| # to scramble these messages. |
| scramble_message_ids = false |
| |
| cpp_typemaps = [ |
| { |
| types = [ |
| { |
| mojom = "device.mojom.SensorConfiguration" |
| cpp = "::device::PlatformSensorConfiguration" |
| }, |
| ] |
| traits_headers = [ |
| "//services/device/public/cpp/generic_sensor/sensor_mojom_traits.h", |
| ] |
| traits_sources = [ |
| "//services/device/public/cpp/generic_sensor/sensor_mojom_traits.cc", |
| ] |
| traits_public_deps = |
| [ "//services/device/public/cpp/generic_sensor:sensor_configuration" ] |
| }, |
| ] |
| |
| public_deps = [ "//mojo/public/mojom/base" ] |
| } |
| |
| mojom("usb") { |
| generate_java = true |
| sources = [ |
| "usb_device.mojom", |
| "usb_enumeration_options.mojom", |
| "usb_manager.mojom", |
| "usb_manager_client.mojom", |
| ] |
| |
| public_deps = [ |
| "//mojo/public/mojom/base", |
| "//url/mojom:url_mojom_gurl", |
| ] |
| |
| # USB Mojom interfaces are exposed publicly to layout tests which use |
| # prepackaged redistributable JS bindings. It is therefore not desirable to |
| # scramble these messages. |
| scramble_message_ids = false |
| |
| # The blink variant of the usb mojom is depended on by the blink platform |
| # target. All blink variant mojoms use WTF types, which are part of the |
| # blink platform component. In order to avoid a dependency cycle, these |
| # targets must be part of that component. |
| export_class_attribute_blink = "BLINK_PLATFORM_EXPORT" |
| export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1" |
| export_header_blink = "third_party/blink/public/platform/web_common.h" |
| |
| visibility_blink = [ |
| ":*", |
| "//ash/components/arc/mojom:mojom_blink", |
| "//third_party/blink/public/mojom/usb:usb_blink", |
| "//third_party/blink/renderer/modules/webusb", |
| "//chrome/browser/ui/webui/usb_internals:mojo_bindings_blink", |
| ] |
| |
| webui_module_path = "/" |
| } |
| |
| mojom("usb_test") { |
| generate_java = true |
| sources = [ "usb_manager_test.mojom" ] |
| public_deps = [ "//url/mojom:url_mojom_gurl" ] |
| webui_module_path = "/" |
| } |