Chromium Code Reviews| Index: chrome/browser/chromeos/login/login_performer.cc |
| diff --git a/chrome/browser/chromeos/login/login_performer.cc b/chrome/browser/chromeos/login/login_performer.cc |
| index 1f10bfb7a02b7823ce2adcf9d9fcffa9402e38b8..98f65f4cc4c04b3e66fd0627f17a2f4a0872b545 100644 |
| --- a/chrome/browser/chromeos/login/login_performer.cc |
| +++ b/chrome/browser/chromeos/login/login_performer.cc |
| @@ -4,6 +4,7 @@ |
| #include "chrome/browser/chromeos/login/login_performer.h" |
| +#include "base/metrics/histogram.h" |
| #include "base/logging.h" |
| #include "base/message_loop.h" |
| #include "chrome/browser/browser_process.h" |
| @@ -11,6 +12,7 @@ |
| #include "chrome/browser/chromeos/boot_times_loader.h" |
| #include "chrome/browser/chromeos/login/login_utils.h" |
| #include "chrome/browser/chromeos/user_cros_settings_provider.h" |
| +#include "chrome/browser/metrics/user_metrics.h" |
| #include "chrome/browser/profile.h" |
| #include "chrome/browser/profile_manager.h" |
| @@ -28,18 +30,22 @@ LoginPerformer::LoginPerformer(Delegate* delegate) |
| // LoginPerformer, LoginStatusConsumer implementation: |
| void LoginPerformer::OnLoginFailure(const LoginFailure& failure) { |
| - last_login_failure_ = failure; |
| - if (delegate_) { |
| - captcha_.clear(); |
| - captcha_token_.clear(); |
| - if (failure.reason() == LoginFailure::NETWORK_AUTH_FAILED && |
| - failure.error().state() == GoogleServiceAuthError::CAPTCHA_REQUIRED) { |
| - captcha_token_ = failure.error().captcha().token; |
| - } |
| - delegate_->OnLoginFailure(failure); |
| - } else { |
| - // TODO(nkostylev): Provide blocking UI using ScreenLocker. |
| - } |
| + UserMetrics::RecordAction(UserMetricsAction("Login_Failure")); |
| + UMA_HISTOGRAM_ENUMERATION("Login.FailureReason", failure.reason(), |
| + LoginFailure::NUM_FAILURE_REASONS); |
| + |
| + last_login_failure_ = failure; |
| + if (delegate_) { |
| + captcha_.clear(); |
| + captcha_token_.clear(); |
| + if (failure.reason() == LoginFailure::NETWORK_AUTH_FAILED && |
| + failure.error().state() == GoogleServiceAuthError::CAPTCHA_REQUIRED) { |
| + captcha_token_ = failure.error().captcha().token; |
| + } |
| + delegate_->OnLoginFailure(failure); |
| + } else { |
| + // TODO(nkostylev): Provide blocking UI using ScreenLocker. |
| + } |
| } |
| void LoginPerformer::OnLoginSuccess( |
| @@ -47,6 +53,12 @@ void LoginPerformer::OnLoginSuccess( |
| const std::string& password, |
| const GaiaAuthConsumer::ClientLoginResult& credentials, |
| bool pending_requests) { |
| + UserMetrics::RecordAction(UserMetricsAction("Login_Success")); |
| + // 0 - Login success offline and online. It's a new user. or it's an |
| + // existing user and offline auth took longer than online auth. |
| + // 1 - Login success offline only. It's an existing user login. |
| + UMA_HISTOGRAM_ENUMERATION("Login.SuccessReason", pending_requests, 2); |
|
Nikita (slow)
2010/12/13 11:55:31
I though about this histogram again and there's th
Chris Masone
2010/12/13 15:55:12
If we can't do an online check, we'll see the latt
Nikita (slow)
2010/12/13 16:12:43
Yes, as what we basically want is on each successf
satorux1
2010/12/17 05:58:09
So you'll be adding code in ParallelAuthenticator
Nikita (slow)
2010/12/17 10:30:45
Chris, will you move this histogram to ParallelAut
|
| + |
| if (delegate_) { |
| delegate_->OnLoginSuccess(username, |
| password, |
| @@ -62,6 +74,9 @@ void LoginPerformer::OnLoginSuccess( |
| } |
| void LoginPerformer::OnOffTheRecordLoginSuccess() { |
| + UserMetrics::RecordAction( |
| + UserMetricsAction("Login_GuestLoginSuccess")); |
| + |
| if (delegate_) |
| delegate_->OnOffTheRecordLoginSuccess(); |
| else |