[UPMLocalPwd] Clean up the unused migration warning prefs (pt 11)
The prefs stopped being used in crrev.com/c/6239110 so they are
deprecated.
Note: I've followed the guidelines from the README
https://chromium.googlesource.com/chromium/src/+/HEAD/chrome/browser/prefs/README.md#deleting-an-old-pref
The last step would be to clean up prefs older than a year, but there
were no prefs from February 2024 or older left to clean up so I don't
have a follow up step for that.
Bug: 377285449
Change-Id: Ie67b10c2ec7f2d1b6d6335523c8bc64d6067f0f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6243759
Reviewed-by: Ioana Pandele <[email protected]>
Reviewed-by: Dominic Battré <[email protected]>
Commit-Queue: Ivana Žužić <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1418078}
diff --git a/chrome/browser/password_manager/android/local_passwords_migration_warning_util.cc b/chrome/browser/password_manager/android/local_passwords_migration_warning_util.cc
index 0668a9e..32610f5 100644
--- a/chrome/browser/password_manager/android/local_passwords_migration_warning_util.cc
+++ b/chrome/browser/password_manager/android/local_passwords_migration_warning_util.cc
@@ -59,7 +59,7 @@
// The post password migration sheet should be shown for an active UPM user
// that uses split stores only once, so
- // `kLocalPasswordMigrationWarningShownAtStartup` will be true only when the
+ // `kShouldShowPostPasswordMigrationSheetAtStartup` will be true only when the
// migration algorithm sets it to true and it will be flipped to false when
// the sheet is shown.
return profile->GetPrefs()->GetBoolean(
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index ea871f7..745c2ce 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -1092,6 +1092,14 @@
inline constexpr char kUserAgentClientHintsGREASEUpdateEnabled[] =
"policy.user_agent_client_hints_grease_update_enabled";
+#if BUILDFLAG(IS_ANDROID)
+// Deprecated 2/2025.
+inline constexpr char kLocalPasswordsMigrationWarningShownTimestamp[] =
+ "local_passwords_migration_warning_shown_timestamp";
+inline constexpr char kLocalPasswordMigrationWarningShownAtStartup[] =
+ "local_passwords_migration_warning_shown_at_startup";
+#endif // BUILDFLAG(IS_ANDROID)
+
// Register local state used only for migration (clearing or moving to a new
// key).
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -1519,6 +1527,14 @@
// Deprecated 01/2025.
registry->RegisterBooleanPref(kUsedPolicyCertificates, false);
#endif // BUILDFLAG(IS_CHROMEOS)
+
+#if BUILDFLAG(IS_ANDROID)
+ // Deprecated 02/2025.
+ registry->RegisterTimePref(kLocalPasswordsMigrationWarningShownTimestamp,
+ base::Time());
+ registry->RegisterBooleanPref(kLocalPasswordMigrationWarningShownAtStartup,
+ false);
+#endif // BUILDFLAG(IS_ANDROID)
}
} // namespace
@@ -2798,6 +2814,12 @@
profile_prefs->ClearPref(kUsedPolicyCertificates);
#endif // BUILDFLAG(IS_CHROMEOS)
+#if BUILDFLAG(IS_ANDROID)
+ // Added 02/2025.
+ profile_prefs->ClearPref(kLocalPasswordsMigrationWarningShownTimestamp);
+ profile_prefs->ClearPref(kLocalPasswordMigrationWarningShownAtStartup, );
+#endif // BUILDFLAG(IS_ANDROID)
+
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_PROFILE_PREFS
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc
index 739a8f5..f25a42c 100644
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -424,10 +424,6 @@
registry->RegisterStringPref(prefs::kUPMErrorUIShownTimestamp, "0");
registry->RegisterBooleanPref(
prefs::kUserAcknowledgedLocalPasswordsMigrationWarning, false);
- registry->RegisterTimePref(
- prefs::kLocalPasswordsMigrationWarningShownTimestamp, base::Time());
- registry->RegisterBooleanPref(
- prefs::kLocalPasswordMigrationWarningShownAtStartup, false);
registry->RegisterIntegerPref(
prefs::kLocalPasswordMigrationWarningPrefsVersion, 0);
registry->RegisterIntegerPref(
diff --git a/components/password_manager/core/common/password_manager_pref_names.h b/components/password_manager/core/common/password_manager_pref_names.h
index d201539..7904905 100644
--- a/components/password_manager/core/common/password_manager_pref_names.h
+++ b/components/password_manager/core/common/password_manager_pref_names.h
@@ -189,17 +189,6 @@
"local.password_hash_data_list";
#if BUILDFLAG(IS_ANDROID)
-// The timestamp at which the last UPM local passwords migration warning was
-// shown to the user in microseconds since Windows epoch. This is needed to
-// ensure that the UI is prompted only once per given time interval (currently
-// one month).
-inline constexpr char kLocalPasswordsMigrationWarningShownTimestamp[] =
- "local_passwords_migration_warning_shown_timestamp";
-
-// Whether the local password migration warning was already shown at startup.
-inline constexpr char kLocalPasswordMigrationWarningShownAtStartup[] =
- "local_passwords_migration_warning_shown_at_startup";
-
// The version of the password migration warning prefs.
inline constexpr char kLocalPasswordMigrationWarningPrefsVersion[] =
"local_passwords_migration_warning_reset_count";