Cross Device: Remove Android Messages integration [part 5].

Remove and clear Android SMS prefs.

Bug: b/297567461
Test: none
Change-Id: I3e29afef80af41fcbd031a5f62e67d22b9294a3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4912200
Reviewed-by: Jon Mann <[email protected]>
Auto-Submit: James Hawkins <[email protected]>
Reviewed-by: Alex Ilin <[email protected]>
Commit-Queue: Alex Ilin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1205706}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 72bcfa2..4c469af 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -560,28 +560,6 @@
 const char kOriginTrialPrefKey[] = "origin_trials.persistent_trials";
 
 #if BUILDFLAG(IS_CHROMEOS_ASH)
-// Deprecated 09/2022.
-constexpr char kClipboardHistoryNewFeatureBadgeCount[] =
-    "ash.clipboard.multipaste_nudges.new_feature_shown_count";
-constexpr char kUsersLastInputMethod[] = "UsersLRUInputMethod";
-#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
-
-// Deprecated 09/2022.
-const char kPrivacySandboxFirstPartySetsDataAccessAllowed[] =
-    "privacy_sandbox.first_party_sets_data_access_allowed";
-
-#if BUILDFLAG(IS_ANDROID)
-// Deprecated 09/2022.
-const char kDeprecatedAutofillAssistantConsent[] = "autofill_assistant_switch";
-const char kDeprecatedAutofillAssistantEnabled[] =
-    "AUTOFILL_ASSISTANT_ONBOARDING_ACCEPTED";
-const char kDeprecatedAutofillAssistantTriggerScriptsEnabled[] =
-    "Chrome.AutofillAssistant.ProactiveHelp";
-const char kDeprecatedAutofillAssistantTriggerScriptsIsFirstTimeUser[] =
-    "Chrome.AutofillAssistant.LiteScriptFirstTimeUser";
-#endif  // BUILDFLAG(IS_ANDROID)
-
-#if BUILDFLAG(IS_CHROMEOS_ASH)
 // Deprecated 10/2022.
 const char kSuggestedContentInfoShownInLauncher[] =
     "ash.launcher.suggested_content_info_shown";
@@ -958,14 +936,15 @@
 // Deprecated 10/2023.
 inline constexpr char kSyncRequested[] = "sync.requested";
 
+// Deprecated 10/2023.
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+const char kLastSuccessfulDomainPref[] = "android_sms.last_successful_domain";
+const char kShouldAttemptReenable[] = "android_sms.should_attempt_reenable";
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
+
 // Register local state used only for migration (clearing or moving to a new
 // key).
 void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
-#if BUILDFLAG(IS_CHROMEOS_ASH)
-  // Deprecated 09/2022
-  registry->RegisterDictionaryPref(kUsersLastInputMethod);
-#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
-
 // Deprecated 11/2022.
 #if BUILDFLAG(ENABLE_BACKGROUND_MODE) && BUILDFLAG(IS_MAC)
   registry->RegisterBooleanPref(kUserRemovedLoginItem, false);
@@ -1105,14 +1084,6 @@
   registry->RegisterBooleanPref(kTokenServiceDiceCompatible, false);
 #endif  // BUILDFLAG(ENABLE_DICE_SUPPORT)
 
-  // Deprecated 09/2022
-  registry->RegisterBooleanPref(kPrivacySandboxFirstPartySetsDataAccessAllowed,
-                                true);
-
-#if BUILDFLAG(IS_CHROMEOS_ASH)
-  registry->RegisterIntegerPref(kClipboardHistoryNewFeatureBadgeCount, 0);
-#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
-
 #if BUILDFLAG(ENABLE_EXTENSIONS)
   // Deprecated 10/2022.
   registry->RegisterBooleanPref(kLoadCryptoTokenExtension, false);
@@ -1343,6 +1314,12 @@
   registry->RegisterBooleanPref(kSettingsMigratedToUPM, false);
 #endif
   registry->RegisterBooleanPref(kSyncRequested, false);
+
+  // Deprecated 10/2023.
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+  registry->RegisterStringPref(kLastSuccessfulDomainPref, std::string());
+  registry->RegisterBooleanPref(kShouldAttemptReenable, true);
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
 }
 
 void ClearSyncRequestedPrefAndMaybeMigrate(PrefService* profile_prefs) {
@@ -2073,11 +2050,6 @@
   // BEGIN_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS
   // Please don't delete the preceding line. It is used by PRESUBMIT.py.
 
-#if BUILDFLAG(IS_CHROMEOS_ASH)
-  // Added 09/2022
-  local_state->ClearPref(kUsersLastInputMethod);
-#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
-
 #if BUILDFLAG(ENABLE_BACKGROUND_MODE) && BUILDFLAG(IS_MAC)
   // Added 11/2022.
   local_state->ClearPref(kUserRemovedLoginItem);
@@ -2244,36 +2216,6 @@
   profile_prefs->ClearPref(kTokenServiceDiceCompatible);
 #endif  // BUILDFLAG(ENABLE_DICE_SUPPORT)
 
-  // Added 09/2022.
-  profile_prefs->ClearPref(kPrivacySandboxFirstPartySetsDataAccessAllowed);
-
-#if BUILDFLAG(IS_CHROMEOS_ASH)
-  // Added 09/2022.
-  profile_prefs->ClearPref(kClipboardHistoryNewFeatureBadgeCount);
-#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
-
-// Added 09/2022.
-#if BUILDFLAG(IS_ANDROID)
-  auto migrate_shared_pref = [profile_prefs](const std::string& source,
-                                             const std::string& target) {
-    if (absl::optional<bool> shared_pref =
-            android::shared_preferences::GetAndClearBoolean(source);
-        shared_pref) {
-      profile_prefs->SetBoolean(target, shared_pref.value());
-    }
-  };
-
-  // These settings will also need to be deleted from ChromePreferenceKeys.java.
-  migrate_shared_pref(kDeprecatedAutofillAssistantConsent,
-                      kAutofillAssistantConsent);
-  migrate_shared_pref(kDeprecatedAutofillAssistantEnabled,
-                      kAutofillAssistantEnabled);
-  migrate_shared_pref(kDeprecatedAutofillAssistantTriggerScriptsEnabled,
-                      kAutofillAssistantTriggerScriptsEnabled);
-  migrate_shared_pref(kDeprecatedAutofillAssistantTriggerScriptsIsFirstTimeUser,
-                      kAutofillAssistantTriggerScriptsIsFirstTimeUser);
-#endif
-
   // Added 10/2022
 #if BUILDFLAG(IS_ANDROID)
   feed::MigrateObsoleteProfilePrefsOct_2022(profile_prefs);
@@ -2533,6 +2475,12 @@
   // Added 10/2023.
   ClearSyncRequestedPrefAndMaybeMigrate(profile_prefs);
 
+// Added 10/2023.
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+  profile_prefs->ClearPref(kLastSuccessfulDomainPref);
+  profile_prefs->ClearPref(kShouldAttemptReenable);
+#endif  // BUILDFLAG(IS_CHROMEOS_ASH)
+
   // Please don't delete the following line. It is used by PRESUBMIT.py.
   // END_MIGRATE_OBSOLETE_PROFILE_PREFS