chromium/ash/webui/print_preview_cros/resources/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("//ui/webui/resources/tools/build_webui.gni")

assert(is_chromeos_ash, "Print Preview CrOS is ChromeOS only")

build_webui("build") {
  static_files = [
    "images/app_icon_192.png",
    "index.html",
  ]

  css_files = [ "css/print_preview_cros_shared.css" ]

  non_web_component_files = [
    "js/data/capabilities_manager.ts",
    "js/data/destination_constants.ts",
    "js/data/destination_manager.ts",
    "js/data/destination_provider_composite.ts",
    "js/data/print_preview_page_handler_composite.ts",
    "js/data/preview_ticket_manager.ts",
    "js/data/print_ticket_manager.ts",
    "js/data/ticket_constants.ts",
    "js/destination_dropdown_controller.ts",
    "js/destination_row_controller.ts",
    "js/destination_select_controller.ts",
    "js/print_preview_cros_app_controller.ts",
    "js/summary_panel_controller.ts",
    "js/fakes/fake_data.ts",
    "js/fakes/fake_destination_provider.ts",
    "js/fakes/fake_print_preview_page_handler.ts",
    "js/utils/event_utils.ts",
    "js/utils/mojo_data_providers.ts",
    "js/utils/print_preview_cros_app_types.ts",
    "js/utils/validation_utils.ts",
  ]

  web_component_files = [
    "js/destination_dropdown.ts",
    "js/destination_row.ts",
    "js/destination_select.ts",
    "js/print_preview_cros_app.ts",
    "js/summary_panel.ts",
  ]

  mojo_files = [
    "$root_gen_dir/ash/webui/print_preview_cros/mojom/destination_provider.mojom-webui.ts",
    "$root_gen_dir/ash/webui/print_preview_cros/mojom/printer_capabilities.mojom-webui.ts",
    "$root_gen_dir/printing/mojom/print.mojom-webui.ts",
  ]

  mojo_files_deps = [
    "//ash/webui/print_preview_cros/mojom:mojom_ts__generator",
    "//printing/mojom:mojom_ts__generator",
  ]

  ts_composite = true

  ts_definitions = [ "//tools/typescript/definitions/chrome_send.d.ts" ]

  ts_deps = [
    "//ash/webui/common/resources:build_ts",
    "//third_party/cros-components:cros_components_ts",
    "//third_party/polymer/v3_0:library",
    "//ui/webui/resources/cr_components/color_change_listener:build_ts",
    "//ui/webui/resources/js:build_ts",
    "//ui/webui/resources/mojo:build_ts",
  ]

  webui_context_type = "trusted"
  grd_prefix = "ash_print_preview_cros_app"
  grit_output_dir = "$root_gen_dir/ash/webui"
}