Chromium Code Reviews| Index: chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h |
| diff --git a/chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h b/chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h |
| index 7632985e170cd62e84743572cf1231bca165bde1..8dc0fd0dfc78ef546a14d287bd7f6beb8373e40d 100644 |
| --- a/chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h |
| +++ b/chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h |
| @@ -5,13 +5,13 @@ |
| #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_STORAGE_H_ |
| #define CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_STORAGE_H_ |
| +#include "base/callback.h" |
| #include "base/memory/ptr_util.h" |
| #include "base/time/time.h" |
| -#include "chrome/browser/chromeos/login/quick_unlock/fingerprint_storage.h" |
| -#include "chrome/browser/chromeos/login/quick_unlock/pin_storage.h" |
| #include "components/keyed_service/core/keyed_service.h" |
| class PrefService; |
| +class Profile; |
| namespace chromeos { |
| @@ -19,9 +19,14 @@ class QuickUnlockStorageTestApi; |
| namespace quick_unlock { |
| +class FingerprintStorage; |
| +class PinStoragePrefs; |
| + |
| class QuickUnlockStorage : public KeyedService { |
| public: |
| - explicit QuickUnlockStorage(PrefService* pref_service); |
| + using BoolCallback = base::Callback<void(bool)>; |
|
achuithb
2017/05/13 01:01:58
Where's this used?
jdufault
2017/06/06 18:17:06
Removed.
|
| + |
| + explicit QuickUnlockStorage(Profile* profile); |
| ~QuickUnlockStorage() override; |
| // Mark that the user has had a strong authentication. This means |
| @@ -39,16 +44,13 @@ class QuickUnlockStorage : public KeyedService { |
| // Returns true if fingerprint unlock is currently available. |
| bool IsFingerprintAuthenticationAvailable() const; |
| - // Returns true if PIN unlock is currently available. |
| - bool IsPinAuthenticationAvailable() const; |
| - |
| - // Tries to authenticate the given pin. This will consume a pin unlock |
| - // attempt. This always returns false if HasStrongAuth returns false. |
| - bool TryAuthenticatePin(const std::string& pin); |
| - |
| - FingerprintStorage* fingerprint_storage(); |
| + FingerprintStorage* fingerprint_storage() const { |
| + return fingerprint_storage_.get(); |
| + } |
| - PinStorage* pin_storage(); |
| + // Fetch the underlying pref pin storage. If iteracting with pin generally, |
| + // use the PinBackend APIs. |
| + PinStoragePrefs* pin_storage_prefs() const { return pin_storage_.get(); } |
| private: |
| friend class chromeos::QuickUnlockStorageTestApi; |
| @@ -59,7 +61,7 @@ class QuickUnlockStorage : public KeyedService { |
| PrefService* pref_service_; |
| base::Time last_strong_auth_; |
| std::unique_ptr<FingerprintStorage> fingerprint_storage_; |
| - std::unique_ptr<PinStorage> pin_storage_; |
| + std::unique_ptr<PinStoragePrefs> pin_storage_; |
| DISALLOW_COPY_AND_ASSIGN(QuickUnlockStorage); |
| }; |