chromium/ui/base/accelerators/mojom/BUILD.gn

# Copyright 2017 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") {
  sources = [ "accelerator.mojom" ]
  public_deps = [
    "//mojo/public/mojom/base",
    "//ui/events/mojom",
  ]

  # Generate TypeScript WebUI bindings and JavaScript legacy JS bindings (for
  # Blink).
  webui_module_path = "chrome://resources/mojo/ui/base/accelerators/mojom"
  generate_legacy_js_bindings = true

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "ui.mojom.Accelerator"
          cpp = "::ui::Accelerator"
        },
        {
          mojom = "ui.mojom.AcceleratorKeyState"
          cpp = "::ui::Accelerator::KeyState"
        },
      ]
      traits_headers = [ "accelerator_mojom_traits.h" ]
      traits_public_deps = [ ":mojom_traits" ]
    },
  ]
}

source_set("mojom_traits") {
  sources = [ "accelerator_mojom_traits.h" ]
  public_deps = [
    ":mojom_shared_cpp_sources",
    "//mojo/public/mojom/base",
    "//ui/base",
    "//ui/events",
  ]
}

source_set("unittests") {
  testonly = true
  sources = [ "accelerator_mojom_traits_unittest.cc" ]
  deps = [
    ":mojom",
    ":mojom_traits",
    "//testing/gtest",
    "//ui/base",
    "//ui/events",
  ]
}