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

import("//ui/webui/resources/tools/build_webui.gni")

build_webui("build") {
  grd_prefix = "policy"

  static_files = [
    "logs/policy_logs.html",
    "policy.css",
    "policy.html",
    "policy_shared_vars.css",
    "test/policy_test.html",
  ]

  ts_files = [
    "logs/policy_logs.ts",
    "logs/policy_logs_app.html.ts",
    "logs/policy_logs_app.ts",
    "logs/policy_logs_search.ts",
    "logs/types.ts",
    "policy.ts",
    "policy_app.html.ts",
    "policy_app.ts",
    "browser_proxy.ts",
    "policy_conflict.html.ts",
    "policy_conflict.ts",
    "policy_row.html.ts",
    "policy_row.ts",
    "status_box.html.ts",
    "status_box.ts",
    "policy_table.html.ts",
    "policy_table.ts",
    "policy_table_header_cell.html.ts",
    "policy_table_header_cell.ts",
    "policy_precedence_row.html.ts",
    "policy_precedence_row.ts",
    "promotion_banner_section_container.html.ts",
    "promotion_banner_section_container.ts",
    "test/policy_test.ts",
    "test/policy_test_browser_proxy.ts",
    "test/policy_test_row.html.ts",
    "test/policy_test_row.ts",
    "test/policy_test_table.html.ts",
    "test/policy_test_table.ts",
  ]

  css_files = [
    "logs/policy_logs_app.css",
    "policy_app.css",
    "policy_conflict.css",
    "policy_precedence_row.css",
    "promotion_banner_section_container.css",
    "policy_row.css",
    "status_box.css",
    "policy_table.css",
    "policy_table_header_cell.css",
    "test/policy_test_row.css",
    "test/policy_test_table.css",
  ]

  mojo_files = [ "$root_gen_dir/components/policy/resources/webui/" +
                 "mojom/policy.mojom-webui.ts" ]
  mojo_files_deps = [
    "//components/policy/resources/webui/mojom:mojo_bindings_ts__generator",
  ]

  ts_composite = true
  ts_definitions = [ "//tools/typescript/definitions/chrome_send.d.ts" ]
  ts_tsconfig_base = "tsconfig_base.json"

  ts_deps = [
    "//third_party/lit/v3_0:build_ts",
    "//ui/webui/resources/cr_elements:build_ts",
    "//ui/webui/resources/js:build_ts",
    "//ui/webui/resources/mojo:build_ts",
  ]

  webui_context_type = "trusted"
  grit_output_dir = "$root_gen_dir/components"
}
