[fenix] Bug 1811504 - Update strings for cookie banner handling

pull/600/head
Arturo Mejia 2 years ago committed by mergify[bot]
parent 1f140a570f
commit a45f2d4ea0

@ -464,8 +464,6 @@ class SettingsFragment : PreferenceFragmentCompat() {
findPreference<Preference>(getPreferenceKey(R.string.pref_key_start_profiler)) findPreference<Preference>(getPreferenceKey(R.string.pref_key_start_profiler))
with(requireContext().settings()) { with(requireContext().settings()) {
findPreference<Preference>(getPreferenceKey(R.string.pref_key_cookie_banner_settings))
?.isVisible = shouldShowCookieBannerUI
findPreference<Preference>( findPreference<Preference>(
getPreferenceKey(R.string.pref_key_nimbus_experiments), getPreferenceKey(R.string.pref_key_nimbus_experiments),
)?.isVisible = showSecretDebugMenuThisSession )?.isVisible = showSecretDebugMenuThisSession
@ -481,6 +479,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
preferenceStartProfiler?.isVisible = showSecretDebugMenuThisSession && preferenceStartProfiler?.isVisible = showSecretDebugMenuThisSession &&
(requireContext().components.core.engine.profiler?.isProfilerActive() != null) (requireContext().components.core.engine.profiler?.isProfilerActive() != null)
} }
setupCookieBannerPreference()
setupAmoCollectionOverridePreference(requireContext().settings()) setupAmoCollectionOverridePreference(requireContext().settings())
setupAllowDomesticChinaFxaServerPreference() setupAllowDomesticChinaFxaServerPreference()
setupHttpsOnlyPreferences() setupHttpsOnlyPreferences()
@ -635,6 +634,21 @@ class SettingsFragment : PreferenceFragmentCompat() {
} }
} }
@VisibleForTesting
internal fun setupCookieBannerPreference() {
with(requirePreference<Preference>(R.string.pref_key_cookie_banner_settings)) {
summary = context?.let {
isVisible = it.settings().shouldShowCookieBannerUI
if (it.settings().shouldUseCookieBanner) {
getString(R.string.reduce_cookie_banner_option_on)
} else {
getString(R.string.reduce_cookie_banner_option_off)
}
}
}
}
@VisibleForTesting @VisibleForTesting
internal fun setupHttpsOnlyPreferences() { internal fun setupHttpsOnlyPreferences() {
val httpsOnlyPreference = val httpsOnlyPreference =

@ -75,7 +75,7 @@ class CookieBannerHandlingDetailsView(
if (isCookieBannerHandlingEnabled) { if (isCookieBannerHandlingEnabled) {
R.string.reduce_cookie_banner_details_panel_description_off_for_site R.string.reduce_cookie_banner_details_panel_description_off_for_site
} else { } else {
R.string.reduce_cookie_banner_details_panel_description_on_for_site_1 R.string.reduce_cookie_banner_details_panel_description_on_for_site_2
} }
val appName = context.getString(R.string.app_name) val appName = context.getString(R.string.app_name)
binding.details.text = context.getString(stringID, appName) binding.details.text = context.getString(stringID, appName)

@ -32,7 +32,10 @@ object CookieBannerReEngagementDialogUtils {
CONTROL_VARIANT -> CookieBannerDialogVariant( CONTROL_VARIANT -> CookieBannerDialogVariant(
title = context.getString(R.string.reduce_cookie_banner_control_experiment_dialog_title), title = context.getString(R.string.reduce_cookie_banner_control_experiment_dialog_title),
message = context.getString( message = context.getString(
R.string.reduce_cookie_banner_control_experiment_dialog_body_1, R.string.reduce_cookie_banner_control_experiment_dialog_body_2,
context.getString(
R.string.app_name,
),
), ),
positiveTextButton = context.getString( positiveTextButton = context.getString(
R.string.reduce_cookie_banner_control_experiment_dialog_change_setting_button, R.string.reduce_cookie_banner_control_experiment_dialog_change_setting_button,
@ -62,7 +65,10 @@ object CookieBannerReEngagementDialogUtils {
CookieBannerDialogVariant( CookieBannerDialogVariant(
title = context.getString(R.string.reduce_cookie_banner_control_experiment_dialog_title), title = context.getString(R.string.reduce_cookie_banner_control_experiment_dialog_title),
message = context.getString( message = context.getString(
R.string.reduce_cookie_banner_control_experiment_dialog_body_1, R.string.reduce_cookie_banner_control_experiment_dialog_body_2,
context.getString(
R.string.app_name,
),
), ),
positiveTextButton = context.getString( positiveTextButton = context.getString(
R.string.reduce_cookie_banner_control_experiment_dialog_change_setting_button, R.string.reduce_cookie_banner_control_experiment_dialog_change_setting_button,

@ -341,6 +341,10 @@
<string name="preferences_cookie_banner_reduction">Cookie Banner Reduction</string> <string name="preferences_cookie_banner_reduction">Cookie Banner Reduction</string>
<!-- Preference for rejecting or removing as many cookie/consent banners as possible on sites. See reduce_cookie_banner_summary for additional context. --> <!-- Preference for rejecting or removing as many cookie/consent banners as possible on sites. See reduce_cookie_banner_summary for additional context. -->
<string name="reduce_cookie_banner_option">Reduce cookie banners</string> <string name="reduce_cookie_banner_option">Reduce cookie banners</string>
<!-- Summary of cookie banner handling preference if the setting disabled is set to off -->
<string name="reduce_cookie_banner_option_off">Off</string>
<!-- Summary of cookie banner handling preference if the setting enabled is set to on -->
<string name="reduce_cookie_banner_option_on">On</string>
<!-- Summary for the preference for rejecting all cookies whenever possible. --> <!-- Summary for the preference for rejecting all cookies whenever possible. -->
<string name="reduce_cookie_banner_summary" moz:RemovedIn="110" tools:ignore="UnusedResources">Firefox automatically tries to reject cookie requests on cookie banners. If a reject option isnt available, Firefox may accept all cookies to dismiss the banner.</string> <string name="reduce_cookie_banner_summary" moz:RemovedIn="110" tools:ignore="UnusedResources">Firefox automatically tries to reject cookie requests on cookie banners. If a reject option isnt available, Firefox may accept all cookies to dismiss the banner.</string>
<!-- Summary for the preference for rejecting all cookies whenever possible. The first parameter is the application name --> <!-- Summary for the preference for rejecting all cookies whenever possible. The first parameter is the application name -->
@ -349,6 +353,8 @@
<string name="reduce_cookie_banner_off_for_site">Off for this site</string> <string name="reduce_cookie_banner_off_for_site">Off for this site</string>
<!-- Text for indicating cookie banner handling is on this site, this is shown as part of the protections panel with the tracking protection toggle --> <!-- Text for indicating cookie banner handling is on this site, this is shown as part of the protections panel with the tracking protection toggle -->
<string name="reduce_cookie_banner_on_for_site">On for this site</string> <string name="reduce_cookie_banner_on_for_site">On for this site</string>
<!-- Text for indicating cookie banner handling is currently not supported for this site, this is shown as part of the protections panel with the tracking protection toggle -->
<string name="reduce_cookie_banner_unsupported_site" tools:ignore="UnusedResources">Site currently not supported</string>
<!-- Title text for a detail explanation indicating cookie banner handling is on this site, this is shown as part of the cookie banner panel in the toolbar. The first parameter is a shortened URL of the current site--> <!-- Title text for a detail explanation indicating cookie banner handling is on this site, this is shown as part of the cookie banner panel in the toolbar. The first parameter is a shortened URL of the current site-->
<string name="reduce_cookie_banner_details_panel_title_on_for_site">Turn on Cookie Banner Reduction for %1$s?</string> <string name="reduce_cookie_banner_details_panel_title_on_for_site">Turn on Cookie Banner Reduction for %1$s?</string>
<!-- Title text for a detail explanation indicating cookie banner handling is off this site, this is shown as part of the cookie banner panel in the toolbar. The first parameter is a shortened URL of the current site--> <!-- Title text for a detail explanation indicating cookie banner handling is off this site, this is shown as part of the cookie banner panel in the toolbar. The first parameter is a shortened URL of the current site-->
@ -358,13 +364,17 @@
<!-- Long text for a detail explanation indicating what will happen if cookie banner handling is on for a site, this is shown as part of the cookie banner panel in the toolbar. The first and second parameter are the application name --> <!-- Long text for a detail explanation indicating what will happen if cookie banner handling is on for a site, this is shown as part of the cookie banner panel in the toolbar. The first and second parameter are the application name -->
<string name="reduce_cookie_banner_details_panel_description_on_for_site" moz:RemovedIn="110" tools:ignore="UnusedResources">%1$s can try to automatically reject cookie requests. If a reject option isnt available, %2$s may accept all cookies to dismiss the banner.</string> <string name="reduce_cookie_banner_details_panel_description_on_for_site" moz:RemovedIn="110" tools:ignore="UnusedResources">%1$s can try to automatically reject cookie requests. If a reject option isnt available, %2$s may accept all cookies to dismiss the banner.</string>
<!-- Long text for a detail explanation indicating what will happen if cookie banner handling is on for a site, this is shown as part of the cookie banner panel in the toolbar. The first and second parameter are the application name --> <!-- Long text for a detail explanation indicating what will happen if cookie banner handling is on for a site, this is shown as part of the cookie banner panel in the toolbar. The first and second parameter are the application name -->
<string name="reduce_cookie_banner_details_panel_description_on_for_site_1">%1$s can try to automatically reject cookie requests.</string> <string name="reduce_cookie_banner_details_panel_description_on_for_site_1" moz:RemovedIn="111" tools:ignore="UnusedResources">%1$s can try to automatically reject cookie requests.</string>
<!-- Long text for a detail explanation indicating what will happen if cookie banner handling is on for a site, this is shown as part of the cookie banner panel in the toolbar. The first and second parameter are the application name -->
<string name="reduce_cookie_banner_details_panel_description_on_for_site_2">%1$s tries to automatically reject all cookie requests on supported sites.</string>
<!-- Title text for the dialog use on the control branch of the experiment to determine which context users engaged the most --> <!-- Title text for the dialog use on the control branch of the experiment to determine which context users engaged the most -->
<string name="reduce_cookie_banner_control_experiment_dialog_title" tools:ignore="UnusedResources">Cookie banners begone!</string> <string name="reduce_cookie_banner_control_experiment_dialog_title">Cookie banners begone!</string>
<!-- Body text for the dialog use on the control branch of the experiment to determine which context users engaged the most --> <!-- Body text for the dialog use on the control branch of the experiment to determine which context users engaged the most -->
<string name="reduce_cookie_banner_control_experiment_dialog_body" moz:RemovedIn="110" tools:ignore="UnusedResources">Automatically reject cookie requests, when possible. Otherwise, accept all cookies to dismiss cookie banners.</string> <string name="reduce_cookie_banner_control_experiment_dialog_body" moz:RemovedIn="110" tools:ignore="UnusedResources">Automatically reject cookie requests, when possible. Otherwise, accept all cookies to dismiss cookie banners.</string>
<!-- Body text for the dialog use on the control branch of the experiment to determine which context users engaged the most --> <!-- Body text for the dialog use on the control branch of the experiment to determine which context users engaged the most -->
<string name="reduce_cookie_banner_control_experiment_dialog_body_1">Automatically reject cookie requests, when possible.</string> <string name="reduce_cookie_banner_control_experiment_dialog_body_1" moz:RemovedIn="111" tools:ignore="UnusedResources">Automatically reject cookie requests, when possible.</string>
<!-- Body text for the dialog use on the control branch of the experiment to determine which context users engaged the most.The first and second parameter are the application name -->
<string name="reduce_cookie_banner_control_experiment_dialog_body_2">Allow %1$s to automatically reject cookie requests when possible?</string>
<!-- Remind me later text button for the onboarding dialog --> <!-- Remind me later text button for the onboarding dialog -->
<string name="reduce_cookie_banner_dialog_not_now_button">Not Now</string> <string name="reduce_cookie_banner_dialog_not_now_button">Not Now</string>
<!-- Change setting text button, for the dialog use on the control branch of the experiment to determine which context users engaged the most --> <!-- Change setting text button, for the dialog use on the control branch of the experiment to determine which context users engaged the most -->

@ -152,7 +152,7 @@ class CookieBannerHandlingDetailsViewTest {
val appName = testContext.getString(R.string.app_name) val appName = testContext.getString(R.string.app_name)
val expectedText = val expectedText =
testContext.getString( testContext.getString(
R.string.reduce_cookie_banner_details_panel_description_on_for_site_1, R.string.reduce_cookie_banner_details_panel_description_on_for_site_2,
appName, appName,
appName, appName,
) )

Loading…
Cancel
Save