#include "components/policy/core/common/policy_proto_decoders.h"
#include <cstring>
#include <limits>
#include <memory>
#include "base/json/json_reader.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "components/policy/core/common/cloud/cloud_external_data_manager.h"
#include "components/policy/core/common/policy_logger.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/policy_constants.h"
#include "components/policy/proto/cloud_policy.pb.h"
#include "components/strings/grit/components_strings.h"
namespace policy {
em;
namespace {
const char kValue[] = …;
const char kLevel[] = …;
const char kRecommended[] = …;
template <class AnyPolicyProto>
bool GetPolicyLevel(const AnyPolicyProto& policy_proto, PolicyLevel* level) { … }
base::Value DecodeBooleanProto(const em::BooleanPolicyProto& proto) { … }
base::Value DecodeIntegerProto(const em::IntegerPolicyProto& proto,
std::string* error) { … }
base::Value DecodeStringProto(const em::StringPolicyProto& proto) { … }
base::Value DecodeStringListProto(const em::StringListPolicyProto& proto) { … }
base::Value DecodeJsonProto(const em::StringPolicyProto& proto,
std::string* error) { … }
bool PerProfileMatches(bool policy_per_profile,
PolicyPerProfileFilter per_profile_enum) { … }
bool UseExternalDataFetcher(const char* policy_name,
StringPolicyType policy_type) { … }
}
void DecodeProtoFields(
const em::CloudPolicySettings& policy,
base::WeakPtr<CloudExternalDataManager> external_data_manager,
PolicySource source,
PolicyScope scope,
PolicyMap* map,
PolicyPerProfileFilter per_profile) { … }
bool ParseComponentPolicy(base::Value::Dict json_dict,
PolicyScope scope,
PolicySource source,
PolicyMap* policy,
std::string* error) { … }
}