Commit 5012d348 authored by dpapad's avatar dpapad Committed by Chromium LUCI CQ

New Tab Page: Auto-generate grd files.

Bug: 1132403
Change-Id: I013ec9272dfb73fd0ccc1c205397d561be65c84a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2581441
Commit-Queue: Esmael Elmoslimany <aee@chromium.org>
Auto-Submit: dpapad <dpapad@chromium.org>
Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836213}
parent 59672761
...@@ -22,12 +22,12 @@ group("resources") { ...@@ -22,12 +22,12 @@ group("resources") {
":component_extension_resources", ":component_extension_resources",
":dev_ui_paks", ":dev_ui_paks",
":local_ntp_resources", ":local_ntp_resources",
":new_tab_page_resources",
"bookmarks:bookmarks_resources", "bookmarks:bookmarks_resources",
"commander:commander_resources", "commander:commander_resources",
"downloads:downloads_resources", "downloads:downloads_resources",
"gaia_auth_host:resources", "gaia_auth_host:resources",
"history:history_resources", "history:history_resources",
"new_tab_page:resources",
"read_later:read_later_resources", "read_later:read_later_resources",
"settings:settings_resources", "settings:settings_resources",
"tab_search:tab_search_resources", "tab_search:tab_search_resources",
...@@ -200,39 +200,6 @@ if (!is_android) { ...@@ -200,39 +200,6 @@ if (!is_android) {
output_dir = "$root_gen_dir/chrome" output_dir = "$root_gen_dir/chrome"
} }
grit("new_tab_page_resources") {
if (optimize_webui) {
source = "new_tab_page/new_tab_page_resources_vulcanized.grd"
} else {
source = "new_tab_page/new_tab_page_resources.grd"
}
deps = [
"//chrome/browser/promo_browser_command:mojo_bindings_js",
"//chrome/browser/search/task_module:mojo_bindings_js",
"//chrome/browser/ui/webui/new_tab_page:mojo_bindings_js",
"//skia/public/mojom:mojom_js",
]
if (!is_official_build) {
deps += [ "//chrome/browser/ui/webui/new_tab_page/foo:mojo_bindings_js" ]
}
if (optimize_webui) {
deps += [ "//chrome/browser/resources/new_tab_page:optimized_js" ]
} else {
deps += [ "//chrome/browser/resources/new_tab_page:web_components" ]
}
defines = chrome_grit_defines + [ "is_official_build=$is_official_build" ]
outputs = [
"grit/new_tab_page_resources.h",
"grit/new_tab_page_resources_map.cc",
"grit/new_tab_page_resources_map.h",
"new_tab_page_resources.pak",
]
output_dir = "$root_gen_dir/chrome"
}
if (is_chrome_branded) { if (is_chrome_branded) {
grit("preinstalled_web_apps_resources") { grit("preinstalled_web_apps_resources") {
source = "preinstalled_web_apps/resources.grd" source = "preinstalled_web_apps/resources.grd"
......
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
import("//chrome/browser/resources/optimize_webui.gni") import("//chrome/browser/resources/optimize_webui.gni")
import("//chrome/common/features.gni") import("//chrome/common/features.gni")
import("//third_party/closure_compiler/compile_js.gni") import("//third_party/closure_compiler/compile_js.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/grit/preprocess_if_expr.gni") import("//tools/grit/preprocess_if_expr.gni")
import("//tools/polymer/html_to_js.gni") import("//tools/polymer/html_to_js.gni")
import("//ui/webui/resources/tools/generate_grd.gni")
import("//ui/webui/webui_features.gni") import("//ui/webui/webui_features.gni")
js_type_check("closure_compile") { js_type_check("closure_compile") {
...@@ -278,52 +280,177 @@ group("web_components") { ...@@ -278,52 +280,177 @@ group("web_components") {
] ]
} }
grd_prefix = "new_tab_page"
preprocess_folder = "preprocessed"
preprocess_manifest = "preprocessed_manifest.json"
preprocess_gen_manifest = "preprocessed_gen_manifest.json"
if (optimize_webui) { if (optimize_webui) {
preprocess_folder = "preprocessed" build_manifest = "build_manifest.json"
}
preprocess_if_expr("preprocess") {
defines = [ "is_official_build=$is_official_build" ] preprocess_if_expr("preprocess") {
in_folder = "./" defines = [ "is_official_build=$is_official_build" ]
out_folder = "$target_gen_dir/$preprocess_folder" in_folder = "./"
in_files = [ out_folder = "$target_gen_dir/$preprocess_folder"
"background_manager.js", out_manifest = "$target_gen_dir/$preprocess_manifest"
"browser_proxy.js", in_files = [
"img.js", "background_manager.js",
"lazy_load.js", "browser_proxy.js",
"customize_dialog_types.js", "img.js",
"new_tab_page.js", "lazy_load.js",
"one_google_bar_api.js", "customize_dialog_types.js",
"promo_browser_command_proxy.js", "new_tab_page.js",
"utils.js", "promo_browser_command_proxy.js",
] "utils.js",
]
}
preprocess_if_expr("preprocess_gen") {
deps = [ ":web_components" ]
defines = [ "is_official_build=$is_official_build" ]
in_folder = target_gen_dir
out_folder = "$target_gen_dir/$preprocess_folder"
out_manifest = "$target_gen_dir/$preprocess_gen_manifest"
in_files = [
"app.js",
"middle_slot_promo.js",
"most_visited.js",
"customize_dialog.js",
"voice_search_overlay.js",
"customize_backgrounds.js",
"customize_modules.js",
"customize_shortcuts.js",
"iframe.js",
"mini_page.js",
"fakebox.js",
"logo.js",
"doodle_share_dialog.js",
"realbox.js",
"realbox_dropdown.js",
"realbox_icon.js",
"realbox_match.js",
]
}
generate_grd("build_new_tab_page_mojo_grdp") {
grd_prefix = grd_prefix
out_grd = "$target_gen_dir/new_tab_page_mojo_resources.grdp"
input_files = [ "new_tab_page.mojom-lite.js" ]
if (!is_official_build) {
input_files += [ "foo/foo.mojom-lite.js" ]
resource_path_rewrites = [ "foo/foo.mojom-lite.js|foo.mojom-lite.js" ]
} }
input_files_base_dir =
rebase_path("$root_gen_dir/chrome/browser/ui/webui/new_tab_page",
root_build_dir)
}
generate_grd("build_promo_browser_command_mojo_grdp") {
grd_prefix = grd_prefix
out_grd = "$target_gen_dir/promo_browser_command_mojo_resources.grdp"
input_files = [ "promo_browser_command.mojom-lite.js" ]
input_files_base_dir =
rebase_path("$root_gen_dir/chrome/browser/promo_browser_command",
root_build_dir)
}
generate_grd("build_search_mojo_grdp") {
grd_prefix = grd_prefix
out_grd = "$target_gen_dir/search_mojo_resources.grdp"
input_files = [ "omnibox.mojom-lite.js" ]
input_files_base_dir =
rebase_path("$root_gen_dir/chrome/common/search", root_build_dir)
}
generate_grd("build_task_module_mojo_grdp") {
grd_prefix = grd_prefix
out_grd = "$target_gen_dir/task_module_mojo_resources.grdp"
input_files = [ "task_module.mojom-lite.js" ]
input_files_base_dir =
rebase_path("$root_gen_dir/chrome/browser/search/task_module",
root_build_dir)
resource_path_prefix = "modules/task_module"
}
preprocess_if_expr("preprocess_gen") { generate_grd("build_grd") {
deps = [ ":web_components" ] grd_prefix = grd_prefix
defines = [ "is_official_build=$is_official_build" ] out_grd = "$target_gen_dir/resources.grd"
in_folder = target_gen_dir input_files = [
out_folder = "$target_gen_dir/$preprocess_folder" "new_tab_page.html",
in_files = [ "shared_vars.css",
"app.js", "one_google_bar_api.js",
"middle_slot_promo.js", "untrusted/background_image.html",
"most_visited.js", "untrusted/background_image.js",
"customize_dialog.js", "untrusted/image.html",
"voice_search_overlay.js", "untrusted/one_google_bar.html",
"customize_backgrounds.js", "untrusted/one_google_bar.js",
"customize_modules.js", ]
"customize_shortcuts.js", input_files_base_dir = rebase_path(".", "//")
"iframe.js",
"mini_page.js", grdp_files = [
"fakebox.js", "$target_gen_dir/icons/resources.grdp",
"logo.js", "$target_gen_dir/new_tab_page_mojo_resources.grdp",
"doodle_share_dialog.js", "$target_gen_dir/promo_browser_command_mojo_resources.grdp",
"realbox.js", "$target_gen_dir/search_mojo_resources.grdp",
"realbox_dropdown.js", "$target_gen_dir/task_module_mojo_resources.grdp",
"realbox_icon.js", ]
"realbox_match.js", deps = [
":build_new_tab_page_mojo_grdp",
":build_promo_browser_command_mojo_grdp",
":build_search_mojo_grdp",
":build_task_module_mojo_grdp",
"icons:build_grdp",
]
if (optimize_webui) {
deps += [ ":optimized_js" ]
resource_path_rewrites = [
"new_tab_page.rollup.js|new_tab_page.js",
"lazy_load.rollup.js|lazy_load.js",
] ]
manifest_files = [ "$target_gen_dir/$build_manifest" ]
} else {
deps += [
":preprocess",
":preprocess_gen",
"modules:build_grdp",
]
grdp_files += [ "$target_gen_dir/modules/resources.grdp" ]
manifest_files = [
"$target_gen_dir/$preprocess_manifest",
"$target_gen_dir/$preprocess_gen_manifest",
]
}
}
grit("resources") {
defines = chrome_grit_defines + [ "is_official_build=$is_official_build" ]
enable_input_discovery_for_gn_analyze = false
source = "$target_gen_dir/resources.grd"
deps = [
":build_grd",
"//chrome/browser/promo_browser_command:mojo_bindings_js",
"//chrome/browser/search/task_module:mojo_bindings_js",
"//chrome/browser/ui/webui/new_tab_page:mojo_bindings_js",
"//chrome/common/search:mojo_bindings_js",
]
if (!is_official_build) {
deps += [ "//chrome/browser/ui/webui/new_tab_page/foo:mojo_bindings_js" ]
} }
outputs = [
"grit/new_tab_page_resources.h",
"grit/new_tab_page_resources_map.cc",
"grit/new_tab_page_resources_map.h",
"new_tab_page_resources.pak",
]
output_dir = "$root_gen_dir/chrome"
}
if (optimize_webui) {
optimize_webui("optimized_js") { optimize_webui("optimized_js") {
host = "new-tab-page" host = "new-tab-page"
input = rebase_path("$target_gen_dir/$preprocess_folder", root_build_dir) input = rebase_path("$target_gen_dir/$preprocess_folder", root_build_dir)
...@@ -338,6 +465,7 @@ if (optimize_webui) { ...@@ -338,6 +465,7 @@ if (optimize_webui) {
"new_tab_page.js", "new_tab_page.js",
"lazy_load.js", "lazy_load.js",
] ]
out_manifest = "$target_gen_dir/$build_manifest"
js_out_files = [ js_out_files = [
"new_tab_page.rollup.js", "new_tab_page.rollup.js",
"lazy_load.rollup.js", "lazy_load.rollup.js",
...@@ -358,6 +486,7 @@ if (optimize_webui) { ...@@ -358,6 +486,7 @@ if (optimize_webui) {
"chrome://resources/mojo/url/mojom/url.mojom-lite.js", "chrome://resources/mojo/url/mojom/url.mojom-lite.js",
"new_tab_page.mojom-lite.js", "new_tab_page.mojom-lite.js",
"omnibox.mojom-lite.js", "omnibox.mojom-lite.js",
"one_google_bar_api.js",
"promo_browser_command.mojom-lite.js", "promo_browser_command.mojom-lite.js",
"modules/task_module/task_module.mojom-lite.js", "modules/task_module/task_module.mojom-lite.js",
"foo.mojom-lite.js", "foo.mojom-lite.js",
......
# Copyright 2020 The Chromium Authors. All rights reserved.
# 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/generate_grd.gni")
generate_grd("build_grdp") {
grd_prefix = "new_tab_page"
out_grd = "$target_gen_dir/resources.grdp"
input_files = [
"account_circle.svg",
"backgrounds.svg",
"cards.svg",
"check_circle.svg",
"chevron.svg",
"colored_header.svg",
"colors.svg",
"copy.svg",
"facebook.svg",
"generic_globe.svg",
"google_logo.svg",
"googlemic_clr_24px.svg",
"icon_pencil.svg",
"info.svg",
"link.svg",
"mail.svg",
"mic.svg",
"shortcut_circles.svg",
"twitter.svg",
"upload.svg",
]
input_files_base_dir = rebase_path(".", "//")
resource_path_prefix = "icons"
}
...@@ -6,6 +6,7 @@ import("//chrome/common/features.gni") ...@@ -6,6 +6,7 @@ import("//chrome/common/features.gni")
import("//third_party/closure_compiler/compile_js.gni") import("//third_party/closure_compiler/compile_js.gni")
import("//tools/grit/preprocess_if_expr.gni") import("//tools/grit/preprocess_if_expr.gni")
import("//tools/polymer/html_to_js.gni") import("//tools/polymer/html_to_js.gni")
import("//ui/webui/resources/tools/generate_grd.gni")
import("//ui/webui/webui_features.gni") import("//ui/webui/webui_features.gni")
js_library("module_descriptor") { js_library("module_descriptor") {
...@@ -59,38 +60,56 @@ group("web_components") { ...@@ -59,38 +60,56 @@ group("web_components") {
] ]
} }
if (optimize_webui) { # Up one folder to get to the root NTP gen dir, where files need to live
# Up one folder to get to the root NTP gen dir, where files need to live # for bundling.
# for bundling. preprocess_folder = "../preprocessed/modules"
preprocess_folder = "../preprocessed/modules" preprocess_manifest = "preprocessed_manifest.json"
preprocess_gen_manifest = "preprocessed_gen_manifest.json"
preprocess_if_expr("preprocess") { generate_grd("build_grdp") {
defines = [ "is_official_build=$is_official_build" ] grd_prefix = "new_tab_page"
in_folder = "./" out_grd = "$target_gen_dir/resources.grdp"
deps = [
":preprocess",
":preprocess_gen",
]
manifest_files = [
"$target_gen_dir/preprocessed_manifest.json",
"$target_gen_dir/preprocessed_gen_manifest.json",
]
resource_path_prefix = "modules"
}
preprocess_if_expr("preprocess") {
defines = [ "is_official_build=$is_official_build" ]
in_folder = "./"
out_folder = "$target_gen_dir/$preprocess_folder" out_folder = "$target_gen_dir/$preprocess_folder"
in_files = [ out_manifest = "$target_gen_dir/$preprocess_manifest"
"module_descriptor.js", in_files = [
"modules.js", "module_descriptor.js",
"module_registry.js", "modules.js",
"task_module/task_module_handler_proxy.js", "module_registry.js",
] "task_module/task_module_handler_proxy.js",
if (!is_official_build) { ]
in_files += [ "dummy/foo_proxy.js" ] if (!is_official_build) {
} in_files += [ "dummy/foo_proxy.js" ]
} }
}
preprocess_if_expr("preprocess_gen") { preprocess_if_expr("preprocess_gen") {
deps = [ ":web_components" ] deps = [ ":web_components" ]
defines = [ "is_official_build=$is_official_build" ] defines = [ "is_official_build=$is_official_build" ]
in_folder = target_gen_dir in_folder = target_gen_dir
out_folder = "$target_gen_dir/$preprocess_folder" out_folder = "$target_gen_dir/$preprocess_folder"
in_files = [ out_manifest = "$target_gen_dir/$preprocess_gen_manifest"
"module_header.js", in_files = [
"module_wrapper.js", "kaleidoscope/module.js",
"dummy/module.js", "module_header.js",
"kaleidoscope/module.js", "module_wrapper.js",
"task_module/module.js", "task_module/module.js",
] ]
if (!is_official_build) {
in_files += [ "dummy/module.js" ]
} }
} }
<?xml version="1.0" encoding="UTF-8"?>
<grit-part>
<if expr="not is_official_build">
<include name="IDR_NEW_TAB_PAGE_MODULES_DUMMY_MODULE_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/modules/dummy/module.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_MODULES_DUMMY_FOO_PROXY_JS"
file="modules/dummy/foo_proxy.js" type="BINDATA" />
</if>
<include name="IDR_NEW_TAB_PAGE_MODULES_KALEIDOSCOPE_MODULE_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/modules/kaleidoscope/module.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_MODULES_MODULE_DESCRIPTOR_JS"
file="modules/module_descriptor.js" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_MODULES_MODULE_HEADER_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/modules/module_header.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_MODULES_MODULES_JS"
file="modules/modules.js" type="BINDATA" preprocess="true"/>
<include name="IDR_NEW_TAB_PAGE_MODULES_MODULE_REGISTRY_JS"
file="modules/module_registry.js" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_MODULE_WRAPPER_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/modules/module_wrapper.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_MODULES_TASK_MODULE_MODULE_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/modules/task_module/module.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_MODULES_TASK_MODULE_TASK_MODULE_HANDLER_PROXY_JS"
file="modules/task_module/task_module_handler_proxy.js" type="BINDATA" />
</grit-part>
<?xml version="1.0" encoding="UTF-8"?>
<grit latest_public_release="0" current_release="1" output_all_resource_defines="false">
<outputs>
<output filename="grit/new_tab_page_resources.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
<output filename="grit/new_tab_page_resources_map.cc"
type="resource_file_map_source" />
<output filename="grit/new_tab_page_resources_map.h"
type="resource_map_header" />
<output filename="new_tab_page_resources.pak" type="data_package" />
</outputs>
<release seq="1">
<includes>
<include name="IDR_NEW_TAB_PAGE_NEW_TAB_PAGE_JS"
file="new_tab_page.js" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_LAZY_LOAD_JS"
file="lazy_load.js" type="BINDATA" preprocess="true"/>
<include name="IDR_NEW_TAB_PAGE_APP_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/app.js"
use_base_dir="false" type="BINDATA" preprocess="true" />
<include name="IDR_NEW_TAB_PAGE_MIDDLE_SLOT_PROMO_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/middle_slot_promo.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_MOST_VISITED_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/most_visited.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_CUSTOMIZE_DIALOG_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/customize_dialog.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_CUSTOMIZE_DIALOG_TYPES_JS"
file="customize_dialog_types.js" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_VOICE_SEARCH_OVERLAY_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/voice_search_overlay.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_CUSTOMIZE_BACKGROUNDS_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/customize_backgrounds.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_CUSTOMIZE_SHORTCUTS_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/customize_shortcuts.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_CUSTOMIZE_MODULES_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/customize_modules.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_IFRAME_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/iframe.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_MINI_PAGE_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/mini_page.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_FAKEBOX_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/fakebox.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_LOGO_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/logo.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_DOODLE_SHARE_DIALOG_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/doodle_share_dialog.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_REALBOX_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/realbox.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_REALBOX_DROPDOWN_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/realbox_dropdown.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_REALBOX_ICON_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/realbox_icon.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_REALBOX_MATCH_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/realbox_match.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_IMG_JS"
file="img.js" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_BROWSER_PROXY_JS"
file="browser_proxy.js" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_UTILS_JS"
file="utils.js" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_BACKGROUND_MANAGER_JS"
file="background_manager.js" type="BINDATA" />
<part file="new_tab_page_resources_common.grdp" />
<part file="modules/modules_resources.grdp" />
</includes>
</release>
</grit>
<?xml version="1.0" encoding="UTF-8"?>
<grit-part>
<include name="IDR_NEW_TAB_PAGE_MOJO_LITE_JS"
file="${root_gen_dir}/chrome/browser/ui/webui/new_tab_page/new_tab_page.mojom-lite.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_OMNIBOX_MOJO_LITE_JS"
file="${root_gen_dir}/chrome/common/search/omnibox.mojom-lite.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_PROMO_BROWSER_COMMAND_MOJO_LITE_JS"
file="${root_gen_dir}/chrome/browser/promo_browser_command/promo_browser_command.mojom-lite.js"
use_base_dir="false" type="BINDATA" />
<if expr="not is_official_build">
<include name="IDR_NEW_TAB_PAGE_FOO_MOJO_LITE_JS"
file="${root_gen_dir}/chrome/browser/ui/webui/new_tab_page/foo/foo.mojom-lite.js"
use_base_dir="false" type="BINDATA" />
</if>
<include name="IDR_NEW_TAB_PAGE_ACCOUNT_CIRCLE_SVG"
file="icons/account_circle.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_CHECK_CIRCLE_SVG"
file="icons/check_circle.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_CHEVRON_SVG"
file="icons/chevron.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_GENERIC_GLOBE_SVG"
file="icons/generic_globe.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_GOOGLE_LOGO_SVG"
file="icons/google_logo.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_PENCIL_ICON_SVG"
file="icons/icon_pencil.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_LINK_ICON_SVG"
file="icons/link.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_BACKGROUNDS_ICON_SVG"
file="icons/backgrounds.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_COLORED_HEADER_SVG"
file="icons/colored_header.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_COLORS_ICON_SVG"
file="icons/colors.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_SHORTCUT_CIRCLES_SVG"
file="icons/shortcut_circles.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_GOOGLE_MIC_SVG"
file="icons/googlemic_clr_24px.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_MIC_SVG"
file="icons/mic.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_COPY_SVG"
file="icons/copy.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_FACEBOOK_SVG"
file="icons/facebook.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_TWITTER_SVG"
file="icons/twitter.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_MAIL_SVG"
file="icons/mail.svg" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_UPLOAD_SVG" file="icons/upload.svg"
type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_INFO_SVG" file="icons/info.svg"
type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_CARDS_SVG" file="icons/cards.svg"
type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_NEW_TAB_PAGE_HTML"
file="new_tab_page.html" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_SHARED_VARS_CSS"
file="shared_vars.css" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_UNTRUSTED_ONE_GOOGLE_BAR_HTML"
file="untrusted/one_google_bar.html" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_UNTRUSTED_ONE_GOOGLE_BAR_JS"
file="untrusted/one_google_bar.js" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_UNTRUSTED_IMAGE_HTML"
file="untrusted/image.html" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_UNTRUSTED_BACKGROUND_IMAGE_HTML"
file="untrusted/background_image.html" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_UNTRUSTED_BACKGROUND_IMAGE_JS"
file="untrusted/background_image.js" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_ONE_GOOGLE_BAR_API_JS"
file="one_google_bar_api.js" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_PROMO_BROWSER_COMMAND_PROXY_JS"
file="promo_browser_command_proxy.js" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_MODULES_TASK_MODULE_TASK_MODULE_MOJO_LITE_JS"
file="${root_gen_dir}/chrome/browser/search/task_module/task_module.mojom-lite.js"
use_base_dir="false" type="BINDATA" />
</grit-part>
<?xml version="1.0" encoding="UTF-8"?>
<grit latest_public_release="0" current_release="1" output_all_resource_defines="false">
<outputs>
<output filename="grit/new_tab_page_resources.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
<output filename="grit/new_tab_page_resources_map.cc"
type="resource_file_map_source" />
<output filename="grit/new_tab_page_resources_map.h"
type="resource_map_header" />
<output filename="new_tab_page_resources.pak" type="data_package" />
</outputs>
<release seq="1">
<includes>
<include name="IDR_NEW_TAB_PAGE_NEW_TAB_PAGE_ROLLUP_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/new_tab_page.rollup.js"
use_base_dir="false" type="BINDATA" />
<include name="IDR_NEW_TAB_PAGE_LAZY_LOAD_ROLLUP_JS"
file="${root_gen_dir}\chrome\browser\resources\new_tab_page\lazy_load.rollup.js"
type="BINDATA" use_base_dir="false" />
<include name="IDR_NEW_TAB_PAGE_SHARED_ROLLUP_JS"
file="${root_gen_dir}\chrome\browser\resources\new_tab_page\shared.rollup.js"
type="BINDATA" use_base_dir="false" />
<part file="new_tab_page_resources_common.grdp" />
</includes>
</release>
</grit>
...@@ -59,9 +59,6 @@ using content::WebContents; ...@@ -59,9 +59,6 @@ using content::WebContents;
namespace { namespace {
constexpr char kGeneratedPath[] =
"@out_folder@/gen/chrome/browser/resources/new_tab_page/";
content::WebUIDataSource* CreateNewTabPageUiHtmlSource(Profile* profile) { content::WebUIDataSource* CreateNewTabPageUiHtmlSource(Profile* profile) {
content::WebUIDataSource* source = content::WebUIDataSource* source =
content::WebUIDataSource::Create(chrome::kChromeUINewTabPageHost); content::WebUIDataSource::Create(chrome::kChromeUINewTabPageHost);
...@@ -256,29 +253,9 @@ content::WebUIDataSource* CreateNewTabPageUiHtmlSource(Profile* profile) { ...@@ -256,29 +253,9 @@ content::WebUIDataSource* CreateNewTabPageUiHtmlSource(Profile* profile) {
"shoppingTasksModuleEnabled", "shoppingTasksModuleEnabled",
base::FeatureList::IsEnabled(ntp_features::kNtpShoppingTasksModule)); base::FeatureList::IsEnabled(ntp_features::kNtpShoppingTasksModule));
source->AddResourcePath("new_tab_page.mojom-lite.js",
IDR_NEW_TAB_PAGE_MOJO_LITE_JS);
source->AddResourcePath("omnibox.mojom-lite.js",
IDR_NEW_TAB_PAGE_OMNIBOX_MOJO_LITE_JS);
source->AddResourcePath("promo_browser_command.mojom-lite.js",
IDR_NEW_TAB_PAGE_PROMO_BROWSER_COMMAND_MOJO_LITE_JS);
source->AddResourcePath(
"modules/task_module/task_module.mojom-lite.js",
IDR_NEW_TAB_PAGE_MODULES_TASK_MODULE_TASK_MODULE_MOJO_LITE_JS);
#if !defined(OFFICIAL_BUILD)
source->AddResourcePath("foo.mojom-lite.js",
IDR_NEW_TAB_PAGE_FOO_MOJO_LITE_JS);
#endif
#if BUILDFLAG(OPTIMIZE_WEBUI)
source->AddResourcePath("new_tab_page.js",
IDR_NEW_TAB_PAGE_NEW_TAB_PAGE_ROLLUP_JS);
source->AddResourcePath("shared.rollup.js",
IDR_NEW_TAB_PAGE_SHARED_ROLLUP_JS);
source->AddResourcePath("lazy_load.js", IDR_NEW_TAB_PAGE_LAZY_LOAD_ROLLUP_JS);
#endif // BUILDFLAG(OPTIMIZE_WEBUI)
webui::SetupWebUIDataSource( webui::SetupWebUIDataSource(
source, base::make_span(kNewTabPageResources, kNewTabPageResourcesSize), source, base::make_span(kNewTabPageResources, kNewTabPageResourcesSize),
kGeneratedPath, IDR_NEW_TAB_PAGE_NEW_TAB_PAGE_HTML); "", IDR_NEW_TAB_PAGE_NEW_TAB_PAGE_HTML);
// Allows creating <script> and inlining as well as network requests to // Allows creating <script> and inlining as well as network requests to
// support inlining the OneGoogleBar. // support inlining the OneGoogleBar.
......
...@@ -151,12 +151,12 @@ template("chrome_extra_paks") { ...@@ -151,12 +151,12 @@ template("chrome_extra_paks") {
"//chrome/browser/resources:component_extension_resources", "//chrome/browser/resources:component_extension_resources",
"//chrome/browser/resources:dev_ui_paks", "//chrome/browser/resources:dev_ui_paks",
"//chrome/browser/resources:local_ntp_resources", "//chrome/browser/resources:local_ntp_resources",
"//chrome/browser/resources:new_tab_page_resources",
"//chrome/browser/resources/bookmarks:bookmarks_resources", "//chrome/browser/resources/bookmarks:bookmarks_resources",
"//chrome/browser/resources/commander:commander_resources", "//chrome/browser/resources/commander:commander_resources",
"//chrome/browser/resources/downloads:downloads_resources", "//chrome/browser/resources/downloads:downloads_resources",
"//chrome/browser/resources/gaia_auth_host:resources", "//chrome/browser/resources/gaia_auth_host:resources",
"//chrome/browser/resources/history:history_resources", "//chrome/browser/resources/history:history_resources",
"//chrome/browser/resources/new_tab_page:resources",
"//chrome/browser/resources/read_later:read_later_resources", "//chrome/browser/resources/read_later:read_later_resources",
"//chrome/browser/resources/settings:settings_resources", "//chrome/browser/resources/settings:settings_resources",
"//chrome/browser/resources/tab_search:tab_search_resources", "//chrome/browser/resources/tab_search:tab_search_resources",
......
...@@ -151,10 +151,8 @@ ...@@ -151,10 +151,8 @@
"META": {"sizes": {"includes": [100]}}, "META": {"sizes": {"includes": [100]}},
"includes": [1640], "includes": [1640],
}, },
"chrome/browser/resources/new_tab_page/new_tab_page_resources_vulcanized.grd": { "<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/new_tab_page/resources.grd": {
"includes": [1660], "META": {"sizes": {"includes": [200]}},
},
"chrome/browser/resources/new_tab_page/new_tab_page_resources.grd": {
"includes": [1680], "includes": [1680],
}, },
"chrome/browser/resources/preinstalled_web_apps/resources.grd": { "chrome/browser/resources/preinstalled_web_apps/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