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

Side by Side Diff: chrome/browser/chromeos/login/quick_unlock/fingerprint_storage.cc

Issue 2715823004: Add FingerprintUnlock KeyedService for each profile (Closed)
Patch Set: rebase Created 3 years, 9 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 unified diff | Download patch
OLDNEW
(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 #include "chrome/browser/chromeos/login/quick_unlock/fingerprint_storage.h"
6
7 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h"
8 #include "chrome/common/pref_names.h"
9 #include "components/prefs/pref_service.h"
10
11 namespace chromeos {
12 namespace quick_unlock {
13
14 FingerprintStorage::FingerprintStorage(PrefService* pref_service)
15 : pref_service_(pref_service) {}
16
17 FingerprintStorage::~FingerprintStorage() {}
18
19 bool FingerprintStorage::IsFingerprintAuthenticationAvailable() const {
20 const bool exceeded_unlock_attempts =
21 unlock_attempt_count() >= kMaximumUnlockAttempts;
22
23 return IsFingerprintEnabled() && HasEnrollment() && !exceeded_unlock_attempts;
24 }
25
26 bool FingerprintStorage::HasEnrollment() const {
27 return has_enrollments_;
28 }
29
30 void FingerprintStorage::AddUnlockAttempt() {
31 ++unlock_attempt_count_;
32 }
33
34 void FingerprintStorage::ResetUnlockAttemptCount() {
35 unlock_attempt_count_ = 0;
36 }
37
38 } // namespace quick_unlock
39 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698