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"
}
|