Index: chrome/browser/signin/easy_unlock_service_signin_chromeos.cc |
diff --git a/chrome/browser/signin/easy_unlock_service_signin_chromeos.cc b/chrome/browser/signin/easy_unlock_service_signin_chromeos.cc |
index 9596183a9c2ac98e206358859731eb5b0e345e57..f233e8443f8f58570f6613c62c43a5d5631556df 100644 |
--- a/chrome/browser/signin/easy_unlock_service_signin_chromeos.cc |
+++ b/chrome/browser/signin/easy_unlock_service_signin_chromeos.cc |
@@ -96,6 +96,7 @@ EasyUnlockServiceSignin::EasyUnlockServiceSignin(Profile* profile) |
: EasyUnlockService(profile), |
allow_cryptohome_backoff_(true), |
service_active_(false), |
+ user_pod_last_focused_timestamp_(base::TimeTicks::Now()), |
weak_ptr_factory_(this) { |
} |
@@ -177,6 +178,10 @@ void EasyUnlockServiceSignin::RecordEasySignInOutcome( |
RecordEasyUnlockSigninEvent( |
success ? EASY_UNLOCK_SUCCESS : EASY_UNLOCK_FAILURE); |
+ if (success) { |
+ RecordEasyUnlockSigninDuration( |
+ base::TimeTicks::Now() - user_pod_last_focused_timestamp_); |
+ } |
DVLOG(1) << "Easy sign-in " << (success ? "success" : "failure"); |
} |
@@ -252,6 +257,7 @@ void EasyUnlockServiceSignin::OnScreenDidLock( |
// Update initial UI is when the account picker on login screen is ready. |
ShowInitialUserState(); |
+ user_pod_last_focused_timestamp_ = base::TimeTicks::Now(); |
} |
void EasyUnlockServiceSignin::OnScreenDidUnlock( |
@@ -275,6 +281,7 @@ void EasyUnlockServiceSignin::OnFocusedUserChanged(const std::string& user_id) { |
// user data has been updated. |
bool should_update_app_state = user_id_.empty() != user_id.empty(); |
user_id_ = user_id; |
+ user_pod_last_focused_timestamp_ = base::TimeTicks::Now(); |
ResetScreenlockState(); |
ShowInitialUserState(); |