Commit f47b8f9a authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

[Subresource Filter] Remove Java infobar dep on //chrome resources

This CL eliminates the Java ads blocked infobar from depending on the
//chrome-level R by adding Java resources to
//components/subresource_filter/android and giving these resources the
necessary contents / dependencies. This will facilitate componentizing
the infobar for sharing with WebLayer. There is no behavioral change.

Note: The somewhat-unexpected dep addition in //weblayer is to work
around a weblayer packaging test that otherwise fails. cduvall@ is
investigating the root cause of this problem. In any case, the dep
addition is not problematic as the whole point of the componentization
is that //weblayer will shortly be using this code :).

Bug: 1116095
Change-Id: I5ceef180908b34a8f784e5b72a5e10886cf0efac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2460727Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816544}
parent 9269f9eb
......@@ -225,6 +225,7 @@ android_resources("chrome_app_java_resources") {
"//components/policy:app_restrictions_resources",
"//components/strings:components_locale_settings_grd",
"//components/strings:components_strings_grd",
"//components/subresource_filter/android:java_resources",
"//components/translate/content/android:java_resources",
"//content/public/android:content_java_resources",
"//third_party/android_data_chart:android_data_chart_java_resources",
......
......@@ -23,9 +23,6 @@
<item type="id" name="share_tab_group" />
<item type="id" name="edit_group_name" />
<!-- InfoBar constants -->
<item type="id" name="subresource_filter_infobar_toggle" />
<!-- Media playback notification -->
<item type="id" name="media_playback_notification" />
......
......@@ -14,11 +14,11 @@ import android.widget.CompoundButton.OnCheckedChangeListener;
import androidx.appcompat.widget.SwitchCompat;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.chrome.R;
import org.chromium.components.infobars.ConfirmInfoBar;
import org.chromium.components.infobars.InfoBar;
import org.chromium.components.infobars.InfoBarControlLayout;
import org.chromium.components.infobars.InfoBarLayout;
import org.chromium.components.subresource_filter.R;
import org.chromium.ui.text.NoUnderlineClickableSpan;
import org.chromium.ui.widget.ButtonCompat;
......
......@@ -11,11 +11,13 @@ generate_jni("subresource_filter_jni_headers") {
android_library("java") {
sources = [ "java/src/org/chromium/components/subresource_filter/SubresourceFilterFeatureList.java" ]
deps = [
":java_resources",
":subresource_filter_jni_headers",
"//base:base_java",
"//base:jni_java",
]
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
resources_package = "org.chromium.components.subresource_filter"
}
source_set("android") {
......@@ -26,3 +28,13 @@ source_set("android") {
"//components/subresource_filter/core/browser",
]
}
android_resources("java_resources") {
sources = [ "java/res/values/ids.xml" ]
deps = [
"//components/browser_ui/strings/android:browser_ui_strings_grd",
"//components/browser_ui/styles/android:java_resources",
"//components/strings:components_strings_grd",
]
}
<?xml version="1.0" encoding="utf-8"?>
<!-- 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. -->
<resources>
<item type="id" name="subresource_filter_infobar_toggle" />
</resources>
......@@ -39,6 +39,12 @@ android_resources("weblayer_resources") {
"//components/infobars/android:java_resources",
"//components/page_info/android:java_resources",
"//components/permissions/android:java_resources",
# TODO(crbug.com/1137713): Determine why the creation of
# //components/subresource_filter Java resources caused //weblayer's BundlePackageTest
# to fail without this dep even in advance of //weblayer depending on the code that uses these
# resources.
"//components/subresource_filter/android:java_resources",
"//components/translate/content/android:java_resources",
"//third_party/android_deps:material_design_java",
"//weblayer:components_java_strings",
......
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