chromium/chrome/browser/ui/find_bar/BUILD.gn

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

import("//build/config/chromeos/args.gni")

assert(is_win || is_mac || is_linux || is_chromeos || is_android)

source_set("find_bar") {
  sources = [
    "find_bar.h",
    "find_bar_state.h",
    "find_bar_state_factory.h",
  ]

  public_deps = [
    "//base",
    "//chrome/browser/profiles:profile",
    "//components/find_in_page",
    "//components/keyed_service/core",
  ]

  if (!is_android) {
    sources += [ "find_bar_controller.h" ]

    public_deps += [ "//content/public/browser" ]
  }
}

source_set("impl") {
  sources = [
    "find_bar_state.cc",
    "find_bar_state_factory.cc",
  ]
  deps = [ ":find_bar" ]

  if (!is_android) {
    sources += [
      "find_bar_controller.cc",
      "find_bar_platform_helper.cc",
      "find_bar_platform_helper.h",
    ]
    deps += [ "//ui/gfx/range" ]
  }

  if (is_mac) {
    sources += [ "find_bar_platform_helper_mac.mm" ]
    public_deps = [ "//chrome/browser:browser_public_dependencies" ]
  }
}

source_set("unit_tests") {
  testonly = true

  sources = [ "find_backend_unittest.cc" ]

  deps = [
    ":find_bar",
    "//chrome/test:test_support",
  ]
}

if (!is_android) {
  source_set("browser_tests") {
    testonly = true

    defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

    sources = [
      "find_bar_controller_browsertest.cc",
      "find_bar_host_browsertest.cc",
    ]

    deps = [
      ":find_bar",
      ":test_support",
      "//chrome/test:test_support",
    ]

    if (is_mac) {
      sources += [ "find_bar_platform_helper_mac_browsertest.mm" ]
    }
  }
}

if (!is_android && !is_chromeos_device) {
  source_set("interactive_ui_tests") {
    testonly = true

    defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]

    sources = [ "find_bar_host_interactive_uitest.cc" ]

    deps = [
      ":find_bar",
      "//chrome/test:test_support",
    ]

    if (is_mac) {
      sources += [ "find_bar_platform_helper_mac_interactive_uitest.mm" ]
    }
  }
}

source_set("test_support") {
  testonly = true

  sources = [ "find_bar_host_unittest_util.h" ]
}