#include "components/visited_url_ranking/internal/transformer/url_visit_aggregates_segmentation_metrics_transformer.h"
#include <memory>
#include <set>
#include <vector>
#include "base/functional/callback.h"
#include "base/scoped_observation.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "components/segmentation_platform/embedder/default_model/database_api_clients.h"
#include "components/segmentation_platform/internal/metadata/metadata_writer.h"
#include "components/segmentation_platform/public/database_client.h"
#include "components/segmentation_platform/public/segmentation_platform_service.h"
#include "components/segmentation_platform/public/service_proxy.h"
#include "components/visited_url_ranking/public/url_visit.h"
#include "components/visited_url_ranking/public/url_visit_schema.h"
#include "components/visited_url_ranking/public/visited_url_ranking_service.h"
namespace {
const char kSeenCount[] = …;
const char kActivatedCount[] = …;
const char kDismissedCount[] = …;
constexpr int kNumUserInteractionMetrics = …;
constexpr std::array<const char*, kNumUserInteractionMetrics>
kUserInteractionMetrics{ … };
void AddUserInteractionSignal(std::map<std::string, float>& metrics,
int day_range,
const char* name,
int count) { … }
}
namespace visited_url_ranking {
class URLVisitAggregatesSegmentationMetricsTransformer::SegmentationInitObserver
: public segmentation_platform::ServiceProxy::Observer { … };
URLVisitAggregatesSegmentationMetricsTransformer::
URLVisitAggregatesSegmentationMetricsTransformer(
segmentation_platform::SegmentationPlatformService* sps)
: … { … }
URLVisitAggregatesSegmentationMetricsTransformer::
~URLVisitAggregatesSegmentationMetricsTransformer() = default;
void URLVisitAggregatesSegmentationMetricsTransformer::Transform(
std::vector<URLVisitAggregate> aggregates,
const FetchOptions& options,
OnTransformCallback callback) { … }
void URLVisitAggregatesSegmentationMetricsTransformer::OnMetricsQueryDataReady(
std::vector<URLVisitAggregate> url_visit_aggregates,
OnTransformCallback callback,
segmentation_platform::DatabaseClient::ResultStatus status,
const segmentation_platform::ModelProvider::Request& result) { … }
}