From 86c1fbf7eff0084093a09ed34b959ab68cd50759 Mon Sep 17 00:00:00 2001 From: Vadym Struts Date: Mon, 23 Dec 2024 16:48:24 +0100 Subject: [PATCH 01/13] added warning for desktop Signed-off-by: Vadym Struts --- .../privacy/settings/BravePrivacySettings.java | 10 +++++++++- android/java/res/xml/brave_privacy_preferences.xml | 4 ++++ browser/about_flags.cc | 6 ++++-- .../default_brave_shields_page.html | 11 ++++++++++- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java b/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java index 80363d488fd7..d7f0b9e9d385 100644 --- a/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java +++ b/android/java/org/chromium/chrome/browser/privacy/settings/BravePrivacySettings.java @@ -42,6 +42,7 @@ import org.chromium.mojo.bindings.ConnectionErrorHandler; import org.chromium.mojo.system.MojoException; import org.chromium.webcompat_reporter.mojom.WebcompatReporterHandler; +import org.chromium.components.browser_ui.settings.TextMessagePreference; /** Fragment to keep track of the all the brave privacy related preferences. */ public class BravePrivacySettings extends PrivacySettings implements ConnectionErrorHandler { @@ -101,7 +102,8 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE private static final String PREF_REQUEST_OTR = "request_otr"; public static final String PREF_BLOCK_TRACKERS_ADS = "block_trackers_ads"; - private static final String PREF_BLOCK_CROSS_SITE_COOKIES = "block_cross_site_cookies"; + private static final String PREF_BLOCK_CROSS_SITE_COOKIES = "block_cross_site_cookies"; + private static final String BLOCK_CROSS_SITE_COOKIES_LEARN_MORE = "block_all_cross_site_cookies_learn_more"; private static final String PREF_SHIELDS_SUMMARY = "shields_summary"; private static final String PREF_CLEAR_ON_EXIT = "clear_on_exit"; private static final String PREF_HTTPS_UPGRADE = "https_upgrade"; @@ -117,6 +119,7 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE PREF_HTTPS_FIRST_MODE, PREF_BLOCK_SCRIPTS, PREF_BLOCK_CROSS_SITE_COOKIES, + BLOCK_CROSS_SITE_COOKIES_LEARN_MORE, PREF_FINGERPRINTING_PROTECTION, PREF_FINGERPRINTING_PROTECTION2, PREF_FINGERPRINT_LANGUAGE, @@ -163,6 +166,7 @@ public class BravePrivacySettings extends PrivacySettings implements ConnectionE private ChromeSwitchPreference mCanMakePayment; private BraveDialogPreference mAdsTrakersBlockPref; private BraveDialogPreference mBlockCrosssiteCookies; + private TextMessagePreference mBlockCrosssiteCookiesLearnMore; private ChromeSwitchPreference mDeAmpPref; private ChromeSwitchPreference mDebouncePref; private ChromeSwitchPreference mHttpsFirstModePref; @@ -280,6 +284,9 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { (BraveDialogPreference) findPreference(PREF_BLOCK_CROSS_SITE_COOKIES); mBlockCrosssiteCookies.setOnPreferenceChangeListener(this); + mBlockCrosssiteCookiesLearnMore = + (TextMessagePreference) findPreference(BLOCK_CROSS_SITE_COOKIES_LEARN_MORE); + mBlockScriptsPref = (ChromeSwitchPreference) findPreference(PREF_BLOCK_SCRIPTS); mBlockScriptsPref.setOnPreferenceChangeListener(this); @@ -511,6 +518,7 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { 0, ChromeFeatureList.isEnabled(BraveFeatureList.BRAVE_BLOCK_ALL_COOKIES_TOGGLE) || (int) newValue == STRICT); + mBlockCrosssiteCookiesLearnMore.itemView.setVisibility(STRICT == (int)newValue); switch ((int) newValue) { case STRICT: BraveShieldsContentSettings.setCookiesPref( diff --git a/android/java/res/xml/brave_privacy_preferences.xml b/android/java/res/xml/brave_privacy_preferences.xml index 7b109d8c5109..cd3619a1e700 100644 --- a/android/java/res/xml/brave_privacy_preferences.xml +++ b/android/java/res/xml/brave_privacy_preferences.xml @@ -34,6 +34,10 @@ app:dialog_subtitle="@string/block_cookies_text" app:dialog_entries="@array/blockCookiesTexts" app:dialog_default_index="1" /> + +
-
$i18n{cookieControlLabel}
+
+
$i18n{cookieControlLabel}
+ +