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

Unified Diff: chrome/browser/chromeos/login/quick_unlock/pin_storage.cc

Issue 2150763002: Enable PIN configuration settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fix tests Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698