single_visit_cluster_finalizer.cc 885 B

1234567891011121314151617181920212223
  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. #include "components/history_clusters/core/single_visit_cluster_finalizer.h"
  5. #include "components/history_clusters/core/cluster_metrics_utils.h"
  6. #include "components/history_clusters/core/on_device_clustering_util.h"
  7. namespace history_clusters {
  8. SingleVisitClusterFinalizer::SingleVisitClusterFinalizer() = default;
  9. SingleVisitClusterFinalizer::~SingleVisitClusterFinalizer() = default;
  10. void SingleVisitClusterFinalizer::FinalizeCluster(history::Cluster& cluster) {
  11. ScopedFilterClusterMetricsRecorder metrics_recorder("SingleVisit");
  12. if (cluster.visits.size() <= 1) {
  13. cluster.should_show_on_prominent_ui_surfaces = false;
  14. metrics_recorder.set_was_filtered(true);
  15. }
  16. }
  17. } // namespace history_clusters