Commit 0d911112 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Print Preview: Move PDF resources to a separate grd

Move Print Preview specific PDF resources to a separate grd file from
other resources for Print Preview.

This is in preparation for adding an assert in unpack_pak.py to prevent
unpacking any files in a pak file that are not under the root
directory.

Change-Id: I8145621439e5814383a33e837c6503d0f040eb4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2251100Reviewed-by: default avatardpapad <dpapad@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779973}
parent 8bb7b868
...@@ -1344,7 +1344,10 @@ group("extra_resources") { ...@@ -1344,7 +1344,10 @@ group("extra_resources") {
} }
if (enable_print_preview) { if (enable_print_preview) {
public_deps += [ "//chrome/browser/resources:print_preview_resources" ] public_deps += [
"//chrome/browser/resources:print_preview_pdf_resources",
"//chrome/browser/resources:print_preview_resources",
]
} }
} }
......
...@@ -424,16 +424,10 @@ if (enable_print_preview) { ...@@ -424,16 +424,10 @@ if (enable_print_preview) {
if (optimize_webui) { if (optimize_webui) {
source = "print_preview/print_preview_resources_vulcanized.grd" source = "print_preview/print_preview_resources_vulcanized.grd"
deps = [ deps = [ "//chrome/browser/resources/print_preview:build" ]
"//chrome/browser/resources/pdf/elements:web_components",
"//chrome/browser/resources/print_preview:build",
]
} else { } else {
source = "print_preview/print_preview_resources.grd" source = "print_preview/print_preview_resources.grd"
deps = [ deps = [ "//chrome/browser/resources/print_preview/ui:web_components" ]
"//chrome/browser/resources/pdf/elements:web_components",
"//chrome/browser/resources/print_preview/ui:web_components",
]
} }
defines = chrome_grit_defines defines = chrome_grit_defines
...@@ -445,6 +439,25 @@ if (enable_print_preview) { ...@@ -445,6 +439,25 @@ if (enable_print_preview) {
] ]
output_dir = "$root_gen_dir/chrome" output_dir = "$root_gen_dir/chrome"
} }
grit("print_preview_pdf_resources") {
grit_flags = [
"-E",
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
]
source = "print_preview/print_preview_pdf_resources.grd"
deps = [ "//chrome/browser/resources/pdf/elements:web_components" ]
defines = chrome_grit_defines
outputs = [
"grit/print_preview_pdf_resources.h",
"grit/print_preview_pdf_resources_map.cc",
"grit/print_preview_pdf_resources_map.h",
"print_preview_pdf_resources.pak",
]
output_dir = "$root_gen_dir/chrome"
}
} }
if (enable_webui_tab_strip) { if (enable_webui_tab_strip) {
......
<?xml version="1.0" encoding="UTF-8"?>
<grit latest_public_release="0" current_release="1" output_all_resource_defines="false">
<outputs>
<output filename="grit/print_preview_pdf_resources.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
<output filename="grit/print_preview_pdf_resources_map.cc"
type="resource_file_map_source" />
<output filename="grit/print_preview_pdf_resources_map.h"
type="resource_map_header" />
<output filename="print_preview_pdf_resources.pak" type="data_package" />
</outputs>
<release seq="1">
<includes>
<include name="IDR_PRINT_PREVIEW_PDF_INDEX_PP_HTML"
file="../pdf/index_pp.html"
type="BINDATA" />
<include name="IDR_PRINT_PREVIEW_PDF_MAIN_PP_JS"
file="../pdf/main_pp.js"
type="BINDATA" />
<include name="IDR_PRINT_PREVIEW_PDF_VIEWER_PAGE_INDICATOR_JS"
file="${root_gen_dir}/chrome/browser/resources/pdf/elements/viewer-page-indicator.js"
use_base_dir="false"
type="BINDATA" />
</includes>
</release>
</grit>
...@@ -147,16 +147,6 @@ ...@@ -147,16 +147,6 @@
<include name="IDR_PRINT_PREVIEW_UI_ICONS_JS" <include name="IDR_PRINT_PREVIEW_UI_ICONS_JS"
file="${root_gen_dir}/chrome/browser/resources/print_preview/ui/icons.js" file="${root_gen_dir}/chrome/browser/resources/print_preview/ui/icons.js"
use_base_dir="false" compress="false" type="BINDATA"/> use_base_dir="false" compress="false" type="BINDATA"/>
<include name="IDR_PRINT_PREVIEW_PDF_INDEX_PP_HTML"
file="../pdf/index_pp.html"
type="BINDATA" />
<include name="IDR_PRINT_PREVIEW_PDF_MAIN_PP_JS"
file="../pdf/main_pp.js"
type="BINDATA" />
<include name="IDR_PRINT_PREVIEW_PDF_VIEWER_PAGE_INDICATOR_JS"
file="${root_gen_dir}/chrome/browser/resources/pdf/elements/viewer-page-indicator.js"
use_base_dir="false"
type="BINDATA" />
</includes> </includes>
<structures> <structures>
<structure name="IDR_PRINT_PREVIEW_PRINT_PREVIEW_HTML" <structure name="IDR_PRINT_PREVIEW_PRINT_PREVIEW_HTML"
......
...@@ -21,16 +21,6 @@ ...@@ -21,16 +21,6 @@
use_base_dir="false" use_base_dir="false"
preprocess="true" preprocess="true"
type="BINDATA" /> type="BINDATA" />
<include name="IDR_PRINT_PREVIEW_PDF_INDEX_PP_HTML"
file="../pdf/index_pp.html"
type="BINDATA" />
<include name="IDR_PRINT_PREVIEW_PDF_MAIN_PP_JS"
file="../pdf/main_pp.js"
type="BINDATA" />
<include name="IDR_PRINT_PREVIEW_PDF_VIEWER_PAGE_INDICATOR_JS"
file="${root_gen_dir}/chrome/browser/resources/pdf/elements/viewer-page-indicator.js"
use_base_dir="false"
type="BINDATA" />
</includes> </includes>
</release> </release>
</grit> </grit>
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "chrome/grit/chromium_strings.h" #include "chrome/grit/chromium_strings.h"
#include "chrome/grit/component_extension_resources.h" #include "chrome/grit/component_extension_resources.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "chrome/grit/print_preview_pdf_resources.h"
#include "chrome/grit/print_preview_resources.h" #include "chrome/grit/print_preview_resources.h"
#include "chrome/grit/print_preview_resources_map.h" #include "chrome/grit/print_preview_resources_map.h"
#include "chromeos/constants/chromeos_features.h" #include "chromeos/constants/chromeos_features.h"
......
...@@ -223,8 +223,14 @@ template("chrome_extra_paks") { ...@@ -223,8 +223,14 @@ template("chrome_extra_paks") {
] ]
} }
if (enable_print_preview) { if (enable_print_preview) {
sources += [ "$root_gen_dir/chrome/print_preview_resources.pak" ] sources += [
deps += [ "//chrome/browser/resources:print_preview_resources" ] "$root_gen_dir/chrome/print_preview_pdf_resources.pak",
"$root_gen_dir/chrome/print_preview_resources.pak",
]
deps += [
"//chrome/browser/resources:print_preview_pdf_resources",
"//chrome/browser/resources:print_preview_resources",
]
} }
if (enable_webui_tab_strip) { if (enable_webui_tab_strip) {
sources += [ "$root_gen_dir/chrome/tab_strip_resources.pak" ] sources += [ "$root_gen_dir/chrome/tab_strip_resources.pak" ]
......
...@@ -159,6 +159,9 @@ ...@@ -159,6 +159,9 @@
"includes": [1700], "includes": [1700],
"structures": [1720], "structures": [1720],
}, },
"chrome/browser/resources/print_preview/print_preview_pdf_resources.grd": {
"includes": [1730],
},
"chrome/browser/resources/settings/os_settings_resources_vulcanized.grd": { "chrome/browser/resources/settings/os_settings_resources_vulcanized.grd": {
"includes": [1740], "includes": [1740],
}, },
......
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