#include "chrome/updater/device_management/dm_message.h"
#include <memory>
#include <utility>
#include "base/containers/fixed_flat_map.h"
#include "base/logging.h"
#include "base/ranges/algorithm.h"
#include "chrome/enterprise_companion/device_management_storage/dm_storage.h"
#include "chrome/updater/device_management/dm_response_validator.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/policy/core/common/cloud/cloud_policy_util.h"
#include "components/policy/proto/device_management_backend.pb.h"
namespace updater {
constexpr char kGoogleUpdatePolicyType[] = …;
namespace {
enterprise_management::PolicyValidationReportRequest::ValidationResultType
TranslatePolicyValidationResultStatus(PolicyValidationResult::Status status) { … }
enterprise_management::PolicyValueValidationIssue::ValueValidationIssueSeverity
TranslatePolicyValidationResultSeverity(
PolicyValueValidationIssue::Severity severity) { … }
}
std::string GetRegisterBrowserRequestData() { … }
std::string GetPolicyFetchRequestData(
const std::string& policy_type,
const device_management_storage::CachedPolicyInfo& policy_info) { … }
std::string GetPolicyValidationReportRequestData(
const PolicyValidationResult& validation_result) { … }
std::string ParseDeviceRegistrationResponse(const std::string& response_data) { … }
bool ShouldDeleteDmToken(const std::string& response_data) { … }
DMPolicyMap ParsePolicyFetchResponse(
const std::string& response_data,
const device_management_storage::CachedPolicyInfo& policy_info,
const std::string& expected_dm_token,
const std::string& expected_device_id,
std::vector<PolicyValidationResult>& validation_results) { … }
}