chromium/components/browsing_data/core/browsing_data_policies_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/browsing_data/core/browsing_data_policies_utils.h"

#include <vector>

#include "base/containers/fixed_flat_map.h"
#include "base/containers/span.h"
#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "components/browsing_data/core/browsing_data_utils.h"
#include "components/browsing_data/core/pref_names.h"
#include "components/sync/base/user_selectable_type.h"
#include "components/sync/service/sync_prefs.h"

namespace browsing_data {

namespace {

namespace policy_data_types {
// Data retention policy types that require sync to be disabled.
constexpr char kBrowsingHistoryName[] =;
constexpr char kPasswordSigninName[] =;
constexpr char kAutofillName[] =;
constexpr char kSiteSettingsName[] =;
// Data retention policy types that do not require sync to be disabled.
constexpr char kHostedAppDataName[] =;
constexpr char kDownloadHistoryName[] =;
constexpr char kCookiesAndOtherSiteDataName[] =;
constexpr char kCachedImagesAndFilesName[] =;
}  // namespace policy_data_types

// The format of the log message shown in chrome://policy/logs when sync types
// are automatically disabled.
constexpr char kDisabledSyncTypesLogFormat[] =;

// Adds the sync type for the `browsing_data_type` to  `sync_types` if it
// should be disabled.
void AppendSyncTypesIfRequired(const base::Value& browsing_data_type,
                               syncer::UserSelectableTypeSet* sync_types) {}

}  // namespace

syncer::UserSelectableTypeSet GetSyncTypesForClearBrowsingData(
    const base::Value& policy_value) {}

syncer::UserSelectableTypeSet GetSyncTypesForBrowsingDataLifetime(
    const base::Value& policy_value) {}

std::string DisableSyncTypes(const syncer::UserSelectableTypeSet& types_set,
                             PrefValueMap* prefs,
                             const std::string& policy_name) {}

std::optional<PolicyDataType> NameToPolicyDataType(
    const std::string& type_name) {}

}  // namespace browsing_data