Index: chrome/browser/chromeos/login/quick_unlock/pin_storage.cc |
diff --git a/chrome/browser/chromeos/login/quick_unlock/pin_storage.cc b/chrome/browser/chromeos/login/quick_unlock/pin_storage.cc |
index 2030a63edbcbf1ca73329f6851edba77cc3d8882..25abdaf2417994b33e3be641a5eedb34f7f25441 100644 |
--- a/chrome/browser/chromeos/login/quick_unlock/pin_storage.cc |
+++ b/chrome/browser/chromeos/login/quick_unlock/pin_storage.cc |
@@ -6,6 +6,7 @@ |
#include "base/base64.h" |
#include "base/strings/string_util.h" |
+#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" |
#include "chrome/common/pref_names.h" |
#include "chromeos/login/auth/key.h" |
#include "components/pref_registry/pref_registry_syncable.h" |
@@ -104,8 +105,13 @@ std::string PinStorage::PinSecret() const { |
} |
bool PinStorage::IsPinAuthenticationAvailable() const { |
- return IsPinSet() && unlock_attempt_count() < kMaximumUnlockAttempts && |
- HasStrongAuth() && TimeSinceLastStrongAuth() < kStrongAuthTimeout; |
+ const bool exceeded_unlock_attempts = |
+ unlock_attempt_count() >= kMaximumUnlockAttempts; |
+ const bool has_strong_auth = |
+ HasStrongAuth() && TimeSinceLastStrongAuth() < kStrongAuthTimeout; |
+ |
+ return IsQuickUnlockEnabled() && IsPinSet() && has_strong_auth && |
+ !exceeded_unlock_attempts; |
} |
bool PinStorage::TryAuthenticatePin(const std::string& pin) { |