[DIPS] Make DIPS store the timer-last-fired timestamp in the DIPS DB.

This helps us move to //content, which has no concept of user prefs.

Remove the old kDIPSTimerLastUpdate user preference. We don't need to
migrate the previous value, because at worst the timer will just run an
hour (i.e., kDIPSTimerDelay) early.

Bug: 40883201
Change-Id: Iff2c63b9c0c17520ef320ca340276fe37448763b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5322340
Reviewed-by: Joshua Hood <[email protected]>
Reviewed-by: Dominic Battre <[email protected]>
Commit-Queue: Ryan Tarpine <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1287660}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 65af203b..14c785c5 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -1034,6 +1034,9 @@
 inline constexpr char kOmniboxInstantKeywordUsed[] =
     "omnibox.instant_keyword_used";
 
+// Deprecated 04/2024.
+inline constexpr char kDIPSTimerLastUpdate[] = "dips_timer_last_update";
+
 // Register local state used only for migration (clearing or moving to a new
 // key).
 void RegisterLocalStatePrefsForMigration(PrefRegistrySimple* registry) {
@@ -1470,6 +1473,9 @@
 
   // Deprecated 04/2024.
   registry->RegisterBooleanPref(kOmniboxInstantKeywordUsed, false);
+
+  // Deprecated 04/2024.
+  registry->RegisterTimePref(kDIPSTimerLastUpdate, base::Time());
 }
 
 void ClearSyncRequestedPrefAndMaybeMigrate(PrefService* profile_prefs) {
@@ -2169,8 +2175,6 @@
                                 false);
 #endif
 
-  registry->RegisterTimePref(prefs::kDIPSTimerLastUpdate, base::Time());
-
 #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
   registry->RegisterBooleanPref(prefs::kAccessibilityPdfOcrAlwaysActive, true);
 #endif  // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
@@ -2775,6 +2779,9 @@
   // Added 04/2024.
   profile_prefs->ClearPref(kOmniboxInstantKeywordUsed);
 
+  // Added 04/2024.
+  profile_prefs->ClearPref(kDIPSTimerLastUpdate);
+
   // Please don't delete the following line. It is used by PRESUBMIT.py.
   // END_MIGRATE_OBSOLETE_PROFILE_PREFS