Remove obsolete prefs::kPrivacySandboxApisEnabled preference
Support for this preference was removed upstream a year ago, but the preference itself was retained. It has now been removed, so we need to delete our references to it. Chromium change: https://source.chromium.org/chromium/chromium/src/+/1eeb0203b9648c1f4f17761334da6fca2afcfebc commit 1eeb0203b9648c1f4f17761334da6fca2afcfebc Author: Ivan Šandrk <isandrk@chromium.org> Date: Fri Mar 21 09:28:19 2025 -0700 Cleanup prefs deprecated for a year (03/2024) Bug: b:405359352
This commit is contained in:
@@ -348,10 +348,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->SetDefaultPrefValue(policy::policy_prefs::kHideWebStoreIcon,
|
||||
base::Value(true));
|
||||
|
||||
// Disable Chromium's privacy sandbox
|
||||
registry->SetDefaultPrefValue(prefs::kPrivacySandboxApisEnabled,
|
||||
base::Value(false));
|
||||
|
||||
// Importer: selected data types
|
||||
registry->RegisterBooleanPref(kImportDialogExtensions, true);
|
||||
registry->RegisterBooleanPref(kImportDialogPayments, true);
|
||||
|
||||
@@ -13,8 +13,6 @@ namespace prefs {
|
||||
// The following prefs have been deprecated and privated, however in Brave it
|
||||
// is necessary to keep these prefs visible while they are deprecated to make
|
||||
// sure these modes are not enabled.
|
||||
inline constexpr char kPrivacySandboxApisEnabled[] =
|
||||
"privacy_sandbox.apis_enabled";
|
||||
inline constexpr char kPrivacySandboxManuallyControlledV2[] =
|
||||
"privacy_sandbox.manually_controlled_v2";
|
||||
|
||||
|
||||
@@ -523,45 +523,6 @@ TEST_F(PrivacySandboxSettingsTest, IsTopicsAllowed) {
|
||||
/*managed_cookie_exceptions=*/{});
|
||||
|
||||
EXPECT_FALSE(privacy_sandbox_settings()->IsTopicsAllowed());
|
||||
|
||||
// Check that even manually updating the preferences, we still don't get this
|
||||
// enabled.
|
||||
profile()->GetTestingPrefService()->SetBoolean(
|
||||
prefs::kPrivacySandboxApisEnabled, true);
|
||||
EXPECT_FALSE(privacy_sandbox_settings()->IsTopicsAllowed());
|
||||
|
||||
SetupTestState(
|
||||
prefs(), host_content_settings_map(),
|
||||
/*block_third_party_cookies=*/false,
|
||||
/*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_BLOCK,
|
||||
/*user_cookie_exceptions=*/{},
|
||||
/*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting,
|
||||
/*managed_cookie_exceptions=*/{});
|
||||
profile()->GetTestingPrefService()->SetBoolean(
|
||||
prefs::kPrivacySandboxApisEnabled, true);
|
||||
EXPECT_FALSE(privacy_sandbox_settings()->IsTopicsAllowed());
|
||||
|
||||
SetupTestState(
|
||||
prefs(), host_content_settings_map(),
|
||||
/*block_third_party_cookies=*/false,
|
||||
/*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW,
|
||||
/*user_cookie_exceptions=*/{},
|
||||
/*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting,
|
||||
/*managed_cookie_exceptions=*/{});
|
||||
profile()->GetTestingPrefService()->SetBoolean(
|
||||
prefs::kPrivacySandboxApisEnabled, true);
|
||||
EXPECT_FALSE(privacy_sandbox_settings()->IsTopicsAllowed());
|
||||
|
||||
SetupTestState(
|
||||
prefs(), host_content_settings_map(),
|
||||
/*block_third_party_cookies=*/false,
|
||||
/*default_cookie_setting=*/ContentSetting::CONTENT_SETTING_ALLOW,
|
||||
/*user_cookie_exceptions=*/{},
|
||||
/*managed_cookie_setting=*/privacy_sandbox_test_util::kNoSetting,
|
||||
/*managed_cookie_exceptions=*/{});
|
||||
profile()->GetTestingPrefService()->SetBoolean(
|
||||
prefs::kPrivacySandboxApisEnabled, true);
|
||||
EXPECT_FALSE(privacy_sandbox_settings()->IsTopicsAllowed());
|
||||
}
|
||||
|
||||
class PrivacySandboxSettingsTestCookiesClearOnExitTurnedOff
|
||||
|
||||
@@ -26,11 +26,6 @@ BravePrivacySandboxSettings::BravePrivacySandboxSettings(
|
||||
: pref_service_(pref_service) {
|
||||
// Register observers for the Privacy Sandbox.
|
||||
user_prefs_registrar_.Init(pref_service_);
|
||||
user_prefs_registrar_.Add(
|
||||
prefs::kPrivacySandboxApisEnabled,
|
||||
base::BindRepeating(
|
||||
&BravePrivacySandboxSettings::OnPrivacySandboxPrefChanged,
|
||||
base::Unretained(this)));
|
||||
user_prefs_registrar_.Add(
|
||||
prefs::kPrivacySandboxRelatedWebsiteSetsEnabled,
|
||||
base::BindRepeating(
|
||||
@@ -43,9 +38,6 @@ BravePrivacySandboxSettings::~BravePrivacySandboxSettings() = default;
|
||||
void BravePrivacySandboxSettings::OnPrivacySandboxPrefChanged() {
|
||||
// Make sure that Private Sandbox features remain disabled even if we manually
|
||||
// access the Pref service and try to change the preferences from there.
|
||||
if (pref_service_->GetBoolean(prefs::kPrivacySandboxApisEnabled)) {
|
||||
pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabled, false);
|
||||
}
|
||||
if (pref_service_->GetBoolean(
|
||||
prefs::kPrivacySandboxRelatedWebsiteSetsEnabled)) {
|
||||
pref_service_->SetBoolean(prefs::kPrivacySandboxRelatedWebsiteSetsEnabled,
|
||||
|
||||
Reference in New Issue
Block a user