chromium/ios/chrome/browser/safe_browsing/model/BUILD.gn

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

import("//ios/build/config.gni")
import("//ios/features.gni")
import("//ios/web/public/js_messaging/optimize_ts.gni")

source_set("model") {
  sources = [
    "chrome_password_protection_service.h",
    "chrome_password_protection_service.mm",
    "chrome_password_protection_service_factory.h",
    "chrome_password_protection_service_factory.mm",
    "hash_realtime_service_factory.h",
    "hash_realtime_service_factory.mm",
    "input_event_observer.h",
    "ohttp_key_service_factory.h",
    "ohttp_key_service_factory.mm",
    "password_protection_java_script_feature.h",
    "password_protection_java_script_feature.mm",
    "real_time_url_lookup_service_factory.h",
    "real_time_url_lookup_service_factory.mm",
    "safe_browsing_blocking_page.h",
    "safe_browsing_blocking_page.mm",
    "safe_browsing_client_factory.h",
    "safe_browsing_client_factory.mm",
    "safe_browsing_client_impl.h",
    "safe_browsing_client_impl.mm",
    "safe_browsing_metrics_collector_factory.h",
    "safe_browsing_metrics_collector_factory.mm",
    "user_population_helper.h",
    "user_population_helper.mm",
    "verdict_cache_manager_factory.h",
    "verdict_cache_manager_factory.mm",
  ]

  deps = [
    ":password_protection_ts",
    "//base",
    "//build:branding_buildflags",
    "//components/feature_engagement/public",
    "//components/keyed_service/core",
    "//components/keyed_service/ios",
    "//components/omnibox/common",
    "//components/password_manager/core/browser",
    "//components/prefs",
    "//components/safe_browsing/core/browser",
    "//components/safe_browsing/core/browser:safe_browsing_metrics_collector",
    "//components/safe_browsing/core/browser:verdict_cache_manager",
    "//components/safe_browsing/core/browser/db:v4_protocol_manager_util",
    "//components/safe_browsing/core/browser/hashprefix_realtime:hash_realtime_service",
    "//components/safe_browsing/core/browser/password_protection:password_protection_metrics_util",
    "//components/safe_browsing/core/browser/realtime:url_lookup_service",
    "//components/safe_browsing/core/browser/sync",
    "//components/safe_browsing/core/common",
    "//components/safe_browsing/core/common:safe_browsing_prefs",
    "//components/safe_browsing/core/common/hashprefix_realtime:hash_realtime_utils",
    "//components/safe_browsing/core/common/proto:csd_proto",
    "//components/safe_browsing/ios/browser:allow_list",
    "//components/safe_browsing/ios/browser/password_protection",
    "//components/security_interstitials/core",
    "//components/security_interstitials/core:unsafe_resource",
    "//components/strings",
    "//components/sync_user_events",
    "//components/variations/service",
    "//ios/chrome/browser/content_settings/model",
    "//ios/chrome/browser/feature_engagement/model",
    "//ios/chrome/browser/history/model",
    "//ios/chrome/browser/net/model",
    "//ios/chrome/browser/passwords/model:store_factory",
    "//ios/chrome/browser/policy/model",
    "//ios/chrome/browser/prerender/model",
    "//ios/chrome/browser/safe_browsing/model/tailored_security",
    "//ios/chrome/browser/shared/model/application_context",
    "//ios/chrome/browser/shared/model/browser_state",
    "//ios/chrome/browser/shared/model/profile",
    "//ios/chrome/browser/signin/model",
    "//ios/chrome/browser/sync/model",
    "//ios/components/security_interstitials",
    "//ios/components/security_interstitials/safe_browsing",
    "//ios/components/security_interstitials/safe_browsing:util",
    "//ios/web/common:user_agent",
    "//ios/web/public",
    "//ios/web/public/init",
    "//ios/web/public/js_messaging",
    "//net",
    "//ui/base",
  ]
}

optimize_ts("password_protection_ts") {
  visibility = [ ":model" ]

  sources = [ "resources/password_protection.ts" ]
  deps = [ "//ios/web/public/js_messaging:util_scripts" ]
}

