OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_PIN_STORAGE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_PIN_STORAGE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_PIN_STORAGE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_PIN_STORAGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "components/keyed_service/core/keyed_service.h" | 12 #include "components/keyed_service/core/keyed_service.h" |
13 | 13 |
14 class PrefService; | 14 class PrefService; |
15 | 15 |
16 namespace user_prefs { | 16 namespace user_prefs { |
17 class PrefRegistrySyncable; | 17 class PrefRegistrySyncable; |
18 } // namespace user_prefs | 18 } // namespace user_prefs |
19 | 19 |
20 class PinStorageTestApi; | 20 class PinStorageTestApi; |
21 | 21 |
22 namespace chromeos { | 22 namespace chromeos { |
23 | 23 |
24 // TODO(jdufault): Figure out the UX we want on the lock screen when there are | |
25 // multiple users. We will be storing either global or per-user unlock state. If | |
26 // we end up storing global unlock state, we can pull the unlock attempt and | |
27 // strong-auth code out of this class. | |
28 | |
29 class PinStorage : public KeyedService { | 24 class PinStorage : public KeyedService { |
30 public: | 25 public: |
31 // TODO(jdufault): Pull these values in from policy. See crbug.com/612271. | 26 // TODO(jdufault): Pull these values in from policy. See crbug.com/612271. |
32 static const int kMaximumUnlockAttempts = 3; | 27 static const int kMaximumUnlockAttempts = 3; |
33 static const base::TimeDelta kStrongAuthTimeout; | 28 static const base::TimeDelta kStrongAuthTimeout; |
34 | 29 |
35 // Registers profile prefs. | 30 // Registers profile prefs. |
36 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 31 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
37 | 32 |
38 explicit PinStorage(PrefService* pref_service); | 33 explicit PinStorage(PrefService* pref_service); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 PrefService* pref_service_; | 74 PrefService* pref_service_; |
80 int unlock_attempt_count_ = 0; | 75 int unlock_attempt_count_ = 0; |
81 base::Time last_strong_auth_; | 76 base::Time last_strong_auth_; |
82 | 77 |
83 DISALLOW_COPY_AND_ASSIGN(PinStorage); | 78 DISALLOW_COPY_AND_ASSIGN(PinStorage); |
84 }; | 79 }; |
85 | 80 |
86 } // namespace chromeos | 81 } // namespace chromeos |
87 | 82 |
88 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_PIN_STORAGE_H_ | 83 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_PIN_STORAGE_H_ |
OLD | NEW |