#include "components/supervised_user/core/browser/supervised_user_utils.h"
#include <optional>
#include <vector>
#include "base/metrics/histogram_functions.h"
#include "base/notreached.h"
#include "components/prefs/pref_service.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/supervised_user/core/browser/family_link_user_log_record.h"
#include "components/supervised_user/core/browser/supervised_user_url_filter.h"
#include "components/supervised_user/core/common/pref_names.h"
#include "components/supervised_user/core/common/supervised_user_constants.h"
#include "components/url_formatter/url_formatter.h"
#include "components/url_matcher/url_util.h"
#include "url/gurl.h"
namespace supervised_user {
namespace {
template <class T>
std::optional<T> GetMergedRecord(const std::vector<std::optional<T>> records,
T mixed_value) { … }
std::optional<FamilyLinkUserLogRecord::Segment> GetLogSegmentForHistogram(
const std::vector<FamilyLinkUserLogRecord>& records) { … }
std::optional<WebFilterType> GetWebFilterForHistogram(
const std::vector<FamilyLinkUserLogRecord>& records) { … }
std::optional<ToggleState> GetPermissionsToggleStateForHistogram(
const std::vector<FamilyLinkUserLogRecord>& records) { … }
std::optional<ToggleState> GetExtensionsToggleStateForHistogram(
const std::vector<FamilyLinkUserLogRecord>& records) { … }
}
std::string FamilyRoleToString(kidsmanagement::FamilyRole role) { … }
std::string FilteringBehaviorReasonToString(FilteringBehaviorReason reason) { … }
GURL NormalizeUrl(const GURL& url) { … }
bool AreWebFilterPrefsDefault(const PrefService& pref_service) { … }
bool EmitLogRecordHistograms(
const std::vector<FamilyLinkUserLogRecord>& records) { … }
UrlFormatter::UrlFormatter(
const SupervisedUserURLFilter& supervised_user_url_filter,
FilteringBehaviorReason filtering_behavior_reason)
: … { … }
UrlFormatter::~UrlFormatter() = default;
GURL UrlFormatter::FormatUrl(const GURL& url) const { … }
}