Commit 72743413 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Bluetooth Pairing Dialog: Update to preprocess_grit/generated grd files

Bug: 1132403
Change-Id: I5325a3d5c2c8bf9698fc2621cf866fcc50374a99
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2488678
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: default avatardpapad <dpapad@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819470}
parent f229bd96
......@@ -477,21 +477,22 @@ if (is_chromeos) {
grit_flags = [
"-E",
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
"-E",
"root_src_dir=" + rebase_path("//", root_build_dir),
]
if (optimize_webui) {
source = "chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog_resources_vulcanized.grd"
defines = chrome_grit_defines
# These arguments are needed since the grd is generated at build time.
enable_input_discovery_for_gn_analyze = false
defines += [ "SHARED_INTERMEDIATE_DIR=" +
rebase_path(root_gen_dir, root_build_dir) ]
bluetooth_gen_dir = "$root_gen_dir/chrome/browser/resources/chromeos/bluetooth_pairing_dialog"
source = "$bluetooth_gen_dir/bluetooth_pairing_dialog_resources.grd"
deps = [
"//chrome/browser/resources/chromeos/bluetooth_pairing_dialog:build",
"//chrome/browser/resources/chromeos/bluetooth_pairing_dialog:build_grd",
]
} else {
source = "chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog_resources.grd"
deps = [ "//chrome/browser/resources/chromeos/bluetooth_pairing_dialog:web_components" ]
}
defines = chrome_grit_defines
outputs = [
"grit/bluetooth_pairing_dialog_resources.h",
"grit/bluetooth_pairing_dialog_resources_map.cc",
......
......@@ -4,54 +4,55 @@
import("//chrome/common/features.gni")
import("//third_party/closure_compiler/compile_js.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/grit/preprocess_grit.gni")
import("//tools/polymer/html_to_js.gni")
import("//tools/polymer/polymer.gni")
import("//ui/webui/resources/tools/js_modulizer.gni")
import("//ui/webui/resources/tools/generate_grd.gni")
import("../../optimize_webui.gni")
preprocess_folder = "preprocessed"
preprocess_gen_manifest = "preprocessed_gen_manifest.json"
if (optimize_webui) {
bluetooth_dialog_pak_file = "bluetooth_pairing_dialog_resources.pak"
unpak_folder = "bluetooth_pairing_dialog_resources.unpak"
build_manifest = "build_manifest.json"
optimize_webui("build") {
host = "bluetooth-pairing"
js_out_files = [ "bluetooth_pairing_dialog.rollup.js" ]
js_module_in_files = [ "bluetooth_pairing_dialog.js" ]
input = rebase_path("$target_gen_dir/$unpak_folder", root_build_dir)
input = rebase_path("$target_gen_dir/$preprocess_folder", root_build_dir)
out_manifest = "$target_gen_dir/$build_manifest"
deps = [
":unpak",
":preprocess_generated",
"../../../../../ui/webui/resources:preprocess",
]
excludes = [ "chrome://resources/js/cr.m.js" ]
}
}
unpak("unpak") {
pak_file = bluetooth_dialog_pak_file
out_folder = unpak_folder
deps = [ ":flattened_resources" ]
generate_grd("build_grd") {
input_files = [ "bluetooth_pairing_dialog_container.html" ]
input_files_base_dir = rebase_path(".", "//")
if (optimize_webui) {
deps = [ ":build" ]
resource_path_rewrites =
[ "bluetooth_pairing_dialog.rollup.js|bluetooth_pairing_dialog.js" ]
manifest_files = [ "$target_gen_dir/$build_manifest" ]
} else {
deps = [ ":preprocess_generated" ]
manifest_files = [ "$target_gen_dir/$preprocess_gen_manifest" ]
}
grd_prefix = "bluetooth_pairing_dialog"
out_grd = "$target_gen_dir/${grd_prefix}_resources.grd"
}
grit("flattened_resources") {
source = "bluetooth_pairing_dialog_resources.grd"
preprocess_grit("preprocess_generated") {
deps = [ ":web_components" ]
defines = chrome_grit_defines
grit_flags = [
"-E",
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
]
outputs = [
"grit/bluetooth_pairing_dialog_resources.h",
"grit/bluetooth_pairing_dialog_resources_map.cc",
"grit/bluetooth_pairing_dialog_resources_map.h",
bluetooth_dialog_pak_file,
]
output_dir = "$root_gen_dir/chrome/browser/resources/chromeos/bluetooth_pairing_dialog"
}
in_folder = target_gen_dir
out_folder = "$target_gen_dir/$preprocess_folder"
out_manifest = "$target_gen_dir/$preprocess_gen_manifest"
in_files = [ "bluetooth_pairing_dialog.js" ]
}
js_type_check("closure_compile") {
......
<?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_pairing_dialog_resources.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
<output filename="grit/bluetooth_pairing_dialog_resources_map.cc"
type="resource_file_map_source" />
<output filename="grit/bluetooth_pairing_dialog_resources_map.h"
type="resource_map_header" />
<output filename="bluetooth_pairing_dialog_resources.pak" type="data_package" />
</outputs>
<release seq="1">
<includes>
<include name="IDR_BLUETOOTH_PAIRING_DIALOG_JS"
file="${root_gen_dir}/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog.js"
use_base_dir="false"
compress="false"
type="chrome_html" />
</includes>
<structures>
<structure name="IDR_BLUETOOTH_PAIRING_DIALOG_CONTAINER_HTML"
file="bluetooth_pairing_dialog_container.html"
compress="false"
type="chrome_html" />
</structures>
</release>
</grit>
\ No newline at end of file
<?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_pairing_dialog_resources.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
<output filename="grit/bluetooth_pairing_dialog_resources_map.cc"
type="resource_map_source" />
<output filename="grit/bluetooth_pairing_dialog_resources_map.h"
type="resource_map_header" />
<output filename="bluetooth_pairing_dialog_resources.pak" type="data_package" />
</outputs>
<release seq="1">
<includes>
<include name="IDR_BLUETOOTH_PAIRING_DIALOG_CONTAINER_HTML"
file="bluetooth_pairing_dialog_container.html"
type="chrome_html" />
<include name="IDR_BLUETOOTH_PAIRING_DIALOG_ROLLUP_JS"
file="${root_gen_dir}\chrome\browser\resources\chromeos\bluetooth_pairing_dialog\bluetooth_pairing_dialog.rollup.js"
use_base_dir="false"
preprocess="true"
type="chrome_html" />
</includes>
</release>
</grit>
......@@ -23,14 +23,6 @@ namespace chromeos {
namespace {
#if !BUILDFLAG(OPTIMIZE_WEBUI)
namespace {
const char kGeneratedPath[] =
"@out_folder@/gen/chrome/browser/resources/chromeos/"
"bluetooth_pairing_dialog/";
}
#endif
constexpr int kBluetoothPairingDialogHeight = 375;
void AddBluetoothStrings(content::WebUIDataSource* html_source) {
......@@ -114,18 +106,12 @@ BluetoothPairingDialogUI::BluetoothPairingDialogUI(content::WebUI* web_ui)
AddBluetoothStrings(source);
source->AddLocalizedString("title", IDS_SETTINGS_BLUETOOTH_PAIR_DEVICE_TITLE);
#if BUILDFLAG(OPTIMIZE_WEBUI)
webui::SetupBundledWebUIDataSource(
source, "bluetooth_pairing_dialog.js",
IDR_BLUETOOTH_PAIRING_DIALOG_ROLLUP_JS,
IDR_BLUETOOTH_PAIRING_DIALOG_CONTAINER_HTML);
#else
webui::SetupWebUIDataSource(
source,
base::make_span(kBluetoothPairingDialogResources,
kBluetoothPairingDialogResourcesSize),
kGeneratedPath, IDR_BLUETOOTH_PAIRING_DIALOG_CONTAINER_HTML);
#endif
std::string(),
IDR_BLUETOOTH_PAIRING_DIALOG_BLUETOOTH_PAIRING_DIALOG_CONTAINER_HTML);
content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source);
}
......
......@@ -225,12 +225,9 @@
"chrome/browser/resources/bluetooth_internals/resources.grd": {
"includes": [2020],
},
"chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog_resources.grd": {
"<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog_resources.grd": {
"META": {"sizes": {"includes": [10],}},
"includes": [2030],
"structures": [2050],
},
"chrome/browser/resources/chromeos/bluetooth_pairing_dialog/bluetooth_pairing_dialog_resources_vulcanized.grd": {
"includes": [2070],
},
"chrome/browser/resources/gaia_auth_host/gaia_auth_host_resources.grd": {
"includes": [2080],
......
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