simplify Disable FLoC and privacy sandbox

This commit is contained in:
Carmelo Messina
2023-05-07 17:30:17 +02:00
parent 98c09be8d8
commit 41d8cdfe2d
@@ -10,80 +10,18 @@ Also added the disabling of blink features through the DisabledForBromite tag
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
.../java/res/xml/privacy_preferences.xml | 4 ---
.../privacy/settings/PrivacySettings.java | 22 -------------
.../browser/chrome_content_browser_client.cc | 3 ++
.../privacy_sandbox_settings_delegate.cc | 1 +
.../history/core/browser/history_backend.cc | 13 +-------
.../privacy_sandbox_features.cc | 10 +++---
.../privacy_sandbox/privacy_sandbox_prefs.cc | 2 +-
.../privacy_sandbox_settings_impl.cc | 33 +++++++++----------
8 files changed, 27 insertions(+), 61 deletions(-)
6 files changed, 27 insertions(+), 35 deletions(-)
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -69,10 +69,6 @@ found in the LICENSE file.
android:title="@string/open_external_links_incognito_title"
android:summary="@string/open_external_links_incognito_summary"
android:defaultValue="false" />
- <Preference
- android:key="privacy_sandbox"
- android:title="@string/prefs_privacy_sandbox"
- android:fragment="org.chromium.chrome.browser.privacy_sandbox.PrivacySandboxSettingsFragmentV3"/>
<PreferenceCategory
android:key="services_category"
android:title="@string/services_category_title">
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
@@ -65,8 +65,6 @@ public class PrivacySettings extends PreferenceFragmentCompat
private static final String PREF_SECURE_DNS = "secure_dns";
private static final String PREF_DO_NOT_TRACK = "do_not_track";
private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
- private static final String PREF_PRIVACY_SANDBOX = "privacy_sandbox";
- private static final String PREF_PROXY_OPTIONS = "proxy";
private static final String PREF_PRIVACY_GUIDE = "privacy_guide";
private static final String PREF_INCOGNITO_LOCK = "incognito_lock";
private static final String PREF_THIRD_PARTY_COOKIES = "third_party_cookies";
@@ -100,19 +98,6 @@ public class PrivacySettings extends PreferenceFragmentCompat
SettingsUtils.addPreferencesFromResource(this, R.xml.privacy_preferences);
}
- Preference sandboxPreference = findPreference(PREF_PRIVACY_SANDBOX);
- if (PrivacySandboxBridge.isPrivacySandboxRestricted()) {
- // Hide the Privacy Sandbox if it is restricted.
- getPreferenceScreen().removePreference(sandboxPreference);
- } else {
- // Overwrite the click listener to pass a correct referrer to the fragment.
- sandboxPreference.setOnPreferenceClickListener(preference -> {
- PrivacySandboxSettingsBaseFragment.launchPrivacySandboxSettings(getContext(),
- new SettingsLauncherImpl(), PrivacySandboxReferrer.PRIVACY_SETTINGS);
- return true;
- });
- }
-
Preference privacyGuidePreference = findPreference(PREF_PRIVACY_GUIDE);
// Record the launch of PG from the S&P link-row entry point
privacyGuidePreference.setOnPreferenceClickListener(preference -> {
@@ -261,13 +246,6 @@ public class PrivacySettings extends PreferenceFragmentCompat
secureDnsPref.setSummary(SecureDnsSettings.getSummary(getContext()));
}
- Preference privacySandboxPreference = findPreference(PREF_PRIVACY_SANDBOX);
- if (privacySandboxPreference != null
- && !ChromeFeatureList.isEnabled(ChromeFeatureList.PRIVACY_SANDBOX_SETTINGS_4)) {
- privacySandboxPreference.setSummary(
- PrivacySandboxSettingsBaseFragment.getStatusString(getContext()));
- }
-
mIncognitoLockSettings.updateIncognitoReauthPreferenceIfNeeded(getActivity());
Preference thirdPartyCookies = findPreference(PREF_THIRD_PARTY_COOKIES);
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -3322,6 +3322,9 @@ bool ChromeContentBrowserClient::IsAttributionReportingOperationAllowed(
@@ -3324,6 +3324,9 @@ bool ChromeContentBrowserClient::IsAttributionReportingOperationAllowed(
const url::Origin* source_origin,
const url::Origin* destination_origin,
const url::Origin* reporting_origin) {