chromium/services/media_session/public/mojom/BUILD.gn

# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//mojo/public/tools/bindings/mojom.gni")

mojom("mojom") {
  generate_java = true
  sources = [
    "audio_focus.mojom",
    "constants.mojom",
    "media_controller.mojom",
    "media_session.mojom",
  ]

  public_deps = [
    "//mojo/public/mojom/base",
    "//ui/gfx/geometry/mojom",
    "//url/mojom:url_mojom_gurl",
  ]

  webui_module_path = "/"

  # Blink requires legacy JS bindings.
  generate_legacy_js_bindings = true

  # 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"

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "media_session.mojom.ChapterInformation"
          cpp = "::media_session::ChapterInformation"
        },
        {
          mojom = "media_session.mojom.MediaImage"
          cpp = "::media_session::MediaImage"
        },
        {
          mojom = "media_session.mojom.MediaImageBitmap"
          cpp = "::SkBitmap"
          nullable_is_same_type = true
        },
        {
          mojom = "media_session.mojom.MediaMetadata"
          cpp = "::media_session::MediaMetadata"
        },
        {
          mojom = "media_session.mojom.MediaPosition"
          cpp = "::media_session::MediaPosition"
        },
      ]
      traits_headers =
          [ "//services/media_session/public/cpp/media_session_mojom_traits.h" ]
      traits_sources = [
        "//services/media_session/public/cpp/media_session_mojom_traits.cc",
      ]
      traits_public_deps = [
        "//base",
        "//services/media_session/public/cpp:base_cpp",
        "//skia",
      ]
      traits_deps = [
        "//mojo/public/mojom/base",
        "//ui/gfx/geometry/mojom",
      ]
    },
  ]
}