OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_FINGERPRINT_STORAGE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_FINGERPRINT_STORAGE_H_ |
| 7 |
| 8 #include "base/time/time.h" |
| 9 |
| 10 class PrefService; |
| 11 |
| 12 namespace chromeos { |
| 13 |
| 14 class FingerprintStorageTestApi; |
| 15 |
| 16 namespace quick_unlock { |
| 17 |
| 18 class QuickUnlockStorage; |
| 19 |
| 20 class FingerprintStorage { |
| 21 public: |
| 22 static const int kMaximumUnlockAttempts = 5; |
| 23 |
| 24 explicit FingerprintStorage(PrefService* pref_service); |
| 25 ~FingerprintStorage(); |
| 26 |
| 27 // Returns true if the user has fingerprint enrollments registered. |
| 28 bool HasEnrollment() const; |
| 29 |
| 30 // Add a fingerprint unlock attempt count. |
| 31 void AddUnlockAttempt(); |
| 32 |
| 33 // Reset the number of unlock attempts to 0. |
| 34 void ResetUnlockAttemptCount(); |
| 35 |
| 36 int unlock_attempt_count() const { return unlock_attempt_count_; } |
| 37 |
| 38 private: |
| 39 friend class chromeos::FingerprintStorageTestApi; |
| 40 friend class QuickUnlockStorage; |
| 41 |
| 42 // Returns true if fingerprint unlock is currently available. |
| 43 bool IsFingerprintAuthenticationAvailable() const; |
| 44 |
| 45 PrefService* pref_service_; |
| 46 // Number of fingerprint unlock attempt. |
| 47 int unlock_attempt_count_ = 0; |
| 48 bool has_enrollments_ = false; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(FingerprintStorage); |
| 51 }; |
| 52 |
| 53 } // namespace quick_unlock |
| 54 } // namespace chromeos |
| 55 |
| 56 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_FINGERPRINT_STORAGE_H_ |
OLD | NEW |