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

Unified Diff: chrome/browser/signin/easy_unlock_service_signin_chromeos.cc

Issue 1022233002: [Smart Lock] Add UMA metrics to measure duration of unlock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hook into the existing PowerMonitor observer Created 5 years, 9 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/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 0f2696a83efef19c5e7b30e4f1a2c71160e5d1bd..5c068cd3caf9f925780b78938c25a1f7f511656f 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) {
}
@@ -181,6 +182,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");
}
@@ -247,6 +252,10 @@ void EasyUnlockServiceSignin::OnWillFinalizeUnlock(bool success) {
NOTREACHED();
}
+void EasyUnlockServiceSignin::OnSuspendDone() {
+ // Ignored.
+}
+
void EasyUnlockServiceSignin::OnScreenDidLock(
ScreenlockBridge::LockHandler::ScreenType screen_type) {
// In production code, the screen type should always be the signin screen; but
@@ -256,6 +265,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(
@@ -279,6 +289,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();
« no previous file with comments | « chrome/browser/signin/easy_unlock_service_signin_chromeos.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698