1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85

ash / webui / demo_mode_app_ui / BUILD.gn [blame]

# Copyright 2021 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("//third_party/closure_compiler/compile_js.gni")
import("//tools/grit/preprocess_if_expr.gni")
import("//ui/webui/resources/tools/generate_grd.gni")

assert(is_chromeos_ash, "Demo Mode App is ash-chrome only")

static_library("demo_mode_app_ui") {
  sources = [
    "demo_mode_app_delegate.h",
    "demo_mode_app_untrusted_ui.cc",
    "demo_mode_app_untrusted_ui.h",
    "demo_mode_untrusted_page_handler.cc",
    "demo_mode_untrusted_page_handler.h",
    "url_constants.cc",
    "url_constants.h",
  ]

  deps = [
    "//ash:ash",
    "//ash/webui/common:chrome_os_webui_config",
    "//ash/webui/demo_mode_app_ui/mojom",
    "//ash/webui/resources:demo_mode_app_resources",
    "//chromeos/ash/components/install_attributes",
    "//chromeos/constants",
    "//content/public/browser",
    "//ui/views",
    "//ui/webui",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [ "demo_mode_app_untrusted_ui_unittests.cc" ]
  deps = [
    ":demo_mode_app_ui",
    "//base",
    "//base/test:test_support",
    "//testing/gtest",
    "//url",
  ]
}

js_type_check("closure_compile") {
  deps = [ ":app" ]
  closure_flags = default_closure_args + mojom_js_args
}

js_library("app") {
  deps = [ "//ash/webui/demo_mode_app_ui/mojom:mojom_webui_js" ]
  externs_list = [ "$externs_path/metrics_private_individual_apis.js" ]
  sources = [
    "resources/demo_mode_metrics_service.js",
    "resources/page_handler.js",
  ]
}

grd_prefix = "ash_demo_mode_app"
mojo_grdp_file = "$target_gen_dir/demo_mode_app_mojo_resources.grdp"

generate_grd("build_mojo_grdp") {
  out_grd = mojo_grdp_file
  grd_prefix = grd_prefix
  deps = [ "//ash/webui/demo_mode_app_ui/mojom:mojom_webui_js" ]
  input_files = [ "ash/webui/demo_mode_app_ui/mojom/demo_mode_app_untrusted_ui.mojom-webui.js" ]
  input_files_base_dir =
      rebase_path("$root_gen_dir/mojom-webui", "$root_build_dir")
}

generate_grd("build_grd") {
  input_files_base_dir = rebase_path("resources", "//")
  deps = [ ":build_mojo_grdp" ]
  input_files = [
    "app_icon_192.png",
    "page_handler.js",
    "demo_mode_metrics_service.js",
  ]
  grd_prefix = grd_prefix
  out_grd = "$target_gen_dir/${grd_prefix}_resources.grd"
  grdp_files = [ mojo_grdp_file ]
}