Commit 66fc158e authored by Tibor Goldschwendt's avatar Tibor Goldschwendt Committed by Commit Bot

Add grit target for bluetooth about pages

Move the resources for the internal bluetooth about pages out of the
browser_resources.grd and into a newly created GRD file. Add grit target
for the new GRD file. This CL prepares moving the resulting PAK file
into the dev UI DFM on Android.

Bug: 955494
Change-Id: I3a12c92d977c39ca65b61b6c6022c5f229cc9434
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1709999
Commit-Queue: Tibor Goldschwendt <tiborg@chromium.org>
Auto-Submit: Tibor Goldschwendt <tiborg@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarSamuel Huang <huangs@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681455}
parent b6af647b
...@@ -1636,6 +1636,7 @@ group("extra_resources") { ...@@ -1636,6 +1636,7 @@ group("extra_resources") {
"//chrome/browser/resources:net_internals_resources", "//chrome/browser/resources:net_internals_resources",
"//chrome/browser/resources:quota_internals_resources", "//chrome/browser/resources:quota_internals_resources",
"//chrome/browser/resources:webapks_ui_resources", "//chrome/browser/resources:webapks_ui_resources",
"//chrome/browser/resources/bluetooth_internals:resources",
"//components/autofill/core/browser:autofill_address_rewriter_resources", "//components/autofill/core/browser:autofill_address_rewriter_resources",
] ]
......
...@@ -137,28 +137,6 @@ ...@@ -137,28 +137,6 @@
<include name="IDR_ACCESSIBILITY_CSS" file="resources\accessibility\accessibility.css" compress="gzip" type="BINDATA" /> <include name="IDR_ACCESSIBILITY_CSS" file="resources\accessibility\accessibility.css" compress="gzip" type="BINDATA" />
<include name="IDR_ACCESSIBILITY_JS" file="resources\accessibility\accessibility.js" flattenhtml="true" compress="gzip" type="BINDATA" /> <include name="IDR_ACCESSIBILITY_JS" file="resources\accessibility\accessibility.js" flattenhtml="true" compress="gzip" type="BINDATA" />
<include name="IDR_AD_NETWORK_HASHES" file="resources\ad_networks.dat" type="BINDATA" /> <include name="IDR_AD_NETWORK_HASHES" file="resources\ad_networks.dat" type="BINDATA" />
<include name="IDR_BLUETOOTH_ADAPTER_MOJO_JS" file="${root_gen_dir}\device\bluetooth\public\mojom\adapter.mojom-lite.js" use_base_dir="false" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_DEVICE_MOJO_JS" file="${root_gen_dir}\device\bluetooth\public\mojom\device.mojom-lite.js" use_base_dir="false" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_UUID_MOJO_JS" file="${root_gen_dir}\device\bluetooth\public\mojom\uuid.mojom-lite.js" use_base_dir="false" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_CSS" file="resources\bluetooth_internals\bluetooth_internals.css" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_ADAPTER_BROKER_JS" file="resources\bluetooth_internals\adapter_broker.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_ADAPTER_PAGE_JS" file="resources\bluetooth_internals\adapter_page.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_CHARACTERISTIC_LIST_JS" file="resources\bluetooth_internals\characteristic_list.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_DESCRIPTOR_LIST_JS" file="resources\bluetooth_internals\descriptor_list.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_DEVICE_BROKER_JS" file="resources\bluetooth_internals\device_broker.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_DEVICE_COLLECTION_JS" file="resources\bluetooth_internals\device_collection.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_DEVICE_DETAILS_PAGE_JS" file="resources\bluetooth_internals\device_details_page.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_DEVICE_TABLE_JS" file="resources\bluetooth_internals\device_table.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_DEVICES_PAGE_JS" file="resources\bluetooth_internals\devices_page.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_EXPANDABLE_LIST_JS" file="resources\bluetooth_internals\expandable_list.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_HTML" file="resources\bluetooth_internals\bluetooth_internals.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_JS" file="resources\bluetooth_internals\bluetooth_internals.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_MOJO_JS" file="${root_gen_dir}\chrome\browser\ui\webui\bluetooth_internals\bluetooth_internals.mojom-lite.js" use_base_dir="false" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_OBJECT_FIELDSET_JS" file="resources\bluetooth_internals\object_fieldset.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_SERVICE_LIST_JS" file="resources\bluetooth_internals\service_list.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_SIDEBAR_JS" file="resources\bluetooth_internals\sidebar.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_SNACKBAR_JS" file="resources\bluetooth_internals\snackbar.js" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_VALUE_CONTROL_JS" file="resources\bluetooth_internals\value_control.js" type="BINDATA" compress="gzip" />
<if expr="is_posix and not is_macosx"> <if expr="is_posix and not is_macosx">
<include name="IDR_CERTIFICATE_VIEWER_HTML" file="resources\certificate_viewer.html" type="BINDATA" /> <include name="IDR_CERTIFICATE_VIEWER_HTML" file="resources\certificate_viewer.html" type="BINDATA" />
<include name="IDR_CERTIFICATE_VIEWER_JS" file="resources\certificate_viewer.js" type="BINDATA" /> <include name="IDR_CERTIFICATE_VIEWER_JS" file="resources\certificate_viewer.js" type="BINDATA" />
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# found in the LICENSE file. # found in the LICENSE file.
import("//third_party/closure_compiler/compile_js.gni") import("//third_party/closure_compiler/compile_js.gni")
import("//tools/grit/grit_rule.gni")
js_type_check("closure_compile") { js_type_check("closure_compile") {
deps = [ deps = [
...@@ -41,3 +42,25 @@ js_library("bluetooth_internals") { ...@@ -41,3 +42,25 @@ js_library("bluetooth_internals") {
"//ui/webui/resources/js/cr/ui/page_manager:page_manager", "//ui/webui/resources/js/cr/ui/page_manager:page_manager",
] ]
} }
grit("resources") {
source = "resources.grd"
# The .grd contains references to generated files.
source_is_generated = true
outputs = [
"grit/bluetooth_internals_resources.h",
"grit/bluetooth_internals_resources_map.h",
"grit/bluetooth_internals_resources_map.cc",
"bluetooth_internals_resources.pak",
]
output_dir = "$root_gen_dir/chrome"
depfile_dir = target_gen_dir
grit_flags = [
"-E",
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
]
deps = [
"//chrome/browser/ui/webui/bluetooth_internals:mojo_bindings_js",
]
}
<?xml version="1.0" encoding="UTF-8"?>
<grit latest_public_release="0"
current_release="1"
output_all_resource_defines="false">
<outputs>
<output filename="grit/bluetooth_internals_resources.h"
type="rc_header">
<emit emit_type='prepend'></emit>
</output>
<output filename="grit/bluetooth_internals_resources_map.cc"
type="resource_file_map_source" />
<output filename="grit/bluetooth_internals_resources_map.h"
type="resource_map_header" />
<output filename="bluetooth_internals_resources.pak"
type="data_package" />
</outputs>
<release seq="1">
<includes>
<include name="IDR_BLUETOOTH_INTERNALS_ADAPTER_BROKER_JS"
file="adapter_broker.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_ADAPTER_MOJO_JS"
file="${root_gen_dir}\device\bluetooth\public\mojom\adapter.mojom-lite.js"
use_base_dir="false"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_ADAPTER_PAGE_JS"
file="adapter_page.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_CHARACTERISTIC_LIST_JS"
file="characteristic_list.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_CSS"
file="bluetooth_internals.css"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_DESCRIPTOR_LIST_JS"
file="descriptor_list.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_DEVICE_BROKER_JS"
file="device_broker.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_DEVICE_COLLECTION_JS"
file="device_collection.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_DEVICE_DETAILS_PAGE_JS"
file="device_details_page.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_DEVICE_MOJO_JS"
file="${root_gen_dir}\device\bluetooth\public\mojom\device.mojom-lite.js"
use_base_dir="false"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_DEVICE_TABLE_JS"
file="device_table.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_DEVICES_PAGE_JS"
file="devices_page.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_EXPANDABLE_LIST_JS"
file="expandable_list.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_HTML"
file="bluetooth_internals.html"
flattenhtml="true"
allowexternalscript="true"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_JS"
file="bluetooth_internals.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_MOJO_JS"
file="${root_gen_dir}\chrome\browser\ui\webui\bluetooth_internals\bluetooth_internals.mojom-lite.js"
use_base_dir="false"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_OBJECT_FIELDSET_JS"
file="object_fieldset.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_SERVICE_LIST_JS"
file="service_list.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_SIDEBAR_JS"
file="sidebar.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_SNACKBAR_JS"
file="snackbar.js"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_UUID_MOJO_JS"
file="${root_gen_dir}\device\bluetooth\public\mojom\uuid.mojom-lite.js"
use_base_dir="false"
type="BINDATA"
compress="gzip" />
<include name="IDR_BLUETOOTH_INTERNALS_VALUE_CONTROL_JS"
file="value_control.js"
type="BINDATA"
compress="gzip" />
</includes>
</release>
</grit>
...@@ -18,6 +18,7 @@ source_set("bluetooth_internals") { ...@@ -18,6 +18,7 @@ source_set("bluetooth_internals") {
deps = [ deps = [
":mojo_bindings", ":mojo_bindings",
"//chrome/browser/resources/bluetooth_internals:resources",
"//chrome/common", "//chrome/common",
"//content/public/browser", "//content/public/browser",
"//device/bluetooth", "//device/bluetooth",
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals_handler.h" #include "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals_handler.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h" #include "chrome/grit/bluetooth_internals_resources.h"
#include "chrome/grit/bluetooth_internals_resources_map.h"
#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_data_source.h"
BluetoothInternalsUI::BluetoothInternalsUI(content::WebUI* web_ui) BluetoothInternalsUI::BluetoothInternalsUI(content::WebUI* web_ui)
...@@ -19,48 +20,17 @@ BluetoothInternalsUI::BluetoothInternalsUI(content::WebUI* web_ui) ...@@ -19,48 +20,17 @@ BluetoothInternalsUI::BluetoothInternalsUI(content::WebUI* web_ui)
// Add required resources. // Add required resources.
html_source->AddResourcePath("adapter.mojom-lite.js", html_source->AddResourcePath("adapter.mojom-lite.js",
IDR_BLUETOOTH_ADAPTER_MOJO_JS); IDR_BLUETOOTH_INTERNALS_ADAPTER_MOJO_JS);
html_source->AddResourcePath("adapter_broker.js", html_source->AddResourcePath("device.mojom-lite.js",
IDR_BLUETOOTH_INTERNALS_ADAPTER_BROKER_JS); IDR_BLUETOOTH_INTERNALS_DEVICE_MOJO_JS);
html_source->AddResourcePath("adapter_page.js",
IDR_BLUETOOTH_INTERNALS_ADAPTER_PAGE_JS);
html_source->AddResourcePath("bluetooth_internals.css",
IDR_BLUETOOTH_INTERNALS_CSS);
html_source->AddResourcePath("bluetooth_internals.js",
IDR_BLUETOOTH_INTERNALS_JS);
html_source->AddResourcePath("bluetooth_internals.mojom-lite.js", html_source->AddResourcePath("bluetooth_internals.mojom-lite.js",
IDR_BLUETOOTH_INTERNALS_MOJO_JS); IDR_BLUETOOTH_INTERNALS_MOJO_JS);
html_source->AddResourcePath("characteristic_list.js",
IDR_BLUETOOTH_INTERNALS_CHARACTERISTIC_LIST_JS);
html_source->AddResourcePath("descriptor_list.js",
IDR_BLUETOOTH_INTERNALS_DESCRIPTOR_LIST_JS);
html_source->AddResourcePath("device.mojom-lite.js",
IDR_BLUETOOTH_DEVICE_MOJO_JS);
html_source->AddResourcePath("device_broker.js",
IDR_BLUETOOTH_INTERNALS_DEVICE_BROKER_JS);
html_source->AddResourcePath("device_collection.js",
IDR_BLUETOOTH_INTERNALS_DEVICE_COLLECTION_JS);
html_source->AddResourcePath("device_details_page.js",
IDR_BLUETOOTH_INTERNALS_DEVICE_DETAILS_PAGE_JS);
html_source->AddResourcePath("device_table.js",
IDR_BLUETOOTH_INTERNALS_DEVICE_TABLE_JS);
html_source->AddResourcePath("devices_page.js",
IDR_BLUETOOTH_INTERNALS_DEVICES_PAGE_JS);
html_source->AddResourcePath("expandable_list.js",
IDR_BLUETOOTH_INTERNALS_EXPANDABLE_LIST_JS);
html_source->AddResourcePath("object_fieldset.js",
IDR_BLUETOOTH_INTERNALS_OBJECT_FIELDSET_JS);
html_source->AddResourcePath("service_list.js",
IDR_BLUETOOTH_INTERNALS_SERVICE_LIST_JS);
html_source->AddResourcePath("sidebar.js",
IDR_BLUETOOTH_INTERNALS_SIDEBAR_JS);
html_source->AddResourcePath("snackbar.js",
IDR_BLUETOOTH_INTERNALS_SNACKBAR_JS);
html_source->AddResourcePath("uuid.mojom-lite.js", html_source->AddResourcePath("uuid.mojom-lite.js",
IDR_BLUETOOTH_UUID_MOJO_JS); IDR_BLUETOOTH_INTERNALS_UUID_MOJO_JS);
html_source->AddResourcePath("value_control.js", for (size_t i = 0; i < kBluetoothInternalsResourcesSize; i++) {
IDR_BLUETOOTH_INTERNALS_VALUE_CONTROL_JS); html_source->AddResourcePath(kBluetoothInternalsResources[i].name,
kBluetoothInternalsResources[i].value);
}
html_source->SetDefaultResource(IDR_BLUETOOTH_INTERNALS_HTML); html_source->SetDefaultResource(IDR_BLUETOOTH_INTERNALS_HTML);
Profile* profile = Profile::FromWebUI(web_ui); Profile* profile = Profile::FromWebUI(web_ui);
......
...@@ -91,6 +91,7 @@ template("chrome_extra_paks") { ...@@ -91,6 +91,7 @@ template("chrome_extra_paks") {
]) ])
output = "${invoker.output_dir}/resources.pak" output = "${invoker.output_dir}/resources.pak"
sources = [ sources = [
"$root_gen_dir/chrome/bluetooth_internals_resources.pak",
"$root_gen_dir/chrome/browser_resources.pak", "$root_gen_dir/chrome/browser_resources.pak",
"$root_gen_dir/chrome/chrome_unscaled_resources.pak", "$root_gen_dir/chrome/chrome_unscaled_resources.pak",
"$root_gen_dir/chrome/common_resources.pak", "$root_gen_dir/chrome/common_resources.pak",
...@@ -112,6 +113,7 @@ template("chrome_extra_paks") { ...@@ -112,6 +113,7 @@ template("chrome_extra_paks") {
"//chrome/browser/resources:invalidations_resources", "//chrome/browser/resources:invalidations_resources",
"//chrome/browser/resources:net_internals_resources", "//chrome/browser/resources:net_internals_resources",
"//chrome/browser/resources:quota_internals_resources", "//chrome/browser/resources:quota_internals_resources",
"//chrome/browser/resources/bluetooth_internals:resources",
"//chrome/common:resources", "//chrome/common:resources",
"//components/autofill/core/browser:autofill_address_rewriter_resources", "//components/autofill/core/browser:autofill_address_rewriter_resources",
"//components/resources", "//components/resources",
......
...@@ -81,7 +81,10 @@ ...@@ -81,7 +81,10 @@
# START chrome/browser section. # START chrome/browser section.
"chrome/browser/browser_resources.grd": { "chrome/browser/browser_resources.grd": {
"includes": [11000], "includes": [11000],
"structures": [11850], "structures": [11800],
},
"chrome/browser/resources/bluetooth_internals/resources.grd": {
"includes": [11870],
}, },
"chrome/browser/resources/chromeos/camera/camera_resources.grd": { "chrome/browser/resources/chromeos/camera/camera_resources.grd": {
"includes": [11930], "includes": [11930],
......
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