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_QUICK_UNLOCK_UTILS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_UTILS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_UTILS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_UTILS_H_ |
7 | 7 |
| 8 namespace base { |
| 9 class TimeDelta; |
| 10 } |
| 11 |
8 class PrefRegistrySimple; | 12 class PrefRegistrySimple; |
9 class PrefService; | 13 class PrefService; |
10 | 14 |
11 namespace chromeos { | 15 namespace chromeos { |
12 namespace quick_unlock { | 16 namespace quick_unlock { |
13 | 17 |
14 // Enumeration specifiying the possible intervals before a strong auth | 18 // Enumeration specifiying the possible intervals before a strong auth |
15 // (password) is required to use quick unlock. These values correspond to the | 19 // (password) is required to use quick unlock. These values correspond to the |
16 // policy items of QuickUnlockTimeout (policy ID 352) in policy_templates.json, | 20 // policy items of QuickUnlockTimeout (policy ID 352) in policy_templates.json, |
17 // and should be updated accordingly. | 21 // and should be updated accordingly. |
18 enum class PasswordConfirmationFrequency { | 22 enum class PasswordConfirmationFrequency { |
19 SIX_HOURS = 0, | 23 SIX_HOURS = 0, |
20 TWELVE_HOURS = 1, | 24 TWELVE_HOURS = 1, |
21 DAY = 2, | 25 DAY = 2, |
22 WEEK = 3 | 26 WEEK = 3 |
23 }; | 27 }; |
24 | 28 |
| 29 base::TimeDelta PasswordConfirmationFrequencyToTimeDelta( |
| 30 PasswordConfirmationFrequency frequency); |
| 31 |
25 // Register quick unlock prefs. | 32 // Register quick unlock prefs. |
26 void RegisterProfilePrefs(PrefRegistrySimple* registry); | 33 void RegisterProfilePrefs(PrefRegistrySimple* registry); |
27 | 34 |
28 // Returns true if PIN unlock is allowed by policy and the quick unlock feature | 35 // Returns true if PIN unlock is allowed by policy and the quick unlock feature |
29 // flag is present. | 36 // flag is present. |
30 bool IsPinEnabled(PrefService* pref_service); | 37 bool IsPinEnabled(PrefService* pref_service); |
31 | 38 |
32 // Returns true if the fingerprint unlock feature flag is present. | 39 // Returns true if the fingerprint unlock feature flag is present. |
33 bool IsFingerprintEnabled(); | 40 bool IsFingerprintEnabled(); |
34 | 41 |
35 // Forcibly enable quick-unlock for testing. | 42 // Forcibly enable quick-unlock for testing. |
36 void EnableForTesting(); | 43 void EnableForTesting(); |
37 | 44 |
38 } // namespace quick_unlock | 45 } // namespace quick_unlock |
39 } // namespace chromeos | 46 } // namespace chromeos |
40 | 47 |
41 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_UTILS_H_ | 48 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_UTILS_H_ |
OLD | NEW |