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

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

Issue 2715823004: Add FingerprintUnlock KeyedService for each profile (Closed)
Patch Set: rebase Created 3 years, 10 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/quick_unlock_utils.cc
diff --git a/chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.cc b/chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.cc
index 8af3c1f6ead93a01f1bd46e3634f05cc5a05d427..269bbf789cda17cdc8a300a5dc5ffd37d075bf0d 100644
--- a/chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.cc
+++ b/chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h"
#include "base/feature_list.h"
+#include "base/time/time.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/common/chrome_features.h"
@@ -25,6 +26,22 @@ const char kQuickUnlockWhitelistOptionPin[] = "PIN";
constexpr int kDefaultMinimumPinLength = 6;
} // namespace
+base::TimeDelta PasswordConfirmationFrequencyToTimeDelta(
+ PasswordConfirmationFrequency frequency) {
+ switch (frequency) {
+ case PasswordConfirmationFrequency::SIX_HOURS:
+ return base::TimeDelta::FromHours(6);
+ case PasswordConfirmationFrequency::TWELVE_HOURS:
+ return base::TimeDelta::FromHours(12);
+ case PasswordConfirmationFrequency::DAY:
+ return base::TimeDelta::FromDays(1);
+ case PasswordConfirmationFrequency::WEEK:
+ return base::TimeDelta::FromDays(7);
+ }
+ NOTREACHED();
+ return base::TimeDelta();
+}
+
void RegisterProfilePrefs(PrefRegistrySimple* registry) {
base::ListValue quick_unlock_whitelist_default;
quick_unlock_whitelist_default.AppendString(kQuickUnlockWhitelistOptionPin);
@@ -71,6 +88,9 @@ bool IsPinEnabled(PrefService* pref_service) {
}
bool IsFingerprintEnabled() {
+ if (enable_for_testing_)
+ return true;
+
// Enable fingerprint unlock only if the switch is present.
return base::FeatureList::IsEnabled(features::kQuickUnlockFingerprint);
}

Powered by Google App Engine
This is Rietveld 408576698