# Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//third_party/closure_compiler/compile_js.gni") import("//tools/polymer/polymer.gni") js_type_check("closure_compile") { is_polymer3 = true closure_flags = default_closure_args + mojom_js_args + [ "js_module_root=" + rebase_path(".", root_build_dir) ] deps = [ ":database_tab", ":discards", ":discards_main", ":discards_tab", ":graph_doc", ":graph_tab_template", ] } js_library("discards") { deps = [ "//chrome/browser/ui/webui/discards:mojo_bindings_webui_js" ] } js_library("discards_main") { deps = [ "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", ] } js_library("database_tab") { deps = [ ":discards", ":sorted_table_behavior", "//chrome/browser/ui/webui/discards:mojo_bindings_webui_js", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//ui/webui/resources/js:assert.m", ] } js_library("discards_tab") { deps = [ ":discards", ":sorted_table_behavior", "//chrome/browser/ui/webui/discards:mojo_bindings_webui_js", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//ui/webui/resources/js:assert.m", "//ui/webui/resources/js:icon.m", ] } js_library("graph_tab_template") { deps = [ "//chrome/browser/ui/webui/discards:mojo_bindings_webui_js", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", ] } js_library("graph_doc") { deps = [ "//chrome/browser/ui/webui/discards:mojo_bindings_webui_js" ] externs_list = [ "../../../../third_party/d3/src/externs.js" ] } js_library("sorted_table_behavior") { } # 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.js", "graph_doc_template.html", "graph_tab_template.html", ] outputs = [ "$target_gen_dir/graph_tab.js" ] args = rebase_path(outputs) + rebase_path([ "graph_doc_template.html", "graph_doc.js", ]) + rebase_path([ "$target_gen_dir/graph_tab_template.js" ]) deps = [ ":graph_tab_module" ] } # Action with a transparent name. group("discards_resources_gen") { public_deps = [ ":generate_graph_tab", ":polymer3_elements", ] } group("polymer3_elements") { public_deps = [ ":database_tab_module", ":discards_main_module", ":discards_tab_module", ":graph_doc_module", ":graph_tab_module", ] } polymer_modulizer("database_tab") { html_file = "database_tab.html" js_file = "database_tab.js" html_type = "v3-ready" } polymer_modulizer("discards_main") { html_file = "discards_main.html" js_file = "discards_main.js" html_type = "v3-ready" } polymer_modulizer("discards_tab") { html_file = "discards_tab.html" js_file = "discards_tab.js" html_type = "v3-ready" } polymer_modulizer("graph_doc") { html_file = "graph_doc_template.html" js_file = "graph_doc.js" html_type = "v3-ready" } polymer_modulizer("graph_tab") { html_file = "graph_tab_template.html" js_file = "graph_tab_template.js" html_type = "v3-ready" }