[Event Sequencing] Use platform2 reset counter
Removes a Prefs implementation to determine the reset counter with a platform2 determined value. This removes the prefs associated with the original implementation.
Bug: crbug/1350322
Change-Id: Ief9dcb8c9d871ec712bd417df5ce47e44804d7f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4205072
Reviewed-by: Jong Ahn <[email protected]>
Commit-Queue: Andrew Bregger <[email protected]>
Reviewed-by: Dominic Battré <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1099623}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 8f31152..3e9df61 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -839,6 +839,16 @@
const char kAutofillCreditCardSigninPromoImpressionCount[] =
"autofill.credit_card_signin_promo_impression_count";
+// Deprecated 01/2023
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+const char kEventSequenceLastSystemUptime[] =
+ "metrics.event_sequence.last_system_uptime";
+
+// Keeps track of the device reset counter.
+const char kEventSequenceResetCounter[] =
+ "metrics.event_sequence.reset_counter";
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
// Register local state used only for migration (clearing or moving to a new
// key).
void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -914,6 +924,12 @@
#if BUILDFLAG(IS_MAC)
registry->RegisterBooleanPref(kDeviceTrustDisableKeyCreationPref, false);
#endif // BUILDFLAG(IS_MAC)
+
+ // Deprecated 01/2023
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+ registry->RegisterIntegerPref(kEventSequenceResetCounter, 0);
+ registry->RegisterInt64Pref(kEventSequenceLastSystemUptime, 0);
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
// Register prefs used only for migration (clearing or moving to a new key).
@@ -1894,6 +1910,12 @@
local_state->ClearPref(kDeviceTrustDisableKeyCreationPref);
#endif // BUILDFLAG(IS_MAC)
+ // Added 01/2023
+#if BUILDFLAG(IS_CHROMEOS_ASH)
+ local_state->ClearPref(kEventSequenceLastSystemUptime);
+ local_state->ClearPref(kEventSequenceResetCounter);
+#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+
// Please don't delete the following line. It is used by PRESUBMIT.py.
// END_MIGRATE_OBSOLETE_LOCAL_STATE_PREFS
@@ -2151,8 +2173,9 @@
profile_prefs->GetString(prefs::kGoogleServicesLastAccountIdDeprecated);
profile_prefs->ClearPref(prefs::kGoogleServicesLastAccountIdDeprecated);
bool is_email = account_id.find('@') != std::string::npos;
- if (!is_email && !account_id.empty())
+ if (!is_email && !account_id.empty()) {
profile_prefs->SetString(prefs::kGoogleServicesLastGaiaId, account_id);
+ }
}
// Added 10/2022.