Index: chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.cc |
diff --git a/chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.cc b/chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.cc |
index a3b2dea7934457faee941f328f9b6f71f67ecb71..80a80e7aa8d88529e69e6c3413d20fc09bffd5d2 100644 |
--- a/chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.cc |
+++ b/chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.cc |
@@ -4,17 +4,20 @@ |
#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h" |
+#include "chrome/browser/chromeos/login/quick_unlock/fingerprint_storage.h" |
+#include "chrome/browser/chromeos/login/quick_unlock/pin_storage_prefs.h" |
#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" |
+#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/pref_names.h" |
#include "components/prefs/pref_service.h" |
namespace chromeos { |
namespace quick_unlock { |
-QuickUnlockStorage::QuickUnlockStorage(PrefService* pref_service) |
- : pref_service_(pref_service) { |
- fingerprint_storage_ = base::MakeUnique<FingerprintStorage>(pref_service); |
- pin_storage_ = base::MakeUnique<PinStorage>(pref_service); |
+QuickUnlockStorage::QuickUnlockStorage(Profile* profile) |
+ : pref_service_(profile->GetPrefs()) { |
+ fingerprint_storage_ = base::MakeUnique<FingerprintStorage>(pref_service_); |
+ pin_storage_ = base::MakeUnique<PinStoragePrefs>(profile); |
} |
QuickUnlockStorage::~QuickUnlockStorage() {} |
@@ -22,7 +25,7 @@ QuickUnlockStorage::~QuickUnlockStorage() {} |
void QuickUnlockStorage::MarkStrongAuth() { |
last_strong_auth_ = base::Time::Now(); |
fingerprint_storage()->ResetUnlockAttemptCount(); |
- pin_storage()->ResetUnlockAttemptCount(); |
+ pin_storage_->ResetUnlockAttemptCount(); |
} |
bool QuickUnlockStorage::HasStrongAuth() const { |
@@ -49,22 +52,6 @@ bool QuickUnlockStorage::IsFingerprintAuthenticationAvailable() const { |
fingerprint_storage_->IsFingerprintAuthenticationAvailable(); |
} |
-bool QuickUnlockStorage::IsPinAuthenticationAvailable() const { |
- return HasStrongAuth() && pin_storage_->IsPinAuthenticationAvailable(); |
-} |
- |
-bool QuickUnlockStorage::TryAuthenticatePin(const std::string& pin) { |
- return HasStrongAuth() && pin_storage()->TryAuthenticatePin(pin); |
-} |
- |
-FingerprintStorage* QuickUnlockStorage::fingerprint_storage() { |
- return fingerprint_storage_.get(); |
-} |
- |
-PinStorage* QuickUnlockStorage::pin_storage() { |
- return pin_storage_.get(); |
-} |
- |
void QuickUnlockStorage::Shutdown() { |
fingerprint_storage_.reset(); |
pin_storage_.reset(); |