Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(648)

Unified Diff: components/proximity_auth/proximity_auth_pref_manager.cc

Issue 2902093002: [EasyUnlock] Force user to enter their password after 20 hours. (Closed)
Patch Set: fix test Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/proximity_auth/proximity_auth_pref_manager.cc
diff --git a/components/proximity_auth/proximity_auth_pref_manager.cc b/components/proximity_auth/proximity_auth_pref_manager.cc
index 7d2dbd6937b4b17e2a23274b30adc64242f660ef..c8c637c0cf2b8869ce7a8c40e334d6f952b7801a 100644
--- a/components/proximity_auth/proximity_auth_pref_manager.cc
+++ b/components/proximity_auth/proximity_auth_pref_manager.cc
@@ -24,6 +24,8 @@ ProximityAuthPrefManager::~ProximityAuthPrefManager() {}
// static
void ProximityAuthPrefManager::RegisterPrefs(PrefRegistrySimple* registry) {
+ registry->RegisterInt64Pref(prefs::kProximityAuthLastPasswordEntryTimestampMs,
+ 0L);
registry->RegisterDictionaryPref(prefs::kProximityAuthRemoteBleDevices);
}
@@ -103,6 +105,16 @@ bool ProximityAuthPrefManager::RemoveDeviceWithPublicKey(
const std::string& public_key) {
return RemoveDeviceWithAddress(GetDeviceAddress(public_key));
}
+void ProximityAuthPrefManager::SetLastPasswordEntryTimestampMs(
+ int64_t timestamp_ms) {
+ pref_service_->SetInt64(prefs::kProximityAuthLastPasswordEntryTimestampMs,
+ timestamp_ms);
+}
+
+int64_t ProximityAuthPrefManager::GetLastPasswordEntryTimestampMs() const {
+ return pref_service_->GetInt64(
+ prefs::kProximityAuthLastPasswordEntryTimestampMs);
+}
const base::DictionaryValue* ProximityAuthPrefManager::GetRemoteBleDevices()
const {

Powered by Google App Engine
This is Rietveld 408576698