| 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 class PinStorage : public KeyedService { | 24 class PinStorage : public KeyedService { |
| 25 public: | 25 public: |
| 26 // TODO(jdufault): Pull these values in from policy. See crbug.com/612271. | 26 // TODO(sammiequon): Pull this value in from policy. See crbug.com/612271. |
| 27 static const int kMaximumUnlockAttempts = 3; | 27 static const int kMaximumUnlockAttempts = 3; |
| 28 static const base::TimeDelta kStrongAuthTimeout; | |
| 29 | 28 |
| 30 // Registers profile prefs. | 29 // Registers profile prefs. |
| 31 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 30 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 32 | 31 |
| 33 explicit PinStorage(PrefService* pref_service); | 32 explicit PinStorage(PrefService* pref_service); |
| 34 ~PinStorage() override; | 33 ~PinStorage() override; |
| 35 | 34 |
| 36 // Mark in storage that the user has had a strong authentication. This means | 35 // Mark in storage that the user has had a strong authentication. This means |
| 37 // that they authenticated with their password, for example. PIN unlock will | 36 // that they authenticated with their password, for example. PIN unlock will |
| 38 // timeout after a delay. | 37 // timeout after a delay. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 PrefService* pref_service_; | 73 PrefService* pref_service_; |
| 75 int unlock_attempt_count_ = 0; | 74 int unlock_attempt_count_ = 0; |
| 76 base::Time last_strong_auth_; | 75 base::Time last_strong_auth_; |
| 77 | 76 |
| 78 DISALLOW_COPY_AND_ASSIGN(PinStorage); | 77 DISALLOW_COPY_AND_ASSIGN(PinStorage); |
| 79 }; | 78 }; |
| 80 | 79 |
| 81 } // namespace chromeos | 80 } // namespace chromeos |
| 82 | 81 |
| 83 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_PIN_STORAGE_H_ | 82 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_QUICK_UNLOCK_PIN_STORAGE_H_ |
| OLD | NEW |