chromium/components/supervised_user/core/browser/supervised_user_utils.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// A templated function to merge multiple values of the same type into either:
// * An empty optional if none of the values are set
// * A non-empty optional if all the set values are equal
// * An optional containing |mixed_value| if there are multiple different
// values.
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) {}

}  // namespace

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 {}

}  // namespace supervised_user