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..324b6d13d3c5c81f211544fdcf32db9621ef69a5 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,11 @@ 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. |
|
Nikita (slow)
2010/12/02 12:27:50
Makes sense.
0 - it does mean that it's a new use
satorux1
2010/12/02 12:49:09
Updated comments accordingly.
|
| + // 1 = login success offline only. |
| + UMA_HISTOGRAM_ENUMERATION("Login.SuccessReason", pending_requests, 2); |
| + |
| if (delegate_) { |
| delegate_->OnLoginSuccess(username, |
| password, |
| @@ -62,6 +73,9 @@ void LoginPerformer::OnLoginSuccess( |
| } |
| void LoginPerformer::OnOffTheRecordLoginSuccess() { |
| + UserMetrics::RecordAction( |
| + UserMetricsAction("Login_OffTheRecordLoginSuccess")); |
|
Nikita (slow)
2010/12/02 12:26:35
nit: Login_GuestLoginSuccess
satorux1
2010/12/02 12:49:09
Done.
satorux1
2010/12/02 12:49:09
Done.
|
| + |
| if (delegate_) |
| delegate_->OnOffTheRecordLoginSuccess(); |
| else |