File: BUILD.gn

package info (click to toggle)
chromium 138.0.7204.183-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 6,080,960 kB
  • sloc: cpp: 34,937,079; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,954; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,811; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (86 lines) | stat: -rw-r--r-- 2,826 bytes parent folder | download | duplicates (5)
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
# Copyright 2024 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/optimize_webui.gni")

assert(enable_glic)

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

  static_files = [
    "glic.css",
    "glic.html",
  ]

  ts_files = [
    "browser_proxy.ts",
    "glic_api/glic_api.ts",
    "glic_api_impl/conversions.ts",
    "glic_api_impl/glic_api_client.ts",
    "glic_api_impl/glic_api_host.ts",
    "glic_api_impl/glic_api_injected_client.ts",
    "glic_api_impl/post_message_transport.ts",
    "glic_api_impl/request_types.ts",
    "glic_app_controller.ts",
    "icons.html.ts",
    "main.ts",
    "observable.ts",
    "timer.ts",
    "webview.ts",
  ]

  webui_context_type = "trusted"
  ts_deps = [
    "//ui/webui/resources/cr_elements:build_ts",
    "//ui/webui/resources/js:build_ts",
    "//ui/webui/resources/mojo:build_ts",
  ]

  extra_grdp_deps = [ ":glic_api_injection_grdp" ]
  extra_grdp_files = [ "$target_gen_dir/glic_api_injection.grdp" ]

  mojo_files_deps = [
    "//chrome/browser/glic:mojo_bindings_ts__generator",
    "//components/content_settings/core/common:content_settings_types_ts__generator",
    "//components/optimization_guide/content/mojom:mojo_interfaces_ts__generator",
  ]
  mojo_files = [
    "$root_gen_dir/chrome/browser/glic/host/glic.mojom-webui.ts",
    "$root_gen_dir/components/content_settings/core/common/content_settings_types.mojom-webui.ts",
    "$root_gen_dir/components/optimization_guide/content/mojom/ai_page_content_metadata.mojom-webui.ts",
  ]

  ts_definitions = [
    "//tools/typescript/definitions/chrome_event.d.ts",
    "//tools/typescript/definitions/context_menus.d.ts",
    "//tools/typescript/definitions/extension_types.d.ts",
    "//tools/typescript/definitions/metrics_private.d.ts",
    "//tools/typescript/definitions/tabs.d.ts",
    "//tools/typescript/definitions/web_request.d.ts",
    "//tools/typescript/definitions/webview_tag.d.ts",
    "url_pattern.d.ts",
  ]

  ts_composite = true
}

# Build the API provided to the Glic web client. It needs to be built into a
# single js file and sent to the Glic web client at runtime.
glic_api_injection_manifest = "$target_gen_dir/glic_api_injection_manifest.json"
optimize_webui("glic_api_injection") {
  host = "about:blank"
  input = rebase_path("$target_gen_dir/tsc", root_build_dir)
  js_module_in_files = [ "glic_api_impl/glic_api_injected_client.js" ]
  out_manifest = "$glic_api_injection_manifest"
  deps = [ ":build_ts" ]
}

generate_grd("glic_api_injection_grdp") {
  manifest_files = [ "$glic_api_injection_manifest" ]
  deps = [ ":glic_api_injection" ]
  grd_prefix = "glic"
  out_grd = "$target_gen_dir/glic_api_injection.grdp"
}