chromium/components/component_updater/installer_policies/BUILD.gn

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

group("installer_policies") {
  public_deps = [
    ":installer_policies_no_content_deps",
    ":installer_policies_with_content_deps",
  ]
}

# Installer policies that can be used in targets that can't depend on
# //content/ such as //android_webview:nonembedded.
# Prefer adding installer policies here.
static_library("installer_policies_no_content_deps") {
  sources = [
    "autofill_states_component_installer.cc",
    "autofill_states_component_installer.h",
    "first_party_sets_component_installer_policy.cc",
    "first_party_sets_component_installer_policy.h",
    "masked_domain_list_component_installer_policy.cc",
    "masked_domain_list_component_installer_policy.h",
    "origin_trials_component_installer.cc",
    "origin_trials_component_installer.h",
    "plus_address_blocklist_component_installer.cc",
    "plus_address_blocklist_component_installer.h",
    "safety_tips_component_installer.cc",
    "safety_tips_component_installer.h",
    "tpcd_metadata_component_installer_policy.cc",
    "tpcd_metadata_component_installer_policy.h",
    "trust_token_key_commitments_component_installer_policy.cc",
    "trust_token_key_commitments_component_installer_policy.h",
  ]

  deps = [
    "//base",
    "//components/autofill/core/browser",
    "//components/component_updater",
    "//components/lookalikes/core:proto",
    "//components/lookalikes/core:safety_tips",
    "//components/plus_addresses:blocklist_data",
    "//components/plus_addresses:features",
    "//components/prefs",
    "//components/tpcd/metadata/browser",
    "//components/update_client",
    "//mojo/public/cpp/base:protobuf_support",
    "//services/network/public/cpp",
  ]

  # Disallow depending on content.
  assert_no_deps = [ "//content/public" ]
}

static_library("installer_policies_with_content_deps") {
  sources = [
    "on_device_head_suggest_component_installer.cc",
    "on_device_head_suggest_component_installer.h",
    "optimization_hints_component_installer.cc",
    "optimization_hints_component_installer.h",
  ]

  deps = [
    "//base",
    "//components/component_updater",
    "//components/omnibox/browser",
    "//components/omnibox/common",
    "//components/optimization_guide/core",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "autofill_states_component_installer_unittest.cc",
    "first_party_sets_component_installer_policy_unittest.cc",
    "masked_domain_list_component_installer_policy_unittest.cc",
    "optimization_hints_component_installer_unittest.cc",
    "plus_address_blocklist_component_installer_unittest.cc",
    "tpcd_metadata_component_installer_policy_unittest.cc",
    "trust_token_key_commitments_component_installer_policy_unittest.cc",
  ]

  deps = [
    ":installer_policies",
    "//base",
    "//base/test:test_support",
    "//components/autofill/core/browser:test_support",
    "//components/component_updater:test_support",
    "//components/optimization_guide/core",
    "//components/plus_addresses:blocklist_data",
    "//components/plus_addresses:features",
    "//components/privacy_sandbox/masked_domain_list:masked_domain_list_proto",
    "//components/tpcd/metadata/browser",
    "//mojo/public/cpp/base:protobuf_support",
    "//services/network/public/cpp",
    "//testing/gmock",
    "//testing/gtest",
  ]
}