#include "chrome/browser/enterprise/connectors/device_trust/device_trust_service.h"
#include "base/base64.h"
#include "base/values.h"
#include "chrome/browser/enterprise/connectors/device_trust/attestation/common/attestation_service.h"
#include "chrome/browser/enterprise/connectors/device_trust/attestation/common/attestation_utils.h"
#include "chrome/browser/enterprise/connectors/device_trust/attestation/common/signals_type.h"
#include "chrome/browser/enterprise/connectors/device_trust/common/common_types.h"
#include "chrome/browser/enterprise/connectors/device_trust/common/metrics_utils.h"
#include "chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service.h"
#include "chrome/browser/enterprise/connectors/device_trust/signals/signals_service.h"
#include "components/enterprise/connectors/core/connectors_prefs.h"
#include "components/prefs/pref_service.h"
namespace enterprise_connectors {
namespace {
void OnJsonParsed(DeviceTrustService::ParseJsonChallengeCallback callback,
data_decoder::DataDecoder::ValueOrError result) { … }
DeviceTrustResponse CreateFailedResponse(DeviceTrustError error) { … }
}
CollectSignalsCallback;
DeviceTrustService::DeviceTrustService(
std::unique_ptr<AttestationService> attestation_service,
std::unique_ptr<SignalsService> signals_service,
DeviceTrustConnectorService* connector)
: … { … }
DeviceTrustService::DeviceTrustService() = default;
DeviceTrustService::~DeviceTrustService() = default;
bool DeviceTrustService::IsEnabled() const { … }
void DeviceTrustService::BuildChallengeResponse(
const std::string& serialized_challenge,
const std::set<DTCPolicyLevel>& levels,
DeviceTrustCallback callback) { … }
const std::set<DTCPolicyLevel> DeviceTrustService::Watches(
const GURL& url) const { … }
void DeviceTrustService::ParseJsonChallenge(
const std::string& serialized_challenge,
ParseJsonChallengeCallback callback) { … }
void DeviceTrustService::OnChallengeParsed(
const std::set<DTCPolicyLevel>& levels,
DeviceTrustCallback callback,
const std::string& challenge) { … }
void DeviceTrustService::GetSignals(CollectSignalsCallback callback) { … }
void DeviceTrustService::OnSignalsCollected(
const std::string& challenge,
const std::set<DTCPolicyLevel>& levels,
DeviceTrustCallback callback,
base::Value::Dict signals) { … }
void DeviceTrustService::OnAttestationResponseReceived(
DeviceTrustCallback callback,
const AttestationResponse& attestation_response) { … }
}