Chromium Code Reviews| Index: chrome/browser/chromeos/login/session/user_session_manager.cc |
| diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc |
| index 0c8a30ddea89efa8c10f973f9e54cfaf2bcdd71b..5114cdac4bc376640ed7e3e0d34d21f02841782b 100644 |
| --- a/chrome/browser/chromeos/login/session/user_session_manager.cc |
| +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc |
| @@ -10,6 +10,7 @@ |
| #include "base/bind.h" |
| #include "base/command_line.h" |
| #include "base/logging.h" |
| +#include "base/metrics/histogram.h" |
|
Ilya Sherman
2015/04/07 21:31:18
nit: Please include histogram_macros instead
|
| #include "base/path_service.h" |
| #include "base/prefs/pref_member.h" |
| #include "base/prefs/pref_registry_simple.h" |
| @@ -1462,6 +1463,9 @@ void UserSessionManager::OnEasyUnlockKeyOpsFinished( |
| void UserSessionManager::ActiveUserChanged( |
| const user_manager::User* active_user) { |
| + if (!user_manager::UserManager::Get()->IsCurrentUserNew()) |
| + SendUserPodsMetrics(); |
| + |
| Profile* profile = ProfileHelper::Get()->GetProfileByUser(active_user); |
| // If profile has not yet been initialized, delay initialization of IME. |
| if (!profile) |
| @@ -1586,4 +1590,27 @@ void UserSessionManager::InjectStubUserContext( |
| authenticator_ = NULL; |
| } |
| +void UserSessionManager::SendUserPodsMetrics() { |
| + bool show_users_on_signin; |
| + CrosSettings::Get()->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, |
| + &show_users_on_signin); |
| + bool is_enterprise_managed = g_browser_process->platform_part() |
| + ->browser_policy_connector_chromeos() |
| + ->IsEnterpriseManaged(); |
| + UserPodsDisplay display; |
| + if (show_users_on_signin) { |
| + if (is_enterprise_managed) |
| + display = USER_PODS_DISPLAY_ENABLED_MANAGED; |
| + else |
| + display = USER_PODS_DISPLAY_ENABLED_REGULAR; |
| + } else { |
| + if (is_enterprise_managed) |
| + display = USER_PODS_DISPLAY_DISABLED_MANAGED; |
| + else |
| + display = USER_PODS_DISPLAY_DISABLED_REGULAR; |
| + } |
| + UMA_HISTOGRAM_ENUMERATION("UserSessionManager.UserPodsDisplay", display, |
| + NUM_USER_PODS_DISPLAY); |
| +} |
| + |
| } // namespace chromeos |