Commit 766acccc authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

[Subresource Filter] Componentize ads blocked infobar C++ strings

This CL componentizes the strings used by
ads_blocked_infobar_delegate.cc in preparation for componentization of
the ads blocked infobar itself. We skip the addition of translation
screenshots as this is just a move of existing strings plus the addition
of a generic //components-level IDS_RELOAD string that will be used
across multiple contexts.

Bug: 1116095
Change-Id: I3af1a25ea260e436184bbb75d515a8bd6acd21ce
Skip-Translation-Screenshots-Check: True
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2440523
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: default avatarCharlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813124}
parent fda159c4
...@@ -10204,18 +10204,6 @@ Please help our engineers fix this problem. Tell us what happened right before y ...@@ -10204,18 +10204,6 @@ Please help our engineers fix this problem. Tell us what happened right before y
</message> </message>
<!-- Ad Blocking UI strings. --> <!-- Ad Blocking UI strings. -->
<message name="IDS_ALWAYS_ALLOW_ADS" desc="Explanation associated with a toggle to allow ads after ads have been blocked on the page. To be used on pages where the ad blocking UI is governed by a persistent permissions-based allowlist.">
Always allow ads on this site
</message>
<message name="IDS_BLOCKED_ADS_INFOBAR_MESSAGE" desc="The mini infobar message shown to users on Android when Chrome has blocked ads on the site because the site tends to show intrusive ads. Will be presented as a sentence, next to a Details link to expand the infobar.">
Ads blocked.
</message>
<message name="IDS_BLOCKED_ADS_PROMPT_TITLE" desc="Title of the prompt shown to users in the omnibox or infobar when Chrome has blocked ads on the site because the site tends to show intrusive ads. The title will stand alone next to an icon so there is no need for a period." formatter_data="android_java">
Ads blocked
</message>
<message name="IDS_BLOCKED_ADS_PROMPT_EXPLANATION" desc="A warning that a site has, in the past, shown intrusive or misleading ads. To be shown in an expanded infobar / bubble">
This site shows intrusive or misleading ads.
</message>
<message name="IDS_BLOCKED_ADS_PROMPT_TOOLTIP" desc="Explanation that Chrome blocked ads on this site. To be shown as a tooltip on the Ads blocked desktop bubble"> <message name="IDS_BLOCKED_ADS_PROMPT_TOOLTIP" desc="Explanation that Chrome blocked ads on this site. To be shown as a tooltip on the Ads blocked desktop bubble">
Ads blocked on this site Ads blocked on this site
</message> </message>
......
...@@ -608,6 +608,7 @@ static_library("ui") { ...@@ -608,6 +608,7 @@ static_library("ui") {
"//components/feed/core/v2:feed_core_v2", "//components/feed/core/v2:feed_core_v2",
"//components/infobars/content", "//components/infobars/content",
"//components/query_tiles", "//components/query_tiles",
"//components/resources:android_resources",
"//components/security_state/content/android", "//components/security_state/content/android",
] ]
} else { } else {
......
include_rules = { include_rules = {
"+chrome/android/features/keyboard_accessory/jni_headers", "+chrome/android/features/keyboard_accessory/jni_headers",
"+components/resources/android",
} }
...@@ -8,12 +8,11 @@ ...@@ -8,12 +8,11 @@
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/android/android_theme_resources.h"
#include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h" #include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h"
#include "chrome/browser/ui/android/infobars/ads_blocked_infobar.h" #include "chrome/browser/ui/android/infobars/ads_blocked_infobar.h"
#include "chrome/grit/generated_resources.h"
#include "components/infobars/content/content_infobar_manager.h" #include "components/infobars/content/content_infobar_manager.h"
#include "components/infobars/core/infobar.h" #include "components/infobars/core/infobar.h"
#include "components/resources/android/theme_resources.h"
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#include "components/subresource_filter/core/browser/subresource_filter_constants.h" #include "components/subresource_filter/core/browser/subresource_filter_constants.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
...@@ -73,8 +72,7 @@ int AdsBlockedInfobarDelegate::GetButtons() const { ...@@ -73,8 +72,7 @@ int AdsBlockedInfobarDelegate::GetButtons() const {
base::string16 AdsBlockedInfobarDelegate::GetButtonLabel( base::string16 AdsBlockedInfobarDelegate::GetButtonLabel(
InfoBarButton button) const { InfoBarButton button) const {
return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_OK return l10n_util::GetStringUTF16((button == BUTTON_OK) ? IDS_OK : IDS_RELOAD);
: IDS_APP_MENU_RELOAD);
} }
bool AdsBlockedInfobarDelegate::Cancel() { bool AdsBlockedInfobarDelegate::Cancel() {
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "components/permissions/permission_request_manager.h" #include "components/permissions/permission_request_manager.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/prerender/browser/prerender_manager.h" #include "components/prerender/browser/prerender_manager.h"
#include "components/strings/grit/components_strings.h"
#include "components/vector_icons/vector_icons.h" #include "components/vector_icons/vector_icons.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "services/device/public/cpp/device_features.h" #include "services/device/public/cpp/device_features.h"
......
...@@ -37,6 +37,7 @@ per-file security_interstitials_strings.grdp=file://components/security_intersti ...@@ -37,6 +37,7 @@ per-file security_interstitials_strings.grdp=file://components/security_intersti
per-file security_state_strings.grdp=file://components/security_state/OWNERS per-file security_state_strings.grdp=file://components/security_state/OWNERS
per-file send_tab_to_self_strings.grdp=file://components/send_tab_to_self/OWNERS per-file send_tab_to_self_strings.grdp=file://components/send_tab_to_self/OWNERS
per-file ssl_errors_strings.grdp=file://components/ssl_errors/OWNERS per-file ssl_errors_strings.grdp=file://components/ssl_errors/OWNERS
per-file subresource_filter_strings.grdp=file://components/subresource_filter/OWNERS
per-file sync_ui_strings.grdp=file://components/sync/OWNERS per-file sync_ui_strings.grdp=file://components/sync/OWNERS
per-file tab_groups_strings.grdp=file://components/tab_groups/OWNERS per-file tab_groups_strings.grdp=file://components/tab_groups/OWNERS
per-file translate_strings.grdp=file://components/translate/OWNERS per-file translate_strings.grdp=file://components/translate/OWNERS
...@@ -58,4 +59,4 @@ per-file BUILD.gn=* ...@@ -58,4 +59,4 @@ per-file BUILD.gn=*
# Service sandbox specialization must be reviewed by SECURITY_OWNERS # Service sandbox specialization must be reviewed by SECURITY_OWNERS
per-file service_sandbox_type.h=set noparent per-file service_sandbox_type.h=set noparent
per-file service_sandbox_type.h=file://ipc/SECURITY_OWNERS per-file service_sandbox_type.h=file://ipc/SECURITY_OWNERS
\ No newline at end of file
...@@ -314,6 +314,7 @@ ...@@ -314,6 +314,7 @@
<part file="send_tab_to_self_strings.grdp" /> <part file="send_tab_to_self_strings.grdp" />
<part file="sms_strings.grdp" /> <part file="sms_strings.grdp" />
<part file="ssl_errors_strings.grdp" /> <part file="ssl_errors_strings.grdp" />
<part file="subresource_filter_strings.grdp" />
<part file="sync_ui_strings.grdp" /> <part file="sync_ui_strings.grdp" />
<part file="translate_strings.grdp" /> <part file="translate_strings.grdp" />
<part file="tab_groups_strings.grdp" /> <part file="tab_groups_strings.grdp" />
...@@ -349,6 +350,9 @@ ...@@ -349,6 +350,9 @@
<message name="IDS_OK" desc="Used for OK on buttons"> <message name="IDS_OK" desc="Used for OK on buttons">
OK OK
</message> </message>
<message name="IDS_RELOAD" desc="Used for Reload on buttons">
Reload
</message>
<message name="IDS_ADD" desc="Used for Add on buttons"> <message name="IDS_ADD" desc="Used for Add on buttons">
Add Add
</message> </message>
......
<?xml version="1.0" encoding="utf-8"?>
<grit-part>
<message name="IDS_ALWAYS_ALLOW_ADS" desc="Explanation associated with a toggle to allow ads after ads have been blocked on the page. To be used on pages where the ad blocking UI is governed by a persistent permissions-based allowlist.">
Always allow ads on this site
</message>
<message name="IDS_BLOCKED_ADS_PROMPT_TITLE" desc="Title of the prompt shown to users in the omnibox or infobar when Chrome has blocked ads on the site because the site tends to show intrusive ads. The title will stand alone next to an icon so there is no need for a period." formatter_data="android_java">
Ads blocked
</message>
<message name="IDS_BLOCKED_ADS_PROMPT_EXPLANATION" desc="A warning that a site has, in the past, shown intrusive or misleading ads. To be shown in an expanded infobar / bubble">
This site shows intrusive or misleading ads.
</message>
<if expr="is_android">
<message name="IDS_BLOCKED_ADS_INFOBAR_MESSAGE" desc="The mini infobar message shown to users on Android when Chrome has blocked ads on the site because the site tends to show intrusive ads. Will be presented as a sentence, next to a Details link to expand the infobar.">
Ads blocked.
</message>
</if>
</grit-part>
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