chromium/components/subresource_filter/content/browser/BUILD.gn

# Copyright 2016 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/features.gni")

static_library("browser") {
  sources = [
    "ad_tagging_utils.cc",
    "ad_tagging_utils.h",
    "ads_intervention_manager.cc",
    "ads_intervention_manager.h",
    "content_activation_list_utils.cc",
    "content_activation_list_utils.h",
    "content_subresource_filter_throttle_manager.cc",
    "content_subresource_filter_throttle_manager.h",
    "content_subresource_filter_web_contents_helper.cc",
    "content_subresource_filter_web_contents_helper.h",
    "devtools_interaction_tracker.cc",
    "devtools_interaction_tracker.h",
    "navigation_console_logger.cc",
    "navigation_console_logger.h",
    "profile_interaction_manager.cc",
    "profile_interaction_manager.h",
    "safe_browsing_child_navigation_throttle.cc",
    "safe_browsing_child_navigation_throttle.h",
    "safe_browsing_page_activation_throttle.cc",
    "safe_browsing_page_activation_throttle.h",
    "safe_browsing_ruleset_publisher.cc",
    "safe_browsing_ruleset_publisher.h",
    "subresource_filter_content_settings_manager.cc",
    "subresource_filter_content_settings_manager.h",
    "subresource_filter_observer.h",
    "subresource_filter_observer_manager.cc",
    "subresource_filter_observer_manager.h",
    "subresource_filter_profile_context.cc",
    "subresource_filter_profile_context.h",
    "subresource_filter_safe_browsing_client.cc",
    "subresource_filter_safe_browsing_client.h",
    "subresource_filter_safe_browsing_client_request.cc",
    "subresource_filter_safe_browsing_client_request.h",
  ]
  deps = [
    "//base",
    "//components/content_settings/browser",
    "//components/content_settings/core/browser",
    "//components/content_settings/core/common",
    "//components/keyed_service/core",
    "//components/prefs:prefs",
    "//components/safe_browsing/core/browser/db:database_manager",
    "//components/safe_browsing/core/browser/db:util",
    "//components/safe_browsing/core/common",
    "//components/subresource_filter/content/shared/browser",
    "//components/subresource_filter/content/shared/common",
    "//components/subresource_filter/core/browser",
    "//components/subresource_filter/core/common",
    "//components/ukm:ukm",
    "//content/public/browser",
    "//content/public/common",
    "//ipc",
    "//net",
    "//third_party/blink/public/common",
    "//url",
  ]
  public_deps = [
    "//components/subresource_filter/content/mojom",
    "//third_party/flatbuffers:flatbuffers",
    "//ui/base",
  ]
  configs += [ "//build/config/compiler:wexit_time_destructors" ]
  if (is_android) {
    sources += [
      "ads_blocked_infobar.cc",
      "ads_blocked_infobar.h",
      "ads_blocked_infobar_delegate.cc",
      "ads_blocked_infobar_delegate.h",
      "ads_blocked_message_delegate.cc",
      "ads_blocked_message_delegate.h",
    ]
    deps += [
      "//components/infobars/android",
      "//components/infobars/content",
      "//components/infobars/core",
      "//components/messages/android",
      "//components/messages/android:feature_flags",
      "//components/resources:android_resources",
      "//components/strings:components_strings_grit",
      "//components/subresource_filter/android:android",
      "//components/subresource_filter/android:subresource_filter_jni_headers",
    ]
  }
}

static_library("test_support") {
  testonly = true
  sources = [
    "ad_tagging_browser_test_utils.cc",
    "ad_tagging_browser_test_utils.h",
    "fake_safe_browsing_database_manager.cc",
    "fake_safe_browsing_database_manager.h",
    "subresource_filter_observer_test_utils.cc",
    "subresource_filter_observer_test_utils.h",
    "subresource_filter_test_harness.cc",
    "subresource_filter_test_harness.h",
    "test_ruleset_publisher.cc",
    "test_ruleset_publisher.h",
    "throttle_manager_test_support.cc",
    "throttle_manager_test_support.h",
  ]
  deps = [
    ":browser",
    "//base/test:test_support",
    "//components/content_settings/browser",
    "//components/content_settings/browser:test_support",
    "//components/content_settings/core/browser",
    "//components/infobars/content",
    "//components/infobars/core",
    "//components/prefs:test_support",
    "//components/safe_browsing/core/browser/db:database_manager",
    "//components/safe_browsing/core/common",
    "//components/subresource_filter/content/shared/browser",
    "//components/subresource_filter/core/browser",
    "//components/subresource_filter/core/browser:test_support",
    "//components/subresource_filter/core/common",
    "//components/subresource_filter/core/common:test_support",
    "//components/sync_preferences:test_support",
    "//components/user_prefs",
    "//content/public/browser",
    "//content/test:test_support",
    "//net",
    "//services/network/public/mojom",
    "//testing/gtest:gtest",
    "//url",
  ]
  public_deps = [
    "//components/safe_browsing/core/browser/db:test_database_manager",
    "//components/safe_browsing/core/browser/db:util",
  ]
  if (is_android) {
    deps += [ "//components/messages/android:test_support" ]
  }
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "ads_intervention_manager_unittest.cc",
    "content_activation_list_utils_unittest.cc",
    "content_subresource_filter_throttle_manager_unittest.cc",
    "navigation_console_logger_unittest.cc",
    "safe_browsing_child_navigation_throttle_unittest.cc",
    "safe_browsing_page_activation_throttle_unittest.cc",
    "subresource_filter_configuration_unittest.cc",
    "subresource_filter_content_settings_manager_unittest.cc",
    "subresource_filter_unittest.cc",
  ]
  deps = [
    ":browser",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//components/content_settings/browser",
    "//components/content_settings/core/browser",
    "//components/content_settings/core/common",
    "//components/infobars/content",
    "//components/infobars/core",
    "//components/prefs:test_support",
    "//components/safe_browsing/core/browser/db:database_manager",
    "//components/safe_browsing/core/browser/db:util",
    "//components/safe_browsing/core/common",
    "//components/subresource_filter/content/shared/browser:test_support",
    "//components/subresource_filter/content/shared/common",
    "//components/subresource_filter/core/browser",
    "//components/subresource_filter/core/browser:test_support",
    "//components/subresource_filter/core/common",
    "//components/subresource_filter/core/mojom",
    "//components/sync_preferences:test_support",
    "//components/ukm:test_support",
    "//components/ukm/content:content",
    "//content/public/browser",
    "//content/test:test_support",
    "//ipc",
    "//ipc:test_support",
    "//testing/gtest",
    "//ui/base:test_support",
    "//url",
  ]
  public_deps = [ "//components/subresource_filter/content/mojom" ]
  if (is_android) {
    sources += [ "ads_blocked_message_delegate_unittest.cc" ]
    deps += [
      "//components/messages/android:test_support",
      "//components/resources:android_resources",
      "//components/strings:components_strings_grit",
    ]
  }
  if (is_ios && use_blink) {
    deps += [ "//components/test:subresource_filter_test_bundle_data" ]
  }
}