source_set("features") {
  sources = [
    "features.h",
    "features.mm",
  ]

  deps = [
    "//base",
    "//components/password_manager/core/common:features",
  ]
}

source_set("infobar_delegate") {
  sources = [
    "enhanced_safe_browsing_infobar_delegate.h",
    "enhanced_safe_browsing_infobar_delegate.mm",
  ]

  deps = [
    "//components/infobars/core",
    "//ios/chrome/browser/shared/public/commands",
  ]
}

source_set("eg2_tests") {
  configs += [ "//build/config/ios:xctest_config" ]
  testonly = true
  sources = [
    "password_protection_egtest.mm",
    "safe_browsing_egtest.mm",
  ]
  deps = [
    "//base",
    "//components/password_manager/core/common:features",
    "//components/safe_browsing/core/common",
    "//components/safe_browsing/core/common:safe_browsing_prefs",
    "//components/strings",
    "//ios/chrome/app/strings",
    "//ios/chrome/browser/bookmarks/model:bookmark_storage_type",
    "//ios/chrome/browser/bookmarks/ui_bundled:eg_test_support+eg2",
    "//ios/chrome/browser/passwords/model:eg_test_support+eg2",
    "//ios/chrome/browser/passwords/ui_bundled:constants",
    "//ios/chrome/browser/ui/infobars/banners:public",
    "//ios/chrome/browser/ui/settings/privacy:privacy_constants",
    "//ios/chrome/test/earl_grey:eg_test_support+eg2",
    "//ios/testing/earl_grey:eg_test_support+eg2",
    "//ios/testing/earl_grey:launch_configuration",
    "//ios/web/common:features",
    "//ios/web/public/test:element_selector",
    "//ios/web/public/test/http_server",
    "//net:test_support",
    "//ui/base",
  ]
  frameworks = [ "UIKit.framework" ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "chrome_password_protection_service_unittest.mm",
    "hash_realtime_service_factory_unittest.mm",
    "ohttp_key_service_factory_unittest.mm",
    "real_time_url_lookup_service_factory_unittest.mm",
    "safe_browsing_blocking_page_unittest.mm",
    "safe_browsing_client_factory_unittest.mm",
    "safe_browsing_client_impl_unittest.mm",
    "verdict_cache_manager_factory_unittest.mm",
  ]

  deps = [
    ":model",
    "//base",
    "//base/test:test_support",
    "//components/keyed_service/core",
    "//components/password_manager/core/browser",
    "//components/password_manager/core/browser:test_support",
    "//components/prefs:test_support",
    "//components/safe_browsing/core/browser",
    "//components/safe_browsing/core/browser:token_fetcher",
    "//components/safe_browsing/core/browser:verdict_cache_manager",
    "//components/safe_browsing/core/browser/password_protection:password_protection_metrics_util",
    "//components/safe_browsing/core/browser/realtime:url_lookup_service",
    "//components/safe_browsing/core/common",
    "//components/safe_browsing/core/common:safe_browsing_prefs",
    "//components/safe_browsing/core/common/hashprefix_realtime:hash_realtime_utils",
    "//components/safe_browsing/core/common/proto:realtimeapi_proto",
    "//components/safe_browsing/ios/browser:allow_list",
    "//components/security_interstitials/core",
    "//components/security_interstitials/core:unsafe_resource",
    "//components/signin/public/identity_manager",
    "//components/signin/public/identity_manager:test_support",
    "//components/strings",
    "//components/sync_user_events:test_support",
    "//components/unified_consent",
    "//ios/chrome/browser/history/model",
    "//ios/chrome/browser/passwords/model",
    "//ios/chrome/browser/prerender/model",
    "//ios/chrome/browser/prerender/model:test_support",
    "//ios/chrome/browser/shared/model/profile/test",
    "//ios/chrome/browser/sync/model",
    "//ios/chrome/test:test_support",
    "//ios/components/security_interstitials/safe_browsing",
    "//ios/components/security_interstitials/safe_browsing:test_support",
    "//ios/web/public",
    "//ios/web/public/test",
    "//net:test_support",
    "//testing/gmock",
    "//testing/gtest",
    "//ui/base",
    "//url",
  ]
}