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

Unified Diff: chrome/browser/chromeos/login/lock/screen_locker.cc

Issue 2208583006: UMA for pin unlock success/failure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fixed patch set 3 errors. Created 4 years, 4 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/chromeos/login/lock/screen_locker.cc
diff --git a/chrome/browser/chromeos/login/lock/screen_locker.cc b/chrome/browser/chromeos/login/lock/screen_locker.cc
index bffe739b0a78a3888c2b5780634e16f315b77887..3b10e18dd03673c1c32acc1d7acf57f478231a10 100644
--- a/chrome/browser/chromeos/login/lock/screen_locker.cc
+++ b/chrome/browser/chromeos/login/lock/screen_locker.cc
@@ -136,10 +136,8 @@ ScreenLocker* ScreenLocker::screen_locker_ = NULL;
ScreenLocker::ScreenLocker(const user_manager::UserList& users)
: users_(users),
- locked_(false),
start_time_(base::Time::Now()),
jdufault 2016/08/16 17:55:02 Move initialization to header
sammiequon 2016/08/16 19:22:11 Done.
- auth_status_consumer_(NULL),
- incorrect_passwords_count_(0),
+ auth_status_consumer_(nullptr),
jdufault 2016/08/16 17:55:02 Move initialization to header
sammiequon 2016/08/16 19:22:11 Done.
weak_factory_(this) {
DCHECK(!screen_locker_);
screen_locker_ = this;
@@ -189,6 +187,12 @@ void ScreenLocker::OnAuthFailure(const AuthFailure& error) {
UMA_HISTOGRAM_TIMES("ScreenLocker.AuthenticationFailureTime", delta);
}
+ UMA_HISTOGRAM_ENUMERATION("ScreenLocker.AuthenticationFailure",
+ is_pin_attempt_
+ ? UnlockFailure::AUTH_FAILURE_PIN
+ : UnlockFailure::AUTH_FAILURE_PASSWORD,
+ UnlockFailure::AUTH_FAILURE_COUNT);
+
EnableInput();
// Don't enable signout button here as we're showing
// MessageBubble.
@@ -213,6 +217,12 @@ void ScreenLocker::OnAuthSuccess(const UserContext& user_context) {
UMA_HISTOGRAM_TIMES("ScreenLocker.AuthenticationSuccessTime", delta);
}
+ UMA_HISTOGRAM_ENUMERATION("ScreenLocker.AuthenticationSuccess",
+ is_pin_attempt_
+ ? UnlockSuccess::AUTH_SUCCESS_PIN
+ : UnlockSuccess::AUTH_SUCCESS_PASSWORD,
+ UnlockSuccess::AUTH_SUCCESS_COUNT);
+
const user_manager::User* user =
user_manager::UserManager::Get()->FindUser(user_context.GetAccountId());
if (user) {
@@ -283,6 +293,7 @@ void ScreenLocker::Authenticate(const UserContext& user_context) {
authentication_start_time_ = base::Time::Now();
delegate_->SetInputEnabled(false);
delegate_->OnAuthenticate();
+ is_pin_attempt_ = user_context.IsUsingPin();
const user_manager::User* user = FindUnlockUser(user_context.GetAccountId());
if (user) {
@@ -293,7 +304,7 @@ void ScreenLocker::Authenticate(const UserContext& user_context) {
// otherwise we will timeout PIN if the user enters their account password
// incorrectly more than a few times.
int dummy_value;
- if (base::StringToInt(pin, &dummy_value)) {
+ if (is_pin_attempt_ && base::StringToInt(pin, &dummy_value)) {
chromeos::PinStorage* pin_storage =
chromeos::PinStorageFactory::GetForUser(user);
if (pin_storage && pin_storage->TryAuthenticatePin(pin)) {

Powered by Google App Engine
This is Rietveld 408576698