on_device_clustering_util.h 1.1 KB

12345678910111213141516171819202122232425262728
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_HISTORY_CLUSTERS_CORE_ON_DEVICE_CLUSTERING_UTIL_H_
  5. #define COMPONENTS_HISTORY_CLUSTERS_CORE_ON_DEVICE_CLUSTERING_UTIL_H_
  6. #include "components/history/core/browser/history_types.h"
  7. namespace history_clusters {
  8. // Moves |duplicate_visit| into |canonical_visit|'s list of duplicate visits.
  9. // |duplicate_visit| should be considered invalid after this call.
  10. void MergeDuplicateVisitIntoCanonicalVisit(
  11. history::ClusterVisit&& duplicate_visit,
  12. history::ClusterVisit& canonical_visit);
  13. // Enforces the reverse-chronological invariant of clusters, as well the
  14. // by-score sorting of visits within clusters. Exposed for testing.
  15. void SortClusters(std::vector<history::Cluster>* clusters);
  16. // Whether the visit is considered a noisy visit (i.e. high engagement,
  17. // non-SRP).
  18. bool IsNoisyVisit(const history::ClusterVisit& visit);
  19. } // namespace history_clusters
  20. #endif // COMPONENTS_HISTORY_CLUSTERS_CORE_ON_DEVICE_CLUSTERING_UTIL_H_