# Copyright 2026 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

component("private_insights") {
  public = [
    "private_insights_features.h",
    "private_insights_service.h",
  ]
  sources = [
    "fcp_flags.cc",
    "fcp_flags.h",
    "private_insights_features.cc",
    "private_insights_service.cc",
  ]
  defines = [ "IS_PRIVATE_INSIGHTS_IMPL" ]
  public_deps = [
    "//components/keyed_service/core",
    "//components/metrics",
    "//components/prefs",
    "//components/private_insights/events:contextual_cue_log_event_proto",
  ]
  deps = [
    ":fcp_event_publisher",
    ":fcp_files",
    ":fcp_http_client",
    ":fcp_log_manager",
    ":fcp_simple_task_environment",
    ":fcp_utils",
    "//base",
    "//base:i18n",
    "//components/version_info",
    "//google_apis",
    "//third_party/federated_compute:fl_runner",
  ]
}

source_set("private_insights_logger") {
  public = [ "contextual_cue_log_event_helpers.h" ]
  public_deps =
      [ "//components/private_insights/events:contextual_cue_log_event_proto" ]
  deps = [ "//base" ]
}

source_set("fcp_utils") {
  visibility = [ ":*" ]
  public = [ "fcp_utils.h" ]
  sources = [ "fcp_utils.cc" ]
  public_deps = [
    "//base",
    "//third_party/federated_compute:fl_runner",
  ]
  deps = [ "//net" ]
}

source_set("fcp_event_publisher") {
  visibility = [ ":*" ]
  public = [ "fcp_event_publisher.h" ]
  sources = [ "fcp_event_publisher.cc" ]
  public_deps = [ "//third_party/federated_compute:fl_runner" ]
  deps = [ "//base" ]
}

source_set("fcp_log_manager") {
  visibility = [ ":*" ]
  public = [ "fcp_log_manager.h" ]
  sources = [ "fcp_log_manager.cc" ]
  public_deps = [ "//third_party/federated_compute:fl_runner" ]
  deps = [ "//base" ]
}

source_set("fcp_simple_task_environment") {
  visibility = [ ":*" ]
  public = [ "fcp_simple_task_environment.h" ]
  sources = [ "fcp_simple_task_environment.cc" ]
  include_dirs = [ "$root_gen_dir/third_party/federated_compute/chromium" ]
  public_deps = [
    "//third_party/federated_compute:client_proto",
    "//third_party/federated_compute:fl_runner",
  ]
  deps = [
    ":fcp_http_client",
    "//base",
    "//components/resources:components_resources",
    "//ui/base",
  ]
}

source_set("fcp_http_client") {
  visibility = [ ":*" ]
  public = [ "fcp_http_client.h" ]
  sources = [ "fcp_http_client.cc" ]
  public_deps = [ "//third_party/federated_compute:fl_runner" ]
  deps = [
    ":fcp_utils",
    "//base",
    "//net",
    "//services/network/public/cpp",
    "//url",
  ]
}

source_set("fcp_files") {
  visibility = [ ":*" ]
  public = [ "fcp_files.h" ]
  sources = [ "fcp_files.cc" ]
  public_deps = [ "//third_party/federated_compute:fl_runner" ]
  deps = [ "//base" ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "contextual_cue_log_event_helpers_unittest.cc",
    "fcp_files_unittest.cc",
    "fcp_http_client_unittest.cc",
    "fcp_simple_task_environment_unittest.cc",
    "fcp_utils_unittest.cc",
    "private_insights_service_unittest.cc",
  ]
  deps = [
    ":fcp_files",
    ":fcp_http_client",
    ":fcp_simple_task_environment",
    ":fcp_utils",
    ":private_insights",
    ":private_insights_logger",
    "//base",
    "//base/test:test_support",
    "//components/metrics",
    "//components/prefs:test_support",
    "//components/private_insights/events:contextual_cue_log_event_proto",
    "//services/network:test_support",
    "//testing/gtest",
    "//third_party/federated_compute:confidential_compute_crypto_test_util",
    "//ui/base",
  ]
}
