blob: f859f403bbe5c8ced04b98080d4a6788629bc670 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/time/time.h"
class PrefRegistrySimple;
class Profile;
namespace chromeos {
class FingerprintStorageTestApi;
namespace quick_unlock {
class QuickUnlockStorage;
class FingerprintStorage {
static const int kMaximumUnlockAttempts = 5;
// Registers profile prefs.
static void RegisterProfilePrefs(PrefRegistrySimple* registry);
explicit FingerprintStorage(Profile* profile);
// Returns true if fingerprint unlock is currently available.
// This does not check if strong auth is available.
bool IsFingerprintAvailable() const;
// Returns true if the user has fingerprint record registered.
bool HasRecord() const;
// Add a fingerprint unlock attempt count.
void AddUnlockAttempt();
// Reset the number of unlock attempts to 0.
void ResetUnlockAttemptCount();
// Returns true if the user has exceeded fingerprint unlock attempts.
bool ExceededUnlockAttempts() const;
int unlock_attempt_count() const { return unlock_attempt_count_; }
friend class chromeos::FingerprintStorageTestApi;
friend class QuickUnlockStorage;
Profile* const profile_;
// Number of fingerprint unlock attempt.
int unlock_attempt_count_ = 0;
} // namespace quick_unlock
} // namespace chromeos