chromium/components/security_interstitials/core/BUILD.gn

# Copyright 2015 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 = [
    "bad_clock_ui.cc",
    "bad_clock_ui.h",
    "base_safe_browsing_error_ui.cc",
    "base_safe_browsing_error_ui.h",
    "common_string_util.cc",
    "common_string_util.h",
    "controller_client.cc",
    "controller_client.h",
    "https_only_mode_allowlist.cc",
    "https_only_mode_allowlist.h",
    "https_only_mode_enforcelist.cc",
    "https_only_mode_enforcelist.h",
    "https_only_mode_metrics.cc",
    "https_only_mode_metrics.h",
    "https_only_mode_ui_util.cc",
    "https_only_mode_ui_util.h",
    "metrics_helper.cc",
    "metrics_helper.h",
    "omnibox_https_upgrade_metrics.cc",
    "omnibox_https_upgrade_metrics.h",
    "pref_names.cc",
    "pref_names.h",
    "safe_browsing_loud_error_ui.cc",
    "safe_browsing_loud_error_ui.h",
    "safe_browsing_quiet_error_ui.cc",
    "safe_browsing_quiet_error_ui.h",
    "ssl_error_options_mask.cc",
    "ssl_error_options_mask.h",
    "ssl_error_ui.cc",
    "ssl_error_ui.h",
    "urls.cc",
    "urls.h",
  ]

  if (!is_ios) {
    sources += [
      "blocked_interception_ui.cc",
      "blocked_interception_ui.h",
      "https_only_mode_policy_handler.cc",
      "https_only_mode_policy_handler.h",
      "mitm_software_ui.cc",
      "mitm_software_ui.h",
    ]
  }

  deps = [
    "//base",
    "//base:i18n",
    "//components/content_settings/core/browser",
    "//components/feature_engagement/public",
    "//components/google/core/common",
    "//components/history/core/browser",
    "//components/metrics",
    "//components/policy/core/browser",
    "//components/policy/core/common",
    "//components/prefs",
    "//components/resources",
    "//components/safe_browsing/core/common:common",
    "//components/ssl_errors",
    "//components/strings",
    "//components/url_formatter",
    "//net",
    "//third_party/zlib/google:compression_utils",
    "//ui/base",
  ]

  public_deps = [ "//components/security_interstitials/core/common/mojom" ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]
}

static_library("unsafe_resource") {
  sources = [
    "unsafe_resource.cc",
    "unsafe_resource.h",
  ]

  deps = [
    "//base",
    "//components/safe_browsing/core/browser/db:hit_report",
    "//components/safe_browsing/core/browser/db:util",
    "//components/safe_browsing/core/common/proto:realtimeapi_proto",
    "//net",
    "//services/network/public/mojom",
  ]

  configs += [ "//build/config/compiler:wexit_time_destructors" ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "insecure_form_util_unittest.cc",
    "ssl_error_options_mask_unittest.cc",
  ]

  deps = [
    ":core",
    ":insecure_form_util",
    "//base",
    "//net",
    "//testing/gtest",
  ]
}

source_set("insecure_form_util") {
  sources = [
    "insecure_form_util.cc",
    "insecure_form_util.h",
  ]
  deps = [ "//services/network/public/cpp:cpp" ]
}