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

Unified Diff: chrome/browser/chromeos/login/quick_unlock/pin_storage.cc

Issue 2715823004: Add FingerprintUnlock KeyedService for each profile (Closed)
Patch Set: rebase Created 3 years, 10 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: chrome/browser/chromeos/login/quick_unlock/pin_storage.cc
diff --git a/chrome/browser/chromeos/login/quick_unlock/pin_storage.cc b/chrome/browser/chromeos/login/quick_unlock/pin_storage.cc
index bc4e2f79907373a9a7a27d86b7969f15d912a3e3..4afc6de7cf2b789dda1e7f6bcb369a54611064cd 100644
--- a/chrome/browser/chromeos/login/quick_unlock/pin_storage.cc
+++ b/chrome/browser/chromeos/login/quick_unlock/pin_storage.cc
@@ -38,22 +38,6 @@ std::string ComputeSecret(const std::string& pin, const std::string& salt) {
return key.GetSecret();
}
-base::TimeDelta PasswordConfirmationFrequencyToTimeDelta(
- PasswordConfirmationFrequency frequency) {
- switch (frequency) {
- case PasswordConfirmationFrequency::SIX_HOURS:
- return base::TimeDelta::FromHours(6);
- case PasswordConfirmationFrequency::TWELVE_HOURS:
- return base::TimeDelta::FromHours(12);
- case PasswordConfirmationFrequency::DAY:
- return base::TimeDelta::FromDays(1);
- case PasswordConfirmationFrequency::WEEK:
- return base::TimeDelta::FromDays(7);
- }
- NOTREACHED();
- return base::TimeDelta();
-}
-
} // namespace
// static
@@ -67,29 +51,6 @@ PinStorage::PinStorage(PrefService* pref_service)
PinStorage::~PinStorage() {}
-void PinStorage::MarkStrongAuth() {
- last_strong_auth_ = base::Time::Now();
- ResetUnlockAttemptCount();
-}
-
-bool PinStorage::HasStrongAuth() const {
- if (last_strong_auth_.is_null())
- return false;
-
- PasswordConfirmationFrequency strong_auth_interval =
- static_cast<PasswordConfirmationFrequency>(
- pref_service_->GetInteger(prefs::kQuickUnlockTimeout));
- base::TimeDelta strong_auth_timeout =
- PasswordConfirmationFrequencyToTimeDelta(strong_auth_interval);
-
- return TimeSinceLastStrongAuth() < strong_auth_timeout;
-}
-
-base::TimeDelta PinStorage::TimeSinceLastStrongAuth() const {
- DCHECK(!last_strong_auth_.is_null());
- return base::Time::Now() - last_strong_auth_;
-}
-
void PinStorage::AddUnlockAttempt() {
++unlock_attempt_count_;
}
@@ -127,8 +88,7 @@ bool PinStorage::IsPinAuthenticationAvailable() const {
const bool exceeded_unlock_attempts =
unlock_attempt_count() >= kMaximumUnlockAttempts;
- return IsPinEnabled(pref_service_) && IsPinSet() && HasStrongAuth() &&
- !exceeded_unlock_attempts;
+ return IsPinEnabled(pref_service_) && IsPinSet() && !exceeded_unlock_attempts;
}
bool PinStorage::TryAuthenticatePin(const std::string& pin) {

Powered by Google App Engine
This is Rietveld 408576698