#include "components/device_signals/core/browser/signals_aggregator_impl.h"
#include <functional>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "components/device_signals/core/browser/metrics_utils.h"
#include "components/device_signals/core/browser/signals_collector.h"
#include "components/device_signals/core/browser/signals_types.h"
#include "components/device_signals/core/browser/user_context.h"
#include "components/device_signals/core/browser/user_permission_service.h"
#include "components/device_signals/core/common/signals_constants.h"
namespace device_signals {
namespace {
SignalCollectionError PermissionToError(const UserPermission permission) { … }
void RespondWithError(SignalCollectionError error,
SignalsAggregator::GetSignalsCallback callback) { … }
void OnSignalRetrieved(std::unique_ptr<SignalsAggregationResponse> response,
SignalsAggregator::GetSignalsCallback callback) { … }
}
SignalsAggregatorImpl::SignalsAggregatorImpl(
UserPermissionService* permission_service,
std::vector<std::unique_ptr<SignalsCollector>> collectors)
: … { … }
SignalsAggregatorImpl::~SignalsAggregatorImpl() = default;
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
void SignalsAggregatorImpl::GetSignalsForUser(
const UserContext& user_context,
const SignalsAggregationRequest& request,
GetSignalsCallback callback) { … }
#endif
void SignalsAggregatorImpl::GetSignals(const SignalsAggregationRequest& request,
GetSignalsCallback callback) { … }
void SignalsAggregatorImpl::GetSignalsWithPermission(
const UserPermission user_permission,
const SignalsAggregationRequest& request,
GetSignalsCallback callback) { … }
}