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

Unified Diff: chrome/browser/signin/easy_unlock_service_regular.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_regular.cc
diff --git a/chrome/browser/signin/easy_unlock_service_regular.cc b/chrome/browser/signin/easy_unlock_service_regular.cc
index fef0f6ff7e9d7cbd5ad241038fa1cc96def5c7d9..428384eb3ec61a243c49e3b5077a00455fa71db4 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) {
}
@@ -321,9 +322,14 @@ void EasyUnlockServiceRegular::OnWillFinalizeUnlock(bool success) {
will_unlock_using_easy_unlock_ = success;
}
+void EasyUnlockServiceRegular::OnSuspendDone() {
+ lock_screen_last_shown_timestamp_ = base::TimeTicks::Now();
+}
+
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 +346,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;
« no previous file with comments | « chrome/browser/signin/easy_unlock_service_regular.h ('k') | chrome/browser/signin/easy_unlock_service_signin_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698