chromium/chrome/browser/ui/webui/ash/lobster/BUILD.gn

# Copyright 2024 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("//mojo/public/tools/bindings/mojom.gni")

assert(is_chromeos_ash)

static_library("lobster") {
  sources = [
    "lobster_page_handler.cc",
    "lobster_page_handler.h",
    "lobster_ui.cc",
    "lobster_ui.h",
  ]

  public_deps = [
    "//base",
    "//chrome/browser:browser_public_dependencies",
    "//chrome/browser/ui/webui/top_chrome",
  ]

  deps = [
    "//ash/public/cpp",
    "//chrome/browser/ash/lobster",
    "//chrome/browser/profiles:profile",
    "//mojo/public/cpp/bindings",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [ "lobster_page_handler_unittest.cc" ]

  deps = [
    ":lobster",
    "//ash/public/cpp:cpp",
    "//base",
    "//base/test:test_support",
    "//chrome/test:test_support",
    "//services/data_decoder/public/cpp:test_support",
    "//testing/gmock",
    "//testing/gtest",
    "//ui/gfx:test_support",
  ]
}

mojom("lobster_mojom") {
  sources = [ "lobster.mojom" ]
  public_deps = [
    "//mojo/public/mojom/base",
    "//ui/gfx/geometry/mojom",
    "//url/mojom:url_mojom_gurl",
  ]

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "lobster.mojom.StatusCode"
          cpp = "::ash::LobsterErrorCode"
        },
        {
          mojom = "lobster.mojom.FeedbackPreview"
          cpp = "::ash::LobsterFeedbackPreview"
        },
      ]

      traits_headers = [ "lobster_mojom_traits.h" ]
      traits_public_deps = [ "//ash/public/cpp:cpp" ]
    },
  ]
}