Commit f5ddb232 authored by dpapad's avatar dpapad Committed by Chromium LUCI CQ

WebUI: Auto-generate grd file for chrome://invalidations.

In the process, removed flattenhtml=true to stop inlining
about_invalidations.css, and serving it from its own URL
instead.

Bug: 1132403
Change-Id: Ief759ba6c33303d2d955b853ffa44de3de467642
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2611328
Auto-Submit: dpapad <dpapad@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Commit-Queue: dpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840528}
parent 49cbbd93
......@@ -4,12 +4,28 @@
import("//chrome/common/features.gni")
import("//tools/grit/grit_rule.gni")
import("//ui/webui/resources/tools/generate_grd.gni")
generate_grd("build_grd") {
grd_prefix = "invalidations"
out_grd = "$target_gen_dir/resources.grd"
input_files = [
"about_invalidations.css",
"about_invalidations.html",
"about_invalidations.js",
]
input_files_base_dir = rebase_path(".", "//")
}
grit("invalidations_resources") {
source = "invalidations_resources.grd"
source = "$target_gen_dir/resources.grd"
deps = [ ":build_grd" ]
enable_input_discovery_for_gn_analyze = false
defines = chrome_grit_defines
outputs = [
"grit/invalidations_resources.h",
"grit/invalidations_resources_map.h",
"grit/invalidations_resources_map.cc",
"invalidations_resources.pak",
]
output_dir = "$root_gen_dir/chrome"
......
<?xml version="1.0" encoding="UTF-8"?>
<grit latest_public_release="0" current_release="1" output_all_resource_defines="false">
<outputs>
<output filename="grit/invalidations_resources.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
<output filename="invalidations_resources.pak" type="data_package" />
</outputs>
<release seq="1">
<includes>
<include name="IDR_ABOUT_INVALIDATIONS_HTML" file="about_invalidations.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_ABOUT_INVALIDATIONS_JS" file="about_invalidations.js" type="BINDATA" />
<include name="IDR_ABOUT_INVALIDATIONS_CSS" file="about_invalidations.css" type="BINDATA" />
</includes>
</release>
</grit>
......@@ -26,8 +26,11 @@ content::WebUIDataSource* CreateInvalidationsHTMLSource() {
source->OverrideContentSecurityPolicy(
network::mojom::CSPDirectiveName::TrustedTypes,
"trusted-types jstemplate;");
source->AddResourcePath("about_invalidations.js", IDR_ABOUT_INVALIDATIONS_JS);
source->SetDefaultResource(IDR_ABOUT_INVALIDATIONS_HTML);
source->AddResourcePath("about_invalidations.js",
IDR_INVALIDATIONS_ABOUT_INVALIDATIONS_JS);
source->AddResourcePath("about_invalidations.css",
IDR_INVALIDATIONS_ABOUT_INVALIDATIONS_CSS);
source->SetDefaultResource(IDR_INVALIDATIONS_ABOUT_INVALIDATIONS_HTML);
return source;
}
......
......@@ -238,7 +238,8 @@
"META": {"sizes": {"includes": [10],}},
"includes": [2080],
},
"chrome/browser/resources/invalidations/invalidations_resources.grd": {
"<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/invalidations/resources.grd": {
"META": {"sizes": {"includes": [10],}},
"includes": [2090],
},
"chrome/browser/resources/media/webrtc_logs_resources.grd": {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment