Commit 0f4bfe01 authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

[WebView] Move WebLayer's resource exclusions into //weblayer

This CL follows up the addition of WebLayer-specific resource
exclusions in
https://chromium-review.googlesource.com/c/chromium/src/+/2209678 and
https://chromium-review.googlesource.com/c/chromium/src/+/2250109. When
introduced, all of the GN goop for these exclusions was placed directly
in system_webview_apk_tmpl.gni. This CL addresses Bo's request from the
latter CL above to introduce proper layering so that the
//android_webview file doesn't have to directly worry about what
WebLayer's exclusions are.

I verified manually with run_weblayer_shell_trichrome that the
translate infobar and HTTP auth dialog both still show as expected with
this change.

Bug: 1093846
Change-Id: Id354c07073ec031002a1e0089fe531c5ab7ecfc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2257321Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780764}
parent 126ca01a
......@@ -11,6 +11,7 @@ import("//build/util/version.gni")
import("//chrome/android/trichrome.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
import("//weblayer/variables.gni")
import("//weblayer/weblayer_resource_exclusions.gni")
declare_args() {
# Android package name to use when compiling the system_webview_apk and
......@@ -181,61 +182,14 @@ template("system_webview_apk_or_module_tmpl") {
resource_exclusion_regex = common_resource_exclusion_regex
resource_exclusion_exceptions = common_resource_exclusion_exceptions
_material_package = "*com_google_android_material_material*"
# These are used in WebLayer for HTTP Auth dialog.
resource_exclusion_exceptions += [
# TextInputLayout
"${_material_package}/design_text_*",
"${_material_package}/text_*",
]
if (webview_includes_weblayer) {
# These are used in WebLayer for the translate infobar
resource_exclusion_exceptions +=
[ "${_material_package}/design_layout_tab_*" ]
}
# Copied from chrome_public_apk_tmpl.gni.
resource_values_filter_rules = weblayer_resource_values_filter_rules
resource_exclusion_exceptions += weblayer_resource_exclusion_exceptions
# Remove unneeded entries from material design values.xml files.
resource_values_filter_rules = [
"${_material_package}:[Bb]adge",
"${_material_package}:[Bb]ottomNavigation",
"${_material_package}:[Bb]ottomSheet",
"${_material_package}:[Bb]uttonToggleGroup",
"${_material_package}:[Cc]alendar",
"${_material_package}:[Cc]ardView",
"${_material_package}:\b[Cc]hip",
"${_material_package}:design_snackbar",
"${_material_package}:[Ff]loatingActionButton",
"${_material_package}:[Mm]aterialAlertDialog",
"${_material_package}:mtrl_alert",
"${_material_package}:mtrl_navigation",
"${_material_package}:mtrl_slider",
"${_material_package}:[Nn]avigationView",
"${_material_package}:picker",
"${_material_package}:[Ss]nackbar",
"${_material_package}:[Ss]lider",
"${_material_package}:[Tt]oolbarLayout",
]
_material_package = "com_google_android_material_material.*"
# Used only by alert dialog on tiny screens.
resource_exclusion_regex += "|${_material_package}values-small"
# Used only by date picker (which chrome doesn't use).
resource_exclusion_regex += "|${_material_package}-(w480dp-port|w360dp-port|h480dp-land|h360dp-land)"
# Material design layouts that cause views to be kept that we don't use.
# Instead of manually filtering, unused resource removal would be better:
# https://crbug.com/636448
resource_exclusion_regex += "|${_material_package}/layout"
resource_exclusion_regex += "|${_material_package}/color.*(choice|chip_|card_|calendar_|bottom_nav_|slider_)"
resource_exclusion_regex +=
"|${_material_package}/drawable.*design_snackbar"
resource_exclusion_regex += "|${_material_package}/xml.*badge_"
# Note: WebLayer's resource exclusion regex deliberately does not start
# with "|".
resource_exclusion_regex += "|" + weblayer_resource_exclusion_regex
}
if (!_is_bundle_module) {
# Used as an additional apk in test scripts.
......
# 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.
_material_package = "*com_google_android_material_material*"
weblayer_resource_exclusion_exceptions = [
# TextInputLayout (used for HTTP Auth dialog)
"${_material_package}/design_text_*",
"${_material_package}/text_*",
# Used for the translate infobar
"${_material_package}/design_layout_tab_*",
]
# Copied from chrome_public_apk_tmpl.gni.
# Remove unneeded entries from material design values.xml files.
weblayer_resource_values_filter_rules = [
"${_material_package}:[Bb]adge",
"${_material_package}:[Bb]ottomNavigation",
"${_material_package}:[Bb]ottomSheet",
"${_material_package}:[Bb]uttonToggleGroup",
"${_material_package}:[Cc]alendar",
"${_material_package}:[Cc]ardView",
"${_material_package}:\b[Cc]hip",
"${_material_package}:design_snackbar",
"${_material_package}:[Ff]loatingActionButton",
"${_material_package}:[Mm]aterialAlertDialog",
"${_material_package}:mtrl_alert",
"${_material_package}:mtrl_navigation",
"${_material_package}:mtrl_slider",
"${_material_package}:[Nn]avigationView",
"${_material_package}:picker",
"${_material_package}:[Ss]nackbar",
"${_material_package}:[Ss]lider",
"${_material_package}:[Tt]oolbarLayout",
]
_material_package = "com_google_android_material_material.*"
# Used only by alert dialog on tiny screens.
weblayer_resource_exclusion_regex = "${_material_package}values-small"
# Used only by date picker (which chrome doesn't use).
weblayer_resource_exclusion_regex +=
"|${_material_package}-(w480dp-port|w360dp-port|h480dp-land|h360dp-land)"
# Material design layouts that cause views to be kept that we don't use.
# Instead of manually filtering, unused resource removal would be better:
# https://crbug.com/636448
weblayer_resource_exclusion_regex += "|${_material_package}/layout"
weblayer_resource_exclusion_regex += "|${_material_package}/color.*(choice|chip_|card_|calendar_|bottom_nav_|slider_)"
weblayer_resource_exclusion_regex +=
"|${_material_package}/drawable.*design_snackbar"
weblayer_resource_exclusion_regex += "|${_material_package}/xml.*badge_"
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