Commit 46bbbcd7 authored by ginkage's avatar ginkage Committed by Commit bot

Add an UMA stat to be able to see if the User pods are show on start screen,

and if not, what disabled them: the local setting or domain policy.

BUG=470383

Review URL: https://codereview.chromium.org/1064843003

Cr-Commit-Position: refs/heads/master@{#324206}
parent ce40c016
......@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#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
......@@ -371,6 +371,23 @@ class UserSessionManager
should_launch_browser_ = should_launch_browser;
}
// The user pods display type for histogram.
enum UserPodsDisplay {
// User pods enabling or disabling is possible either via local settings or
// via domain policy. The former method only applies to regular devices,
// whereas the latter is for enterprise-managed devices. Therefore, we have
// four possible combiations.
USER_PODS_DISPLAY_ENABLED_REGULAR = 0,
USER_PODS_DISPLAY_ENABLED_MANAGED = 1,
USER_PODS_DISPLAY_DISABLED_REGULAR = 2,
USER_PODS_DISPLAY_DISABLED_MANAGED = 3,
// Maximum histogram value.
NUM_USER_PODS_DISPLAY = 4
};
// Sends metrics for user pods display when existing user has logged in.
void SendUserPodsMetrics();
UserSessionManagerDelegate* delegate_;
// Authentication/user context.
......
......@@ -42293,6 +42293,14 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>
<histogram name="UserSessionManager.UserPodsDisplay" enum="UserPodsDisplay">
<owner>ginkage@chromium.org</owner>
<summary>
Whether the user pods were enabled during login, and what could disable
them.
</summary>
</histogram>
<histogram name="V8.ASTOptimization">
<obsolete>
This histogram is no longer present in V8.
......@@ -62424,6 +62432,13 @@ To add a new entry, add it with any value and run test to compute valid value.
<int value="0" label="WiFi Scan"/>
</enum>
<enum name="UserPodsDisplay" type="int">
<int value="0" label="Enabled by local settings"/>
<int value="1" label="Enabled by domain policy"/>
<int value="2" label="Disabled by local settings"/>
<int value="3" label="Disabled by domain policy"/>
</enum>
<enum name="UserSelectableSyncType" type="int">
<int value="0" label="Bookmarks"/>
<int value="1" label="Preferences"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment