#include "components/history_clusters/core/file_clustering_backend.h"
#include <optional>
#include <utility>
#include "base/command_line.h"
#include "base/containers/flat_map.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "components/history_clusters/core/filter_cluster_processor.h"
#include "components/history_clusters/core/history_clusters_util.h"
namespace history_clusters {
namespace switches {
const char kClustersOverrideFile[] = …;
}
namespace {
std::optional<base::FilePath> GetClustersOverrideFilePath() { … }
std::vector<history::Cluster> GetClustersFromFile() { … }
std::vector<history::Cluster> GetClustersOnBackgroundThread(
std::vector<history::AnnotatedVisit> visits) { … }
}
FileClusteringBackend::FileClusteringBackend()
: … { … }
FileClusteringBackend::~FileClusteringBackend() = default;
std::unique_ptr<FileClusteringBackend>
FileClusteringBackend::CreateIfEnabled() { … }
void FileClusteringBackend::GetClusters(
ClusteringRequestSource clustering_request_source,
ClustersCallback callback,
std::vector<history::AnnotatedVisit> visits,
bool unused_requires_ui_and_triggerability) { … }
void FileClusteringBackend::GetClustersForUI(
ClusteringRequestSource clustering_request_source,
QueryClustersFilterParams filter_params,
ClustersCallback callback,
std::vector<history::Cluster> clusters) { … }
std::vector<history::Cluster>
FileClusteringBackend::GetClustersForUIOnBackgroundThread(
ClusteringRequestSource clustering_request_source,
QueryClustersFilterParams filter_params,
std::vector<history::Cluster> persisted_clusters) { … }
void FileClusteringBackend::GetClusterTriggerability(
ClustersCallback callback,
std::vector<history::Cluster> clusters) { … }
}