| Index: chrome/browser/signin/easy_unlock_service_regular.cc
|
| diff --git a/chrome/browser/signin/easy_unlock_service_regular.cc b/chrome/browser/signin/easy_unlock_service_regular.cc
|
| index 8e9bd9e63257a0cf65c9e9d33789ed53ef20dd4a..6a4dcfec42b9fe375b9fff5c49fb363f083a61af 100644
|
| --- a/chrome/browser/signin/easy_unlock_service_regular.cc
|
| +++ b/chrome/browser/signin/easy_unlock_service_regular.cc
|
| @@ -524,22 +524,33 @@ void EasyUnlockServiceRegular::OnScreenDidLock(
|
|
|
| void EasyUnlockServiceRegular::OnScreenDidUnlock(
|
| proximity_auth::ScreenlockBridge::LockHandler::ScreenType screen_type) {
|
| + bool is_lock_screen =
|
| + screen_type == proximity_auth::ScreenlockBridge::LockHandler::LOCK_SCREEN;
|
| +
|
| + if (!will_unlock_using_easy_unlock_ && GetProximityAuthPrefManager() &&
|
| + (is_lock_screen || !base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + proximity_auth::switches::kEnableChromeOSLogin))) {
|
| + // If a password was used, then record the current timestamp. This timestamp
|
| + // is used to enforce password reauths after a certain time has elapsed.
|
| + GetProximityAuthPrefManager()->SetLastPasswordEntryTimestampMs(
|
| + base::Time::Now().ToJavaTime());
|
| + }
|
| +
|
| // Notifications of signin screen unlock events can also reach this code path;
|
| // disregard them.
|
| - if (screen_type != proximity_auth::ScreenlockBridge::LockHandler::LOCK_SCREEN)
|
| + if (!is_lock_screen)
|
| return;
|
|
|
| // Only record metrics for users who have enabled the feature.
|
| if (IsEnabled()) {
|
| - EasyUnlockAuthEvent event =
|
| - will_unlock_using_easy_unlock_
|
| - ? EASY_UNLOCK_SUCCESS
|
| - : GetPasswordAuthEvent();
|
| + EasyUnlockAuthEvent event = will_unlock_using_easy_unlock_
|
| + ? EASY_UNLOCK_SUCCESS
|
| + : GetPasswordAuthEvent();
|
| RecordEasyUnlockScreenUnlockEvent(event);
|
|
|
| if (will_unlock_using_easy_unlock_) {
|
| - RecordEasyUnlockScreenUnlockDuration(
|
| - base::TimeTicks::Now() - lock_screen_last_shown_timestamp_);
|
| + RecordEasyUnlockScreenUnlockDuration(base::TimeTicks::Now() -
|
| + lock_screen_last_shown_timestamp_);
|
| }
|
| }
|
|
|
|
|