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 fef0f6ff7e9d7cbd5ad241038fa1cc96def5c7d9..6a9a8aef1b513a671c62dc476f74456e37df3d0f 100644 |
--- a/chrome/browser/signin/easy_unlock_service_regular.cc |
+++ b/chrome/browser/signin/easy_unlock_service_regular.cc |
@@ -52,6 +52,7 @@ EasyUnlockServiceRegular::EasyUnlockServiceRegular(Profile* profile) |
: EasyUnlockService(profile), |
turn_off_flow_status_(EasyUnlockService::IDLE), |
will_unlock_using_easy_unlock_(false), |
+ lock_screen_last_shown_timestamp_(base::TimeTicks::Now()), |
weak_ptr_factory_(this) { |
} |
@@ -324,6 +325,7 @@ void EasyUnlockServiceRegular::OnWillFinalizeUnlock(bool success) { |
void EasyUnlockServiceRegular::OnScreenDidLock( |
ScreenlockBridge::LockHandler::ScreenType screen_type) { |
will_unlock_using_easy_unlock_ = false; |
+ lock_screen_last_shown_timestamp_ = base::TimeTicks::Now(); |
} |
void EasyUnlockServiceRegular::OnScreenDidUnlock( |
@@ -340,6 +342,11 @@ void EasyUnlockServiceRegular::OnScreenDidUnlock( |
? EASY_UNLOCK_SUCCESS |
: GetPasswordAuthEvent(); |
RecordEasyUnlockScreenUnlockEvent(event); |
+ |
+ if (will_unlock_using_easy_unlock_) { |
+ RecordEasyUnlockScreenUnlockDuration( |
+ base::TimeTicks::Now() - lock_screen_last_shown_timestamp_); |
+ } |
} |
will_unlock_using_easy_unlock_ = false; |
@@ -350,6 +357,13 @@ void EasyUnlockServiceRegular::OnFocusedUserChanged( |
// Nothing to do. |
} |
+#if defined(OS_CHROMEOS) |
+void EasyUnlockServiceRegular::SuspendDone( |
+ const base::TimeDelta& sleep_duration) { |
+ lock_screen_last_shown_timestamp_ = base::TimeTicks::Now(); |
+} |
+#endif // defined(OS_CHROMEOS) |
+ |
void EasyUnlockServiceRegular::OnPrefsChanged() { |
SyncProfilePrefsToLocalState(); |
UpdateAppState(); |