# 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.

static_library("core") {
  sources = [
    "finds_features.cc",
    "finds_features.h",
    "finds_metrics.cc",
    "finds_metrics.h",
    "finds_pref_names.cc",
    "finds_pref_names.h",
    "finds_service.cc",
    "finds_service.h",
    "finds_tab_helper.cc",
    "finds_tab_helper.h",
    "finds_utils.cc",
    "finds_utils.h",
  ]

  # We include the platform header here as a source to satisfy GN checks
  # for JNI without creating circular deps with the android target.
  if (is_android) {
    sources += [ "../android/finds_service_android.h" ]
  }

  deps = [
    "//base",
    "//chrome/app:generated_resources",
    "//chrome/browser/notifications/scheduler/public",
    "//chrome/browser/optimization_guide",
    "//chrome/browser/profiles:profile",
    "//chrome/common",
    "//components/history/core/browser",
    "//components/omnibox/browser",
    "//components/optimization_guide/core",
    "//components/optimization_guide/proto:optimization_guide_proto",
    "//components/pref_registry",
    "//components/prefs",
    "//components/search_engines",
    "//components/sessions",
    "//components/sync",
    "//components/unified_consent",
    "//content/public/browser",
  ]
  if (is_android) {
    deps += [
      "//chrome/browser/android:tabs_public",
      "//chrome/browser/ui/android/tab_model",
    ]
  }
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "finds_metrics_unittest.cc",
    "finds_service_unittest.cc",
    "finds_tab_helper_unittest.cc",
    "finds_utils_unittest.cc",
  ]
  deps = [
    ":core",
    "//base",
    "//base/test:test_support",
    "//chrome/browser/finds",
    "//chrome/browser/notifications/scheduler/test:test_support",
    "//chrome/browser/optimization_guide:test_support",
    "//chrome/browser/search_engines",
    "//chrome/browser/sync:factories",
    "//chrome/test:test_support",
    "//components/history/core/browser",
    "//components/optimization_guide/core:test_support",
    "//components/optimization_guide/proto:optimization_guide_proto",
    "//components/prefs:test_support",
    "//components/sync:test_support",
    "//content/test:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]
}
