Remove migration code for UnifiedConsentService from non-ChromeOS

This CL removes the migration code from the UnifiedConsentService on
non-ChromeOS platforms as the migration is now over. Note that new
profiles on this platforms are always signed out of Chrome, so the
existing migration code is a no-op.

This CL does not make the same change on ChromeOS as it is not clear
how ChromeOS sets the sync account for regular profiles. It is
assumed that the migration code enables
UrlKeyedAnonymizedDataCollection, so it cannot be removed.

Bug: 1459986

Change-Id: Id8fdb26d85bf5737317fc27e39bec07697b9dabe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4660483
Reviewed-by: Marc Treib <[email protected]>
Reviewed-by: Dominic Battre <[email protected]>
Commit-Queue: Mihai Sardarescu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1165496}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 2c17f92..eab97f3 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -906,6 +906,11 @@
 const char kVideoPreviewsType[] = "ntp_snippets.video_previews_type";
 #endif  // BUILDFLAG(ENABLE_FEED_V2)
 
+// Deprecated 07/2023.
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
+const char kUnifiedConsentMigrationState[] = "unified_consent.migration_state";
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
+
 // Register local state used only for migration (clearing or moving to a new
 // key).
 void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -1299,6 +1304,11 @@
   registry->RegisterTimePref(kGaiaLastOnlineSignInTime, base::Time());
   registry->RegisterTimePref(kSAMLLastGAIASignInTime, base::Time());
 #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
+
+// Deprecated 07/2023.
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
+  registry->RegisterIntegerPref(kUnifiedConsentMigrationState, 0);
+#endif  // !BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 }  // namespace
@@ -2433,6 +2443,11 @@
   profile_prefs->ClearPref(kSAMLLastGAIASignInTime);
 #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 
+// Added 07/2023.
+#if !BUILDFLAG(IS_CHROMEOS_ASH)
+  profile_prefs->ClearPref(kUnifiedConsentMigrationState);
+#endif
+
   // Please don't delete the following line. It is used by PRESUBMIT.py.
   // END_MIGRATE_OBSOLETE_PROFILE_PREFS