summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/discards/BUILD.gn
blob: f7f0df2fc4af4478d9616e5be4795fdd2e56f21f (plain)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# 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"
}