Auto-verify setting should not inherit 3rd-party cookie blocking state

At rollout, the Auto-verify content setting (defined as "ANTI_ABUSE")
inherited the user's 3rd party cookie blocking setting. This was because
the Auto-verify setting controls the Private State Tokens API and we
wanted to ensure that if someone already had 3PC turned off at that
point, we weren't loosening that cross-site data sharing ability.

However, with the introduction of the 3rd party cookie deprecation
experiment we no longer want the Auto-verify content setting to inherit
the 3rd party cookie blocking setting. Private State Tokens (PST) were
built to replace some of the functionality of 3rd party cookies in a
more privacy preserving way, and PST is one of the APIs we want to test
during the 3PCD experiment. So we do not want PSTs to be blocked by
default for new clients during the 3PCD experiment.

This will not affect existing clients whose Auto-verify setting has
already inherited the 3PC blocking setting, or clients that have
manually blocked the Auto-verify setting. This just changes the
initialization logic for the Auto-verify setting, so that it will be
enabled by default for new clients.

Bug: 1498978, 1408778
Change-Id: I76cc2c1d4f2ac0ede3c7605cb2a6419d48e7653c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5003105
Commit-Queue: Ryan Kalla <[email protected]>
Reviewed-by: Dominic Battre <[email protected]>
Reviewed-by: Christian Dullweber <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1219521}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 1e7a865..5da1b6f 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -951,6 +951,10 @@
     "ash.night_light.cached_longitude";
 #endif
 
+// Deprecated 11/2023.
+const char kPrivacySandboxAntiAbuseInitialized[] =
+    "privacy_sandbox.anti_abuse_initialized";
+
 // Register local state used only for migration (clearing or moving to a new
 // key).
 void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -1342,6 +1346,9 @@
   registry->RegisterDoublePref(kNightLightCachedLatitude, 0.0);
   registry->RegisterDoublePref(kNightLightCachedLongitude, 0.0);
 #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
+
+  // Deprecated 11/2023.
+  registry->RegisterBooleanPref(kPrivacySandboxAntiAbuseInitialized, false);
 }
 
 void ClearSyncRequestedPrefAndMaybeMigrate(PrefService* profile_prefs) {
@@ -2524,6 +2531,9 @@
   profile_prefs->ClearPref(kNightLightCachedLongitude);
 #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
+  // Added 11/2023
+  profile_prefs->ClearPref(kPrivacySandboxAntiAbuseInitialized);
+
   // Please don't delete the following line. It is used by PRESUBMIT.py.
   // END_MIGRATE_OBSOLETE_PROFILE_PREFS