#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/policy/core/common/policy_merger.h"
#include <array>
#include <map>
#include <set>
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/policy/core/common/features.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/policy/policy_constants.h"
#include "components/strings/grit/components_strings.h"
namespace policy {
namespace {
#if !BUILDFLAG(IS_IOS) && !BUILDFLAG(IS_ANDROID)
constexpr const char* kDictionaryPoliciesToMerge[] = …;
#endif
}
bool PolicyMerger::EntriesCanBeMerged(
const PolicyMap::Entry& entry_1,
const PolicyMap::Entry& entry_2,
const bool is_user_cloud_merging_enabled) { … }
PolicyMerger::PolicyMerger() = default;
PolicyMerger::~PolicyMerger() = default;
PolicyListMerger::PolicyListMerger(
base::flat_set<std::string> policies_to_merge)
: … { … }
PolicyListMerger::~PolicyListMerger() = default;
PolicyGroupMerger::PolicyGroupMerger() = default;
PolicyGroupMerger::~PolicyGroupMerger() = default;
void PolicyListMerger::Merge(PolicyMap* policies) const { … }
void PolicyListMerger::SetAllowUserCloudPolicyMerging(bool allowed) { … }
bool PolicyListMerger::CanMerge(const std::string& policy_name,
PolicyMap::Entry& policy) const { … }
bool PolicyListMerger::AllowUserCloudPolicyMerging() const { … }
void PolicyListMerger::DoMerge(PolicyMap::Entry* policy) const { … }
PolicyDictionaryMerger::PolicyDictionaryMerger(
base::flat_set<std::string> policies_to_merge)
#if BUILDFLAG(IS_IOS) || BUILDFLAG(IS_ANDROID)
: … { … }
#endif
PolicyDictionaryMerger::~PolicyDictionaryMerger() = default;
void PolicyDictionaryMerger::Merge(PolicyMap* policies) const { … }
void PolicyDictionaryMerger::SetAllowedPoliciesForTesting(
base::flat_set<std::string> allowed_policies) { … }
void PolicyDictionaryMerger::SetAllowUserCloudPolicyMerging(bool allowed) { … }
bool PolicyDictionaryMerger::CanMerge(const std::string& policy_name,
PolicyMap::Entry& policy) const { … }
bool PolicyDictionaryMerger::AllowUserCloudPolicyMerging() const { … }
void PolicyDictionaryMerger::DoMerge(PolicyMap::Entry* policy,
const PolicyMap& policy_map) const { … }
void PolicyGroupMerger::Merge(PolicyMap* policies) const { … }
}