Commit b3dd5579 authored by Ramin Halavati's avatar Ramin Halavati Committed by Chromium LUCI CQ

Add metric for Guest profile startup trigger.

Adds "Profile.Guest.ForcedByPolicy" metric which records if Guest
profiles are initiated by user request or forced by policy.

Bug: 1125474, 1167473
Change-Id: I8c87096bd60d260c1542a1c869361f3f5ed2cb43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2632586
Auto-Submit: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: Jesse Doherty <jwd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844896}
parent 77bb3aa1
......@@ -25,6 +25,7 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
#include "base/path_service.h"
#include "base/sequenced_task_runner.h"
......@@ -565,6 +566,16 @@ ProfileImpl::ProfileImpl(
// Prefs were loaded synchronously so we can continue directly.
OnPrefsLoaded(create_mode, true);
}
#if !defined(OS_ANDROID)
if (IsGuestSession() || IsEphemeralGuestProfile()) {
PrefService* local_state = g_browser_process->local_state();
DCHECK(local_state);
base::UmaHistogramBoolean(
"Profile.Guest.ForcedByPolicy",
local_state->GetBoolean(prefs::kBrowserGuestModeEnforced));
}
#endif // !defined(OS_ANDROID)
}
#if defined(OS_ANDROID)
......
......@@ -207,6 +207,16 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<summary>Size of the favicons database.</summary>
</histogram>
<histogram name="Profile.Guest.ForcedByPolicy" enum="BooleanForced"
expires_after="M92">
<owner>rhalavati@chromium.org</owner>
<owner>chrome-privacy-core@google.com</owner>
<summary>
Records if a Guest session is started by user's request or is forced by a
policy. This is recorded when a Guest profile is created.
</summary>
</histogram>
<histogram name="Profile.Guest.{Type}.Lifetime" units="minutes"
expires_after="2021-06-01">
<owner>rhalavati@chromium.org</owner>
......
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