blob: dbbc0e960c3c26552998d53ea2a32e6e4df8356e [file] [log] [blame]
# Copyright 2018 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")
import("//ui/webui/resources/tools/generate_grd.gni")
assert(!is_android)
build_webui("build") {
grd_prefix = "discards"
static_files = [ "discards.html" ]
web_component_files = [
"database_tab.ts",
"discards_main.ts",
"discards_tab.ts",
"graph_tab_template.ts",
]
non_web_component_files = [
"discards.ts",
"graph_doc.ts",
"sorted_table_mixin.ts",
]
mojo_files_deps = [
"//chrome/browser/resource_coordinator:mojo_bindings_ts__generator",
"//chrome/browser/ui/webui/discards:mojo_bindings_ts__generator",
]
mojo_files = [
"$root_gen_dir/chrome/browser/resource_coordinator/lifecycle_unit_state.mojom-webui.ts",
"$root_gen_dir/chrome/browser/ui/webui/discards/discards.mojom-webui.ts",
"$root_gen_dir/chrome/browser/ui/webui/discards/site_data.mojom-webui.ts",
]
ts_composite = true
ts_deps = [
"//third_party/polymer/v3_0:library",
"//ui/webui/resources/cr_elements:build_ts",
"//ui/webui/resources/js:build_ts",
"//ui/webui/resources/mojo:library",
]
extra_grdp_files = [ "$target_gen_dir/discards_graph_tab.grdp" ]
extra_grdp_deps = [ ":build_graph_tab_grdp" ]
}
# This action merges the graph tab script into the graph_doc HTML template.
# It then base64 encodes the combination, and merges into the graph_tab HTML
# template to complete the data: URL for the webview therein.
action("generate_graph_tab") {
script = "generate_graph_tab.py"
sources = [
"graph_doc.ts",
"graph_doc_template.html",
"graph_tab_template.html",
]
outputs = [ "$target_gen_dir/graph_tab/graph_tab_template.html.js" ]
args = rebase_path(outputs, root_build_dir) +
rebase_path([ "graph_doc_template.html" ], root_build_dir) +
rebase_path([
"$target_gen_dir/tsc/graph_doc.js",
"$target_gen_dir/tsc/graph_tab_template.html.js",
],
root_build_dir)
deps = [ ":build_ts" ]
}
generate_grd("build_graph_tab_grdp") {
input_files = [ "graph_tab_template.html.js" ]
input_files_base_dir =
rebase_path("$target_gen_dir/graph_tab", root_build_dir)
deps = [ ":generate_graph_tab" ]
grd_prefix = "discards_graph_tab"
out_grd = "$target_gen_dir/discards_graph_tab.grdp"
}