Chromium Code Reviews| 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..c4902a2fc717027f052fcf5a5dfd4a1af9d9bb63 100644 |
| --- a/chrome/browser/chromeos/login/lock/screen_locker.cc |
| +++ b/chrome/browser/chromeos/login/lock/screen_locker.cc |
| @@ -140,6 +140,7 @@ ScreenLocker::ScreenLocker(const user_manager::UserList& users) |
| start_time_(base::Time::Now()), |
| auth_status_consumer_(NULL), |
| incorrect_passwords_count_(0), |
| + is_pin_attempt_(false), |
|
jdufault
2016/08/12 21:57:33
Since you're already modifying this, please move a
sammiequon
2016/08/16 17:29:09
Done.
|
| weak_factory_(this) { |
| DCHECK(!screen_locker_); |
| screen_locker_ = this; |
| @@ -189,6 +190,16 @@ void ScreenLocker::OnAuthFailure(const AuthFailure& error) { |
| UMA_HISTOGRAM_TIMES("ScreenLocker.AuthenticationFailureTime", delta); |
| } |
| + if (is_pin_attempt_) { |
| + UMA_HISTOGRAM_ENUMERATION("ScreenLocker.AuthenticationFailure", |
| + UnlockFailure::AUTH_FAILURE_PIN, |
|
jdufault
2016/08/12 21:57:33
Can we replace this with
UMA(..., is_pin_attempt_
sammiequon
2016/08/16 17:29:09
Done.
|
| + UnlockFailure::AUTH_FAILURE_COUNT); |
| + } else { |
| + UMA_HISTOGRAM_ENUMERATION("ScreenLocker.AuthenticationFailure", |
| + UnlockFailure::AUTH_FAILURE_PASSWORD, |
| + UnlockFailure::AUTH_FAILURE_COUNT); |
| + } |
| + |
| EnableInput(); |
| // Don't enable signout button here as we're showing |
| // MessageBubble. |
| @@ -213,6 +224,16 @@ void ScreenLocker::OnAuthSuccess(const UserContext& user_context) { |
| UMA_HISTOGRAM_TIMES("ScreenLocker.AuthenticationSuccessTime", delta); |
| } |
| + if (is_pin_attempt_) { |
| + UMA_HISTOGRAM_ENUMERATION("ScreenLocker.AuthenticationSuccess", |
| + UnlockSuccess::AUTH_SUCCESS_PIN, |
| + UnlockSuccess::AUTH_SUCCESS_COUNT); |
|
jdufault
2016/08/12 21:57:33
See above UMA comment
sammiequon
2016/08/16 17:29:09
Done.
|
| + } else { |
| + UMA_HISTOGRAM_ENUMERATION("ScreenLocker.AuthenticationSuccess", |
| + 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 +304,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 +315,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)) { |