# Copyright 2014 The Chromium Authors # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//components/enterprise/buildflags/buildflags.gni") import("//components/safe_browsing/buildflags.gni") import("//extensions/buildflags/buildflags.gni") static_library("safe_browsing") { public = [ "chrome_controller_client.h", "metrics/bundled_settings_metrics_provider.h", "metrics/safe_browsing_metrics_provider.h", "url_checker_delegate_impl.h", ] sources = [ "chrome_controller_client.cc", "metrics/bundled_settings_metrics_provider.cc", "metrics/safe_browsing_metrics_provider.cc", "url_checker_delegate_impl.cc", ] configs += [ "//build/config/compiler:wexit_time_destructors" ] public_deps = [ "//chrome/browser:browser_public_dependencies", "//chrome/browser/metrics", "//chrome/browser/notifications", ] allow_circular_includes_from = [ # enterprise headers include deep_scanning_utils.h. "//chrome/browser/enterprise", ] deps = [ "//build:branding_buildflags", "//chrome/app:generated_resources", "//chrome/browser:browser_features", "//chrome/browser:browser_process", "//chrome/browser:file_util_service", "//chrome/browser/enterprise", "//chrome/browser/enterprise/connectors/reporting", "//chrome/browser/google", "//chrome/browser/history", "//chrome/browser/net", "//chrome/browser/optimization_guide", "//chrome/browser/password_manager", "//chrome/browser/password_manager/factories", "//chrome/browser/preloading/prefetch/no_state_prefetch", "//chrome/browser/profiles", "//chrome/browser/profiles:profile", "//chrome/browser/profiles:profile_io_data", "//chrome/browser/profiles:profile_manager", "//chrome/browser/push_messaging", "//chrome/browser/signin", "//chrome/browser/site_protection:utils", "//chrome/browser/sync", "//chrome/browser/ui/autofill", "//chrome/browser/ui/browser_window", "//chrome/common", "//chrome/common:constants", "//components/browser_sync", "//components/content_settings/browser/ui", "//components/enterprise", "//components/enterprise/buildflags", "//components/enterprise/common:strings", "//components/enterprise/obfuscation/core:enterprise_obfuscation", "//components/keyed_service/content", "//components/language/core/browser", "//components/no_state_prefetch/browser", "//components/no_state_prefetch/common", "//components/page_info", "//components/password_manager/core/browser", "//components/password_manager/core/browser:hash_password_manager", "//components/pref_registry", "//components/resources:components_resources_grit", "//components/safe_browsing:buildflags", "//components/safe_browsing/content/browser", "//components/safe_browsing/content/browser/notification_content_detection", "//components/safe_browsing/content/browser/triggers:suspicious_site_trigger", "//components/safe_browsing/content/browser/web_ui", "//components/safe_browsing/core/browser", "//components/safe_browsing/core/browser:download_check_result", "//components/safe_browsing/core/browser:referrer_chain_provider", "//components/safe_browsing/core/browser:safe_browsing_metrics_collector", "//components/safe_browsing/core/browser/db:database_manager", "//components/safe_browsing/core/browser/db:sb_local_database_manager", "//components/safe_browsing/core/browser/password_protection:password_protection_metrics_util", "//components/safe_browsing/core/browser/sync", "//components/safe_browsing/core/browser/web_ui:local_state_delegate", "//components/safe_browsing/core/common", "//components/safe_browsing/core/common:interfaces", "//components/safe_browsing/core/common:safe_browsing_policy_handler", "//components/search_engines", "//components/security_interstitials/content:security_interstitial_page", "//components/security_interstitials/core", "//components/sessions", "//components/signin/public/identity_manager", "//components/strings:components_strings", "//components/url_formatter", "//components/user_education/product_messaging", "//components/vector_icons", "//mojo/public/cpp/platform", "//mojo/public/cpp/system", "//services/metrics/public/cpp:ukm_builders", "//services/preferences/public/cpp", "//ui/base", ] if (enable_extensions) { deps += [ "//chrome/browser/ui/web_applications" ] if (is_chromeos) { deps += [ "//chromeos/ash/components/system" ] } } # Note: is_android is not equivalent to safe_browsing_mode == 2. # Sources and dependencies added to this block must not depend on anything # requiring safe_browsing_mode != 0. if (is_android) { deps += [ "//chrome/browser/password_manager/android:utils", "//chrome/browser/ui/android/safe_browsing", "//chrome/browser/ui/android/tab_model", "//components/safe_browsing/android:safe_browsing_api_handler", "//components/safe_browsing/android:safe_browsing_api_handler_util", ] # android/safe_browsing:safe_browsing includes # chrome/browser/safe_browsing/android/password_reuse_controller_android.h # (password_reuse_dialog_view_android.cc) which is owned by this target. allow_circular_includes_from += [ "//chrome/browser/ui/android/safe_browsing:safe_browsing" ] } if (!is_android) { public += [ "generated_safe_browsing_pref.h", "generated_security_settings_bundle_pref.h", ] sources += [ "generated_safe_browsing_pref.cc", "generated_security_settings_bundle_pref.cc", ] } if (is_chromeos) { deps += [ "//chrome/browser/ash/file_manager" ] allow_circular_includes_from += [ "//chrome/browser/ash/file_manager" ] } if (is_win || is_mac || is_linux || is_chromeos) { public += [ "security_settings_bundle_toast_helper.h" ] sources += [ "security_settings_bundle_toast_helper.cc" ] deps += [ "//chrome/browser/ui/browser_window", "//chrome/browser/ui/toasts", "//chrome/browser/ui/toasts/api:toasts", # Shows the safe_browsing views dialogs (toolkit_views only), which in # turn include this target's chrome_password_protection_service.h. "//chrome/browser/ui/views/safe_browsing", ] allow_circular_includes_from += [ "//chrome/browser/ui/views/safe_browsing" ] } if (safe_browsing_mode != 0) { # "Safe Browsing Basic" files used for safe browsing in full mode # (safe_browsing=1) and mobile (=2) public += [ "chrome_client_side_detection_host_delegate.h", "chrome_client_side_detection_service_delegate.h", "chrome_enterprise_url_lookup_service_factory.h", "chrome_password_protection_service.h", "chrome_password_protection_service_factory.h", "chrome_password_reuse_detection_manager_client.h", "chrome_ping_manager_factory.h", "chrome_safe_browsing_blocking_page_factory.h", "chrome_safe_browsing_hats_delegate.h", "chrome_safe_browsing_local_state_delegate.h", "chrome_safe_browsing_tab_observer_delegate.h", "chrome_ui_manager_delegate.h", "chrome_user_population_helper.h", "chrome_v4_protocol_config_provider.h", "client_side_detection_intelligent_scan_delegate_factory.h", "client_side_detection_intelligent_scan_delegate_util.h", "client_side_detection_service_factory.h", "cloud_content_scanning/cloud_binary_upload_service.h", "cloud_content_scanning/cloud_binary_upload_service_factory.h", "cloud_content_scanning/deep_scanning_utils.h", "cloud_content_scanning/file_analysis_request.h", "delayed_warning_navigation_throttle.h", "download_protection/check_client_download_request.h", "download_protection/check_client_download_request_base.h", "download_protection/check_file_system_access_write_request.h", "download_protection/deep_scanning_metadata.h", "download_protection/deep_scanning_request.h", "download_protection/download_item_metadata.h", "download_protection/download_protection_delegate.h", "download_protection/download_protection_observer.h", "download_protection/download_protection_service.h", "download_protection/download_protection_util.h", "download_protection/download_request_maker.h", "download_protection/download_url_sb_client.h", "download_protection/file_analyzer.h", "download_protection/file_system_access_metadata.h", "external_app_redirect_checking.h", "gemini_antiscam_protection/gemini_antiscam_protection_service.h", "gemini_antiscam_protection/gemini_antiscam_protection_service_factory.h", "network_context_service.h", "network_context_service_factory.h", "notification_content_detection/notification_content_detection_service_factory.h", "notification_content_detection/notification_content_detection_util.h", "notification_telemetry/notification_telemetry_service.h", "notification_telemetry/notification_telemetry_service_factory.h", "phishy_interaction_tracker.h", "safe_browsing_navigation_observer_manager_factory.h", "safe_browsing_pref_change_handler.h", "safe_browsing_service.h", "security_settings_bundle_pref_change_handler.h", "services_delegate.h", "tailored_security/chrome_tailored_security_service.h", "tailored_security/message_retry_handler.h", "tailored_security/tailored_security_service_factory.h", "tailored_security/tailored_security_url_observer.h", "telemetry/telemetry_service.h", "test_safe_browsing_blocking_page_quiet.h", "trigger_creator.h", "url_lookup_service_factory.h", "user_interaction_observer.h", "v5_get_hash_protocol_manager_factory.h", "v5_search_hashes_cache_factory.h", ] sources += [ "chrome_client_side_detection_host_delegate.cc", "chrome_client_side_detection_service_delegate.cc", "chrome_enterprise_url_lookup_service_factory.cc", "chrome_password_protection_service.cc", "chrome_password_protection_service_factory.cc", "chrome_password_reuse_detection_manager_client.cc", "chrome_ping_manager_factory.cc", "chrome_safe_browsing_blocking_page_factory.cc", "chrome_safe_browsing_hats_delegate.cc", "chrome_safe_browsing_local_state_delegate.cc", "chrome_safe_browsing_tab_observer_delegate.cc", "chrome_ui_manager_delegate.cc", "chrome_user_population_helper.cc", "chrome_v4_protocol_config_provider.cc", "client_side_detection_intelligent_scan_delegate_factory.cc", "client_side_detection_intelligent_scan_delegate_util.cc", "client_side_detection_service_factory.cc", "cloud_content_scanning/cloud_binary_upload_service.cc", "cloud_content_scanning/cloud_binary_upload_service_factory.cc", "cloud_content_scanning/deep_scanning_utils.cc", "cloud_content_scanning/file_analysis_request.cc", "delayed_warning_navigation_throttle.cc", "download_protection/check_client_download_request.cc", "download_protection/check_client_download_request_base.cc", "download_protection/check_file_system_access_write_request.cc", "download_protection/deep_scanning_metadata.cc", "download_protection/deep_scanning_request.cc", "download_protection/download_item_metadata.cc", "download_protection/download_protection_delegate.cc", "download_protection/download_protection_observer.cc", "download_protection/download_protection_service.cc", "download_protection/download_protection_util.cc", "download_protection/download_request_maker.cc", "download_protection/download_url_sb_client.cc", "download_protection/file_analyzer.cc", "download_protection/file_system_access_metadata.cc", "external_app_redirect_checking.cc", "gemini_antiscam_protection/gemini_antiscam_protection_service.cc", "gemini_antiscam_protection/gemini_antiscam_protection_service_factory.cc", "network_context_service.cc", "network_context_service_factory.cc", "notification_content_detection/notification_content_detection_service_factory.cc", "notification_content_detection/notification_content_detection_util.cc", "notification_telemetry/notification_telemetry_service.cc", "notification_telemetry/notification_telemetry_service_factory.cc", "phishy_interaction_tracker.cc", "safe_browsing_navigation_observer_manager_factory.cc", "safe_browsing_pref_change_handler.cc", "safe_browsing_service.cc", "security_settings_bundle_pref_change_handler.cc", "services_delegate.cc", "tailored_security/chrome_tailored_security_service.cc", "tailored_security/message_retry_handler.cc", "tailored_security/tailored_security_service_factory.cc", "tailored_security/tailored_security_url_observer.cc", "telemetry/telemetry_service.cc", "test_safe_browsing_blocking_page_quiet.cc", "trigger_creator.cc", "url_lookup_service_factory.cc", "user_interaction_observer.cc", "v5_get_hash_protocol_manager_factory.cc", "v5_search_hashes_cache_factory.cc", ] if (is_android) { public += [ "android/client_side_detection_intelligent_scan_delegate_android.h", ] sources += [ "android/client_side_detection_intelligent_scan_delegate_android.cc", ] } else { public += [ "client_side_detection_intelligent_scan_delegate_desktop.h" ] sources += [ "client_side_detection_intelligent_scan_delegate_desktop.cc" ] } deps += [ ":advanced_protection", ":metrics_collector", ":verdict_cache_manager_factory", "//build:branding_buildflags", "//build:chromeos_buildflags", "//chrome/browser:browser_process", "//chrome/browser/content_settings:content_settings_factory", "//chrome/browser/download", "//chrome/browser/permissions:permissions_proto", "//chrome/browser/profiles", "//chrome/browser/profiles:profile", "//chrome/browser/search_engines", "//chrome/browser/ui/browser_window", "//chrome/browser/ui/hats", "//chrome/browser/ui/safety_hub", "//chrome/common/safe_browsing:archive_analyzer_results", "//chrome/common/safe_browsing:binary_feature_extractor", "//chrome/common/safe_browsing:download_type_util", "//components/autofill/core/browser", "//components/content_extraction/content/browser", "//components/content_settings/core/browser", "//components/enterprise/connectors/core", "//components/enterprise/connectors/core:cloud_content_scanning", "//components/no_state_prefetch/browser", "//components/omnibox/browser", "//components/password_manager/content/browser", "//components/password_manager/core/browser/features:password_features", "//components/password_manager/core/browser/form_parsing", "//components/permissions", "//components/safe_browsing/content/browser", "//components/safe_browsing/content/browser:client_side_detection", "//components/safe_browsing/content/browser:client_side_detection_service", "//components/safe_browsing/content/browser:safe_browsing_blocking_page", "//components/safe_browsing/content/browser:safe_browsing_service", "//components/safe_browsing/content/browser/download:download_stats", "//components/safe_browsing/content/browser/notification_content_detection:notifications_global_cache_list", "//components/safe_browsing/content/browser/password_protection", "//components/safe_browsing/content/browser/triggers", "//components/safe_browsing/content/browser/triggers:ad_sampler_trigger", "//components/safe_browsing/content/browser/triggers:suspicious_site_trigger", "//components/safe_browsing/content/browser/triggers:trigger_throttler", "//components/safe_browsing/content/common:file_type_policies", "//components/safe_browsing/core/browser", "//components/safe_browsing/core/browser:intelligent_scan_delegate", "//components/safe_browsing/core/browser:referring_app_info", "//components/safe_browsing/core/browser:token_fetcher", "//components/safe_browsing/core/browser:verdict_cache_manager", "//components/safe_browsing/core/browser/db:allowlist_checker_client", "//components/safe_browsing/core/browser/db:v5_get_hash_protocol_manager", "//components/safe_browsing/core/browser/db:v5_search_hashes_cache", "//components/safe_browsing/core/browser/password_protection", "//components/safe_browsing/core/browser/password_protection:password_reuse_detection_manager_client", "//components/safe_browsing/core/browser/realtime:enterprise_url_lookup_service", "//components/safe_browsing/core/browser/realtime:policy_engine", "//components/safe_browsing/core/browser/realtime:url_lookup_service", "//components/safe_browsing/core/browser/sync", "//components/safe_browsing/core/browser/tailored_security_service", "//components/safe_browsing/core/common", "//components/safe_browsing/core/common:safe_browsing_prefs", "//components/safe_browsing/core/common/proto:crx_info_proto", "//components/safe_browsing/core/common/proto:csd_proto", "//components/safe_browsing/core/common/proto:realtimeapi_proto", "//components/signin/public/identity_manager", "//components/site_engagement/content", "//components/site_engagement/core/mojom:mojo_bindings", "//components/sync_user_events", "//components/unified_consent", "//components/url_matcher", "//components/variations/service", "//components/version_info", "//content/public/browser", "//services/preferences/public/mojom", ] public_deps += [ "//chrome/browser/security_events" ] if (safe_browsing_mode == 1) { # "Safe Browsing Full" files in addition to the "basic" ones to use for # full safe browsing. This has some in common with "mobile." public += [ "download_protection/download_feedback.h", "download_protection/download_feedback_service.h", "download_protection/download_protection_delegate_desktop.h", "download_protection/path_sanitizer.h", "extension_telemetry/activity_log_ingester.h", "extension_telemetry/cookies_get_all_signal.h", "extension_telemetry/cookies_get_all_signal_processor.h", "extension_telemetry/cookies_get_signal.h", "extension_telemetry/cookies_get_signal_processor.h", "extension_telemetry/declarative_net_request_action_signal.h", "extension_telemetry/declarative_net_request_action_signal_processor.h", "extension_telemetry/declarative_net_request_signal.h", "extension_telemetry/declarative_net_request_signal_processor.h", "extension_telemetry/dom_access_signal.h", "extension_telemetry/dom_access_signal_processor.h", "extension_telemetry/extension_js_callstacks.h", "extension_telemetry/extension_signal.h", "extension_telemetry/extension_signal_processor.h", "extension_telemetry/extension_signal_util.h", "extension_telemetry/extension_telemetry_config_manager.h", "extension_telemetry/extension_telemetry_file_processor.h", "extension_telemetry/extension_telemetry_persister.h", "extension_telemetry/extension_telemetry_service.h", "extension_telemetry/extension_telemetry_service_factory.h", "extension_telemetry/extension_telemetry_uploader.h", "extension_telemetry/extension_web_request_reporter_impl.h", "extension_telemetry/password_reuse_signal.h", "extension_telemetry/potential_password_theft_signal_processor.h", "extension_telemetry/remote_host_contacted_signal.h", "extension_telemetry/remote_host_contacted_signal_processor.h", "extension_telemetry/script_injection_signal.h", "extension_telemetry/script_injection_signal_processor.h", "extension_telemetry/search_hijacking_detector.h", "extension_telemetry/tabs_api_signal.h", "extension_telemetry/tabs_api_signal_processor.h", "extension_telemetry/tabs_execute_script_signal.h", "extension_telemetry/tabs_execute_script_signal_processor.h", "hash_realtime_service_factory.h", "incident_reporting/binary_integrity_analyzer.h", "incident_reporting/binary_integrity_incident.h", "incident_reporting/delayed_analysis_callback.h", "incident_reporting/delayed_callback_runner.h", "incident_reporting/download_metadata_manager.h", "incident_reporting/environment_data_collection.h", "incident_reporting/extension_data_collection.h", "incident_reporting/incident.h", "incident_reporting/incident_handler_util.h", "incident_reporting/incident_receiver.h", "incident_reporting/incident_report_uploader.h", "incident_reporting/incident_report_uploader_impl.h", "incident_reporting/incident_reporting_service.h", "incident_reporting/last_download_finder.h", "incident_reporting/platform_state_store.h", "incident_reporting/preference_validation_delegate.h", "incident_reporting/resource_request_incident.h", "incident_reporting/state_store.h", "incident_reporting/tracked_preference_incident.h", "ohttp_key_service_factory.h", "services_delegate_desktop.h", "suspicious_site_warnings/suspicious_site_ui.h", "tailored_security/notification_handler_desktop.h", ] sources += [ "download_protection/download_feedback.cc", "download_protection/download_feedback_service.cc", "download_protection/download_protection_delegate_desktop.cc", "download_protection/path_sanitizer.cc", "extension_telemetry/activity_log_ingester.cc", "extension_telemetry/cookies_get_all_signal.cc", "extension_telemetry/cookies_get_all_signal_processor.cc", "extension_telemetry/cookies_get_signal.cc", "extension_telemetry/cookies_get_signal_processor.cc", "extension_telemetry/declarative_net_request_action_signal.cc", "extension_telemetry/declarative_net_request_action_signal_processor.cc", "extension_telemetry/declarative_net_request_signal.cc", "extension_telemetry/declarative_net_request_signal_processor.cc", "extension_telemetry/dom_access_signal.cc", "extension_telemetry/dom_access_signal_processor.cc", "extension_telemetry/extension_js_callstacks.cc", "extension_telemetry/extension_signal_util.cc", "extension_telemetry/extension_telemetry_config_manager.cc", "extension_telemetry/extension_telemetry_file_processor.cc", "extension_telemetry/extension_telemetry_persister.cc", "extension_telemetry/extension_telemetry_service.cc", "extension_telemetry/extension_telemetry_service_factory.cc", "extension_telemetry/extension_telemetry_uploader.cc", "extension_telemetry/extension_web_request_reporter_impl.cc", "extension_telemetry/password_reuse_signal.cc", "extension_telemetry/potential_password_theft_signal_processor.cc", "extension_telemetry/remote_host_contacted_signal.cc", "extension_telemetry/remote_host_contacted_signal_processor.cc", "extension_telemetry/script_injection_signal.cc", "extension_telemetry/script_injection_signal_processor.cc", "extension_telemetry/search_hijacking_detector.cc", "extension_telemetry/tabs_api_signal.cc", "extension_telemetry/tabs_api_signal_processor.cc", "extension_telemetry/tabs_execute_script_signal.cc", "extension_telemetry/tabs_execute_script_signal_processor.cc", "hash_realtime_service_factory.cc", "incident_reporting/binary_integrity_analyzer.cc", "incident_reporting/binary_integrity_incident.cc", "incident_reporting/delayed_callback_runner.cc", "incident_reporting/download_metadata_manager.cc", "incident_reporting/environment_data_collection.cc", "incident_reporting/extension_data_collection.cc", "incident_reporting/incident.cc", "incident_reporting/incident_handler_util.cc", "incident_reporting/incident_report_uploader.cc", "incident_reporting/incident_report_uploader_impl.cc", "incident_reporting/incident_reporting_service.cc", "incident_reporting/last_download_finder.cc", "incident_reporting/platform_state_store.cc", "incident_reporting/preference_validation_delegate.cc", "incident_reporting/resource_request_incident.cc", "incident_reporting/state_store.cc", "incident_reporting/tracked_preference_incident.cc", "ohttp_key_service_factory.cc", "services_delegate_desktop.cc", "tailored_security/notification_handler_desktop.cc", ] if (is_mac) { public += [ "incident_reporting/binary_integrity_analyzer_mac.h", "signature_evaluator_mac.h", ] sources += [ "incident_reporting/binary_integrity_analyzer_mac.cc", "signature_evaluator_mac.mm", ] } else if (is_win) { public += [ "incident_reporting/binary_integrity_analyzer_win.h", "incident_reporting/environment_data_collection_win.h", "incident_reporting/module_integrity_verifier_win.h", ] sources += [ "incident_reporting/binary_integrity_analyzer_win.cc", "incident_reporting/environment_data_collection_win.cc", "incident_reporting/module_integrity_verifier_win.cc", "incident_reporting/platform_state_store_win.cc", ] deps += [ "//chrome/browser/install_verification" ] } deps += [ ":advanced_protection", ":verdict_cache_manager_factory", "//build:branding_buildflags", "//build:chromeos_buildflags", "//chrome/app/vector_icons", "//chrome/browser/safe_browsing/incident_reporting:state_store_data_proto", "//chrome/browser/ui/tabs:tab_strip", "//chrome/common", "//chrome/common/extensions", "//chrome/services/file_util/public/cpp", "//components/content_settings/core/browser", "//components/enterprise/connectors/core:cloud_content_scanning", "//components/file_access", "//components/gcm_driver", "//components/gcm_driver/instance_id", "//components/keyed_service/content", "//components/language/core/common", "//components/policy/core/browser", "//components/policy/core/common:common_constants", "//components/prefs", "//components/safe_browsing/content/common:interfaces", "//components/safe_browsing/core/browser:suspicious_site_warning_allowlist", "//components/safe_browsing/core/browser:verdict_cache_manager", "//components/safe_browsing/core/browser/db", "//components/safe_browsing/core/browser/db:sb_store", "//components/safe_browsing/core/browser/hashprefix_realtime:hash_realtime_service", "//components/safe_browsing/core/browser/realtime:policy_engine", "//components/safe_browsing/core/common/hashprefix_realtime:hash_realtime_utils", "//components/safe_browsing/core/common/proto:client_model_proto", "//components/safe_browsing/core/common/proto:csd_proto", "//components/security_interstitials/content:security_interstitial_page", "//components/security_interstitials/core:unsafe_resource", "//components/sync", "//content/public/browser", "//extensions/browser", "//net", "//services/network/public/cpp", "//third_party/abseil-cpp:absl", ] if (is_mac) { deps += [ "//chrome/common/safe_browsing:disk_image_type_sniffer_mac" ] } else if (is_win) { deps += [ "//chrome/common:version_header" ] } if (is_chromeos) { deps += [ "//ash/constants", "//chromeos/ash/components/browser_context_helper", "//chromeos/components/mgs", ] } if (!is_android) { deps += [ "//chrome/browser/ui:chrome_pages", "//chrome/browser/user_education", ] } if (!is_android && !is_chromeos) { deps += [ "//chrome/browser/download/bubble" ] } } else if (safe_browsing_mode == 2) { public += [ "android/download_protection_metrics_data.h", "android/notification_content_detection_manager_android.h", "android/password_reuse_controller_android.h", "android/safe_browsing_referring_app_bridge_android.h", "android/safe_browsing_settings_navigation_android.h", "android/services_delegate_android.h", "android/suspicious_site_controller_android.h", "download_protection/download_protection_delegate_android.h", "download_protection/rate_limiting_key_manager.h", "tailored_security/consented_message_android.h", "tailored_security/unconsented_message_android.h", "telemetry/android/android_telemetry_service.h", ] sources += [ "android/download_protection_metrics_data.cc", "android/notification_content_detection_manager_android.cc", "android/password_reuse_controller_android.cc", "android/safe_browsing_referring_app_bridge_android.cc", "android/safe_browsing_settings_navigation_android.cc", "android/services_delegate_android.cc", "android/suspicious_site_controller_android.cc", "download_protection/download_protection_delegate_android.cc", "download_protection/rate_limiting_key_manager.cc", "tailored_security/consented_message_android.cc", "tailored_security/unconsented_message_android.cc", "telemetry/android/android_telemetry_service.cc", ] deps += [ "//chrome/android:chrome_jni_headers", "//chrome/app/vector_icons", "//chrome/browser/safe_browsing/android", "//chrome/browser/ui/android/hats", "//chrome/browser/ui/android/tab_model", "//components/messages/android", "//components/safe_browsing:buildflags", "//components/safe_browsing/android:remote_database_manager", "//components/safe_browsing/android:safe_browsing_mobile", "//components/safe_browsing/core/browser:suspicious_site_warning_allowlist", "//content/public/browser", "//google_apis/common:request_util", "//ui/android", # TODO(crbug.com/41437292): Use //chrome/browser after fixing cyclic # dependency. "//chrome/browser/page_info:page_info_buildflags", ] } } } source_set("verdict_cache_manager_factory") { sources = [ "verdict_cache_manager_factory.cc", "verdict_cache_manager_factory.h", ] configs += [ "//build/config/compiler:wexit_time_destructors" ] deps = [ "//chrome/browser:browser_process", "//chrome/browser/content_settings:content_settings_factory", "//chrome/browser/history", "//chrome/browser/profiles", "//chrome/browser/profiles:profile", "//chrome/browser/sync", "//chrome/common", "//components/content_settings/core/browser", "//components/history/core/browser", "//components/keyed_service/content", "//components/prefs", "//components/safe_browsing/core/browser:verdict_cache_manager", "//components/safe_browsing/core/browser/sync", "//content/public/browser", ] } static_library("advanced_protection") { sources = [ "advanced_protection_status_manager.cc", "advanced_protection_status_manager.h", "advanced_protection_status_manager_factory.cc", "advanced_protection_status_manager_factory.h", "application_advanced_protection_status_detector.cc", "application_advanced_protection_status_detector.h", ] configs += [ "//build/config/compiler:wexit_time_destructors" ] deps = [ "//chrome/browser:browser_process", "//chrome/browser/profiles", "//chrome/browser/profiles:profile", "//chrome/browser/profiles:profile_manager", "//chrome/browser/signin", "//components/keyed_service/content", "//components/prefs", "//components/safe_browsing/core/common", "//components/safe_browsing/core/common:safe_browsing_prefs", "//components/signin/public/identity_manager", "//content/public/browser", ] if (is_android) { sources += [ "advanced_protection_status_manager_android.cc", "advanced_protection_status_manager_android.h", ] deps += [ "android:jni_headers" ] } else { sources += [ "advanced_protection_status_manager_desktop.cc", "advanced_protection_status_manager_desktop.h", ] } } source_set("metrics_collector") { sources = [ "safe_browsing_metrics_collector_factory.cc", "safe_browsing_metrics_collector_factory.h", ] configs += [ "//build/config/compiler:wexit_time_destructors" ] deps = [ "//chrome/browser:browser_process", "//chrome/browser/profiles:profile", "//chrome/common", "//components/keyed_service/content", "//components/prefs", "//components/safe_browsing/content/browser", "//components/safe_browsing/core/browser:safe_browsing_metrics_collector", "//components/safe_browsing/core/common", "//components/safe_browsing/core/common:safe_browsing_prefs", "//content/public/browser", ] } source_set("unit_tests") { testonly = true # Some of these tests declare file-scope objects with non-trivial destructors # (e.g. client_side_detection_host_unittest.cc). configs += [ "//build/config/compiler:no_exit_time_destructors" ] sources = [ "advanced_protection_status_manager_factory_unittest.cc", "advanced_protection_status_manager_unittest.cc", "application_advanced_protection_status_detector_unittest.cc", "gemini_antiscam_protection/gemini_antiscam_protection_service_factory_unittest.cc", "metrics/bundled_settings_metrics_provider_unittest.cc", "notification_content_detection/notification_content_detection_service_factory_unittest.cc", "notification_telemetry/notification_telemetry_service_factory_unittest.cc", "notification_telemetry/notification_telemetry_service_unittest.cc", ] deps = [ ":safe_browsing", "//chrome/browser/content_settings:content_settings_factory", "//chrome/browser/safe_browsing:advanced_protection", "//chrome/browser/site_protection:utils", "//chrome/test:test_support", "//components/content_settings/core/browser", "//components/content_settings/core/common", "//components/safe_browsing/core/common", "//components/safe_browsing/core/common:safe_browsing_prefs", "//components/signin/public/identity_manager:test_support", "//components/sync_preferences:test_support", "//content/public/common", "//content/test:test_support", "//testing/gtest", ] if (safe_browsing_mode != 0) { sources += [ "chrome_password_protection_service_unittest.cc", "chrome_safe_browsing_hats_delegate_unittest.cc", "chrome_ui_manager_delegate_unittest.cc", "chrome_user_population_helper_unittest.cc", "client_side_detection_host_unittest.cc", "download_protection/download_item_metadata_unittest.cc", "download_protection/download_protection_service_unittest.cc", "download_protection/download_protection_unittest_util.cc", "download_protection/download_protection_unittest_util.h", "download_protection/download_protection_util_unittest.cc", "download_protection/download_request_maker_unittest.cc", "download_protection/file_analyzer_unittest.cc", "download_protection/file_system_access_metadata_unittest.cc", "gemini_antiscam_protection/gemini_antiscam_protection_service_unittest.cc", "notification_content_detection/notification_content_detection_util_unittest.cc", "threat_details_unittest.cc", ] deps += [ "//chrome/browser/enterprise/connectors/test:test_support", "//chrome/browser/history", "//chrome/browser/optimization_guide", "//chrome/browser/optimization_guide:test_support", "//chrome/browser/password_manager/factories", "//chrome/browser/policy:test_support", "//chrome/browser/safe_browsing:verdict_cache_manager_factory", "//chrome/browser/sync", "//chrome/common/safe_browsing:archive_analyzer_results", "//chrome/common/safe_browsing:binary_feature_extractor", "//chrome/common/safe_browsing:mock_binary_feature_extractor", "//components/autofill/content/browser:test_support", "//components/enterprise/connectors/core:test_support", "//components/enterprise/obfuscation/core:enterprise_obfuscation", "//components/file_access:test_support", "//components/optimization_guide/core:model_execution_test_support", "//components/safe_browsing/content/browser", "//components/safe_browsing/content/browser:client_side_detection_images_cache", "//components/safe_browsing/content/browser:client_side_detection_service", "//components/safe_browsing/content/browser:safe_browsing_blocking_page", "//components/safe_browsing/content/browser:safe_browsing_service", "//components/safe_browsing/content/browser/notification_content_detection", "//components/safe_browsing/content/browser/notification_content_detection:notifications_global_cache_list", "//components/safe_browsing/content/browser/notification_content_detection:test_utils", "//components/safe_browsing/content/browser/password_protection", "//components/safe_browsing/content/browser/web_ui", "//components/safe_browsing/content/common:file_type_policies", "//components/safe_browsing/content/common:file_type_policies_test_support", "//components/safe_browsing/content/common:interfaces", "//components/safe_browsing/core/browser", "//components/safe_browsing/core/browser:client_side_detection_service_base", "//components/safe_browsing/core/browser:intelligent_scan_delegate", "//components/safe_browsing/core/browser:referring_app_info", "//components/safe_browsing/core/browser:token_fetcher", "//components/safe_browsing/core/browser:token_fetcher_testing_helper", "//components/safe_browsing/core/browser:verdict_cache_manager", "//components/safe_browsing/core/browser/db:v5_get_hash_protocol_manager", "//components/safe_browsing/core/browser/sync", "//components/safe_browsing/core/common/proto:csd_proto", "//components/ukm:test_support", "//third_party/zlib/google:zip", ] if (is_android) { deps += [ "//chrome/browser/password_manager/android:unit_tests" ] } if (enterprise_cloud_content_analysis) { sources += [ "chrome_enterprise_url_lookup_service_factory_unittest.cc", "chrome_enterprise_url_lookup_service_unittest.cc", ] deps += [ "//components/safe_browsing/core/browser/realtime:enterprise_url_lookup_service" ] } } if (safe_browsing_mode == 0) { # The notification-service factory unit tests above are unconditional, but # the optimization_guide deps they need can't be added to the base deps # without forming a //chrome/browser dependency cycle on safe_browsing_mode # != 0 (safe_browsing is reachable from the browser monolith there). The # mode != 0 block already supplies these deps for modes 1/2; supply them # here for mode 0 (e.g. android-cast). deps += [ "//chrome/browser/optimization_guide", "//chrome/browser/optimization_guide:test_support", "//components/safe_browsing/content/browser/notification_content_detection:notifications_global_cache_list", "//components/safe_browsing/content/browser/notification_content_detection:test_utils", ] } if (safe_browsing_mode == 1) { sources += [ "advanced_protection_status_manager_desktop_unittest.cc", "chrome_password_reuse_detection_manager_client_unittest.cc", "chrome_ping_manager_factory_unittest.cc", "client_side_detection_intelligent_scan_delegate_desktop_unittest.cc", "client_side_detection_intelligent_scan_delegate_factory_unittest.cc", "client_side_detection_service_factory_unittest.cc", "client_side_detection_service_unittest.cc", "cloud_content_scanning/cloud_binary_upload_service_unittest.cc", "cloud_content_scanning/deep_scanning_utils_unittest.cc", "cloud_content_scanning/file_analysis_request_unittest.cc", "download_protection/download_feedback_service_unittest.cc", "download_protection/download_feedback_unittest.cc", "download_protection/path_sanitizer_unittest.cc", "extension_telemetry/activity_log_ingester_unittest.cc", "extension_telemetry/cookies_get_all_signal_processor_unittest.cc", "extension_telemetry/cookies_get_all_signal_unittest.cc", "extension_telemetry/cookies_get_signal_processor_unittest.cc", "extension_telemetry/cookies_get_signal_unittest.cc", "extension_telemetry/declarative_net_request_action_signal_processor_unittest.cc", "extension_telemetry/declarative_net_request_action_signal_unittest.cc", "extension_telemetry/declarative_net_request_signal_processor_unittest.cc", "extension_telemetry/dom_access_signal_processor_unittest.cc", "extension_telemetry/dom_access_signal_unittest.cc", "extension_telemetry/extension_js_callstacks_unittest.cc", "extension_telemetry/extension_telemetry_config_manager_unittest.cc", "extension_telemetry/extension_telemetry_file_processor_unittest.cc", "extension_telemetry/extension_telemetry_persister_unittest.cc", "extension_telemetry/extension_telemetry_service_unittest.cc", "extension_telemetry/extension_telemetry_uploader_unittest.cc", "extension_telemetry/potential_password_theft_signal_processor_unittest.cc", "extension_telemetry/remote_host_contacted_signal_processor_unittest.cc", "extension_telemetry/remote_host_contacted_signal_unittest.cc", "extension_telemetry/script_injection_signal_processor_unittest.cc", "extension_telemetry/script_injection_signal_unittest.cc", "extension_telemetry/search_hijacking_detector_unittest.cc", "extension_telemetry/tabs_api_signal_processor_unittest.cc", "extension_telemetry/tabs_api_signal_unittest.cc", "extension_telemetry/tabs_execute_script_signal_processor_unittest.cc", "external_app_redirect_checking_unittest.cc", "hash_realtime_service_factory_unittest.cc", "incident_reporting/binary_integrity_incident_unittest.cc", "incident_reporting/delayed_callback_runner_unittest.cc", "incident_reporting/download_metadata_manager_unittest.cc", "incident_reporting/extension_data_collection_unittest.cc", "incident_reporting/incident_report_uploader_impl_unittest.cc", "incident_reporting/incident_reporting_service_unittest.cc", "incident_reporting/last_download_finder_unittest.cc", "incident_reporting/mock_incident_receiver.cc", "incident_reporting/mock_incident_receiver.h", "incident_reporting/platform_state_store_unittest.cc", "incident_reporting/preference_validation_delegate_unittest.cc", "incident_reporting/state_store_unittest.cc", "incident_reporting/tracked_preference_incident_unittest.cc", "ohttp_key_service_factory_unittest.cc", "phishy_interaction_tracker_unittest.cc", "safe_browsing_service_unittest.cc", "suspicious_site_warnings/suspicious_site_controller_desktop_unittest.cc", "tailored_security/chrome_tailored_security_service_unittest.cc", "tailored_security/message_retry_handler_unittest.cc", "tailored_security/tailored_security_url_observer_unittest.cc", "verdict_cache_manager_factory_unittest.cc", ] deps += [ "//chrome/browser/content_settings", "//chrome/browser/enterprise", "//chrome/browser/enterprise/connectors/test:test_support", "//chrome/browser/prefs", "//chrome/browser/safe_browsing:test_support", "//chrome/browser/safe_browsing/incident_reporting:state_store_data_proto", "//chrome/browser/safe_browsing/suspicious_site_warnings", "//chrome/browser/search_engines", "//chrome/browser/ui/browser_window", "//components/enterprise/common/proto:connectors_proto", "//components/enterprise/connectors/core", "//components/enterprise/obfuscation/core:enterprise_obfuscation", "//components/history/content/browser", "//components/optimization_guide/core:test_support", "//components/safe_browsing/content/browser/password_protection", "//components/safe_browsing/content/browser/password_protection:mock_password_protection", "//components/safe_browsing/core/browser", "//components/safe_browsing/core/browser:suspicious_site_warning_allowlist", "//components/safe_browsing/core/browser:token_fetcher", "//components/safe_browsing/core/browser:token_fetcher_testing_helper", "//components/safe_browsing/core/common:safe_browsing_policy_handler", "//components/safe_browsing/core/common/hashprefix_realtime:hash_realtime_utils", "//components/safe_browsing/core/common/proto:csd_proto", "//extensions/browser", "//extensions/common", ] if (is_chromeos) { deps += [ "//chrome/browser/ash/login/users" ] } if (is_mac) { sources += [ "incident_reporting/binary_integrity_analyzer_mac_unittest.cc", "signature_evaluator_mac_unittest.cc", ] deps += [ "//chrome/common:constants" ] } if (is_win) { sources += [ "incident_reporting/binary_integrity_analyzer_win_unittest.cc", "incident_reporting/environment_data_collection_win_unittest.cc", "incident_reporting/module_integrity_unittest_util_win.cc", "incident_reporting/module_integrity_unittest_util_win.h", "incident_reporting/module_integrity_verifier_win_unittest.cc", "incident_reporting/platform_state_store_win_unittest.cc", ] data_deps = [ "//chrome/browser/safe_browsing/incident_reporting/verifier_test:verifier_test_dll_1", "//chrome/browser/safe_browsing/incident_reporting/verifier_test:verifier_test_dll_2", ] } } if (is_android) { deps += [ "android:test_support" ] } if (safe_browsing_mode == 2 && is_android) { sources += [ "android/client_side_detection_intelligent_scan_delegate_android_unittest.cc", "android/password_reuse_controller_android_unittest.cc", "android/suspicious_site_controller_android_unittest.cc", "download_protection/rate_limiting_key_manager_unittest.cc", "safe_browsing_pref_change_handler_android_unittest.cc", "tailored_security/chrome_tailored_security_service_android_unittest.cc", "tailored_security/consented_message_android_unittest.cc", "telemetry/android/android_telemetry_service_unittest.cc", ] deps += [ "//chrome/browser/ui/android/hats", "//chrome/browser/ui/android/tab_model:test_support", "//components/history/core/test", "//components/messages/android:test_support", "//components/safe_browsing/android:real_time_url_checks_allowlist", "//components/safe_browsing/android:safe_browsing_api_handler", "//components/safe_browsing/android:safe_browsing_api_handler_util", ] } if (enterprise_cloud_content_analysis || is_android) { sources += [ "download_protection/deep_scanning_request_unittest.cc" ] deps += [ "//chrome/browser/enterprise/connectors/reporting:unit_tests", "//chrome/browser/enterprise/connectors/test:test_support", "//chrome/browser/interstitials:unit_tests", "//components/enterprise/common/proto:browser_events_proto", "//components/enterprise/common/proto:chrome_reporting_entity", "//components/enterprise/connectors/core", "//components/enterprise/connectors/core:cloud_content_scanning", "//components/enterprise/connectors/core:test_support", "//components/enterprise/obfuscation/core:enterprise_obfuscation", ] if (is_chromeos) { deps += [ "//chromeos/ash/components/system" ] } } if (is_win || is_mac || is_linux || is_chromeos) { sources += [ "generated_safe_browsing_pref_unittest.cc", "generated_security_settings_bundle_pref_unittest.cc", "safe_browsing_pref_change_handler_unittest.cc", "security_settings_bundle_pref_change_handler_unittest.cc", "security_settings_bundle_toast_helper_unittest.cc", ] deps += [ "//chrome/browser/sync", "//chrome/browser/ui/tabs:test_support", "//chrome/browser/ui/toasts", "//testing/gmock", ] } } source_set("test_support") { testonly = true sources = [ "notification_content_detection/mock_notification_content_detection_service.cc", "notification_content_detection/mock_notification_content_detection_service.h", ] deps = [ "//chrome/browser/profiles:profile", "//components/keyed_service/core", "//components/optimization_guide/core:test_support", "//components/safe_browsing/content/browser/notification_content_detection", "//components/safe_browsing/content/browser/notification_content_detection:test_utils", "//content/public/browser", "//testing/gmock", ] if (safe_browsing_mode != 0) { sources += [ "cloud_content_scanning/test_binary_upload_service.cc", "cloud_content_scanning/test_binary_upload_service.h", "test_safe_browsing_service.cc", "test_safe_browsing_service.h", ] if (!is_android) { sources += [ "test_safe_browsing_navigation_observer_manager.cc", "test_safe_browsing_navigation_observer_manager.h", ] } deps += [ ":safe_browsing", "//chrome/browser/content_settings:content_settings_factory", "//chrome/browser/ui:test_support", "//chrome/browser/ui/browser_window", "//chrome/common", "//components/enterprise/common/proto:connectors_proto", "//components/enterprise/connectors/core:cloud_content_scanning", "//components/safe_browsing:buildflags", "//components/safe_browsing/content/browser", "//components/safe_browsing/content/browser:safe_browsing_blocking_page", "//components/safe_browsing/content/browser:safe_browsing_service", "//components/safe_browsing/core/browser/db:database_manager", "//components/safe_browsing/core/browser/db:test_database_manager", "//components/safe_browsing/core/browser/db:v4_protocol_config", "//components/safe_browsing/core/browser/db:v4_protocol_manager_util", "//components/safe_browsing/core/common/proto:crx_info_proto", "//services/network:test_support", "//testing/gtest", ] } if (is_android) { deps += [ "android:test_support", "android:test_support_java", ] } if (enable_extensions) { sources += [ "test_extension_event_observer.cc", "test_extension_event_observer.h", ] deps += [ "//chrome/browser/extensions", "//chrome/common/extensions/api", "//extensions:test_support", ] } } source_set("test_database_helper") { testonly = true sources = [ "test_safe_browsing_database_helper.cc", "test_safe_browsing_database_helper.h", ] public_deps = [ "//base", "//components/safe_browsing/core/browser/db:util", "//components/safe_browsing/core/common/proto:safebrowsingv5_proto", ] deps = [ ":safe_browsing", ":test_support", "//components/safe_browsing/core/browser/db:sb_database", "//components/safe_browsing/core/browser/db:v4_protocol_manager_util", "//components/safe_browsing/core/browser/db:v4_test_util", "//components/safe_browsing/core/browser/db:v5_search_hashes_cache", "//components/safe_browsing/core/common:features", "//components/security_interstitials/core:unsafe_resource", "//content/test:test_support", ] } if (safe_browsing_mode != 0) { # Separate leaf target because this browser-test helper depends on # //chrome/test:test_support, which reaches safe_browsing:test_support via # //chrome/browser:test_support and would form a cycle. source_set("blocking_page_platform_test_support") { testonly = true defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] public = [ "safe_browsing_blocking_page_platform_test_helper.h" ] sources = [ "safe_browsing_blocking_page_platform_test_helper.cc" ] public_deps = [ ":safe_browsing", "//chrome/test:test_support", "//components/safe_browsing:buildflags", "//components/safe_browsing/content/browser", ] if (is_android) { public_deps += [ "//chrome/test:test_support_ui_android" ] } else { public_deps += [ "//chrome/test:test_support_ui" ] } deps = [ "//base", "//chrome/browser/content_settings:content_settings_factory", "//chrome/browser/enterprise", "//chrome/browser/history", "//chrome/browser/policy:test_support", "//chrome/browser/safe_browsing:metrics_collector", "//chrome/browser/safe_browsing:verdict_cache_manager_factory", "//components/safe_browsing/core/browser:verdict_cache_manager", "//components/security_interstitials/content:security_interstitial_page", "//content/test:test_support", ] # mock_trust_safety_sentiment_service.h is only included under # BUILDFLAG(FULL_SAFE_BROWSING) (safe_browsing_mode == 1), and # ui/hats:test_support only exists on non-Android. if (safe_browsing_mode == 1) { public_deps += [ "//chrome/browser/ui/hats:test_support" ] } } } source_set("browser_tests") { testonly = true defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] sources = [] deps = [] if (enable_extensions) { sources += [ "extension_telemetry/extension_telemetry_service_browsertest.cc" ] deps += [ ":safe_browsing", "//base", "//base/test:test_support", "//chrome/browser/enterprise/connectors/test:test_support", "//chrome/browser/extensions", "//chrome/browser/extensions:test_support", "//chrome/browser/profiles:profile", "//chrome/browser/search_engines", "//chrome/browser/ui/browser_window", "//chrome/common:constants", "//chrome/test:test_support", "//chrome/test:test_support_ui", "//components/enterprise/connectors/core", "//components/omnibox/browser", "//components/safe_browsing/content/browser/web_ui", "//components/safe_browsing/core/common", "//components/safe_browsing/core/common:safe_browsing_prefs", "//components/safe_browsing/core/common/proto:csd_proto", "//components/search_engines", "//content/public/browser", "//content/test:browsertest_support", "//extensions:test_support", "//extensions/browser:test_support", "//extensions/common", "//extensions/common/api", "//net:test_support", "//testing/gtest", ] } }