Commit 456a8a60 authored by dpapad's avatar dpapad Committed by Commit Bot

WebUI: Auto-generate ui/webui/resources/css/ resources grdp file.

Moving most IDR_WEBUI_CSS_* resources from webui_resources.grd to
the auto-generated webui_generated_resources.grd.

Resources that rely on flattenhtml=true are not affected, since
|flattenhtml| is purposefully not supported by generate_grd().

Bug: 1132403
Change-Id: Iee43d27b9d34a0f9062dab5e6a56c1c428b5cca6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2521930
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Auto-Submit: dpapad <dpapad@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826677}
parent 7d9b96a1
......@@ -34,8 +34,8 @@
#include "skia/grit/skia_resources_map.h"
#include "ui/base/layout.h"
#include "ui/base/webui/web_ui_util.h"
#include "ui/resources/grit/webui_generated_resources.h"
#include "ui/resources/grit/webui_generated_resources_map.h"
#include "ui/resources/grit/webui_resources.h"
#include "ui/resources/grit/webui_resources_map.h"
#if defined(OS_CHROMEOS)
......
......@@ -25,7 +25,7 @@
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/font.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/resources/grit/webui_resources.h"
#include "ui/resources/grit/webui_generated_resources.h"
#include "ui/strings/grit/app_locale_settings.h"
#include "url/gurl.h"
......
......@@ -12,11 +12,13 @@ generate_grd("build_grd") {
out_grd = "$target_gen_dir/${grd_prefix}_resources.grd"
deps = [
"css:build_grdp",
"html:build_grdp",
"js:build_grdp",
"js/cr/ui:build_grdp",
]
grdp_files = [
"$target_gen_dir/css/resources.grdp",
"$target_gen_dir/html/resources.grdp",
"$target_gen_dir/js/cr/ui/resources.grdp",
"$target_gen_dir/js/resources.grdp",
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Holds various resources under ui/webui/resources/{js,html}, that depend on
Polymer or are Polymer related. -->
<grit-part>
<!-- CSS resources -->
<structure name="IDR_WEBUI_CSS_MD_COLORS"
file="css/md_colors.css" type="chrome_html" />
</grit-part>
# 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("//tools/grit/preprocess_grit.gni")
import("//ui/webui/resources/tools/generate_grd.gni")
include_polymer = !is_android && !is_ios
preprocess_folder = "$root_gen_dir/ui/webui/resources/preprocessed/css"
preprocess_src_manifest = "preprocessed_src_manifest.json"
generate_grd("build_grdp") {
grd_prefix = "webui_css"
out_grd = "$target_gen_dir/resources.grdp"
deps = [ ":preprocess_src" ]
manifest_files = [ "$target_gen_dir/$preprocess_src_manifest" ]
resource_path_prefix = "css"
}
preprocess_grit("preprocess_src") {
in_folder = "./"
out_folder = "$preprocess_folder"
out_manifest = "$target_gen_dir/$preprocess_src_manifest"
in_files = [
"action_link.css",
"apps/common.css",
"apps/topbutton_bar.css",
"bubble_button.css",
"bubble.css",
"butter_bar.css",
"chrome_shared.css",
"dialogs.css",
"i18n_process.css",
"list.css",
"roboto.css",
"table.css",
"tabs.css",
"text_defaults.css",
"text_defaults_md.css",
"throbber.css",
# TODO(dpapad): Include remaining files once thy no longer depend on
# flattenhtml=true.
#"controlled_indicator.css",
#"menu_button.css",
#"menu.css",
#"overlay.css",
#"spinner.css",
#"tree.css",
#"widgets.css",
]
if (include_polymer) {
in_files += [ "md_colors.css" ]
}
}
......@@ -74,53 +74,20 @@ without changes to the corresponding grd file. -->
</if>
</includes>
<structures>
<structure name="IDR_WEBUI_CSS_ACTION_LINK_CSS"
file="css/action_link.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_APPS_COMMON_CSS"
file="css/apps/common.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_APPS_TOPBUTTON_BAR_CSS"
file="css/apps/topbutton_bar.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_BUBBLE_CSS"
file="css/bubble.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_BUBBLE_BUTTON_CSS"
file="css/bubble_button.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_BUTTER_BAR_CSS"
file="css/butter_bar.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_CHROME_SHARED_CSS"
file="css/chrome_shared.css" type="chrome_html"
flattenhtml="true" />
<structure name="IDR_WEBUI_CSS_CONTROLLED_INDICATOR_CSS"
file="css/controlled_indicator.css" type="chrome_html" flattenhtml="true" />
<structure name="IDR_WEBUI_CSS_DIALOGS_CSS"
file="css/dialogs.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_I18N_PROCESS_CSS"
file="css/i18n_process.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_LIST_CSS"
file="css/list.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_MENU_CSS"
file="css/menu.css" type="chrome_html"
flattenhtml="true" />
<structure name="IDR_WEBUI_CSS_MENU_BUTTON_CSS"
file="css/menu_button.css" type="chrome_html"
flattenhtml="true" />
<structure name="IDR_WEBUI_CSS_TEXT_DEFAULTS_CSS"
file="css/text_defaults.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_TEXT_DEFAULTS_MD_CSS"
file="css/text_defaults_md.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_OVERLAY_CSS"
file="css/overlay.css" type="chrome_html"
flattenhtml="true" />
<structure name="IDR_WEBUI_CSS_ROBOTO_CSS" preprocess="true"
file="css/roboto.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_SPINNER_CSS"
file="css/spinner.css" type="chrome_html"
flattenhtml="true" />
<structure name="IDR_WEBUI_CSS_TABLE_CSS"
file="css/table.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_TABS_CSS"
file="css/tabs.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_THROBBER_CSS"
file="css/throbber.css" type="chrome_html" />
<structure name="IDR_WEBUI_CSS_TREE_CSS"
file="css/tree.css" type="chrome_html"
flattenhtml="true" />
......@@ -147,10 +114,6 @@ without changes to the corresponding grd file. -->
file="../../../third_party/lottie/lottie_worker.min.js"
type="chrome_html" />
</if>
<if expr="not is_android and not is_ios">
<part file="cr_polymer_resources.grdp" />
</if>
</structures>
</release>
</grit>
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