| # Copyright 2024 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//pdf/features.gni") |
| |
| assert(is_win || is_mac || is_linux || is_chromeos || is_android) |
| |
| source_set("hats") { |
| sources = [ |
| "hats_service.h", |
| "hats_service_factory.h", |
| "survey_config.h", |
| ] |
| public_deps = [ |
| "//base", |
| "//build:branding_buildflags", |
| "//chrome/browser/download", |
| "//chrome/browser/profiles:profile", |
| "//components/browsing_data/core", |
| "//components/compose:buildflags", |
| "//components/download/public/common:public", |
| "//components/keyed_service/core", |
| "//components/pref_registry", |
| "//components/safe_browsing/core/browser/db:v4_protocol_manager_util", |
| "//components/safe_browsing/core/browser/password_protection:password_protection_metrics_util", |
| "//content/public/browser", |
| "//pdf:buildflags", |
| ] |
| |
| if (!is_android) { |
| sources += [ |
| "hats_helper.h", |
| "hats_service_desktop.h", |
| "trust_safety_sentiment_service.h", |
| "trust_safety_sentiment_service_factory.h", |
| ] |
| public_deps += [ "//chrome/browser/metrics/desktop_session_duration" ] |
| } else { |
| public_deps += [ "//components/messages/android" ] |
| } |
| } |
| |
| source_set("impl") { |
| sources = [ |
| "hats_service.cc", |
| "hats_service_factory.cc", |
| "survey_config.cc", |
| ] |
| deps = [] |
| |
| if (!is_android) { |
| sources += [ |
| "hats_helper.cc", |
| "hats_service_desktop.cc", |
| "trust_safety_sentiment_service.cc", |
| "trust_safety_sentiment_service_factory.cc", |
| ] |
| |
| deps += [ "//chrome/browser/ui/performance_controls" ] |
| } |
| deps += [ |
| ":hats", |
| "//chrome/browser:browser_process", |
| "//chrome/browser:global_features", |
| "//chrome/browser/content_settings:content_settings_factory", |
| "//chrome/browser/prefs", |
| "//chrome/browser/privacy_sandbox/incognito:incognito_features", |
| "//chrome/browser/profiles", |
| "//chrome/browser/signin", |
| "//chrome/browser/ui/safety_hub", |
| "//chrome/common", |
| "//chrome/common:channel_info", |
| "//chrome/common:chrome_features", |
| "//chrome/common:constants", |
| "//components/application_locale_storage", |
| "//components/autofill/core/common:features", |
| "//components/compose/core/browser:features", |
| "//components/content_settings/core/browser", |
| "//components/content_settings/core/browser:cookie_settings", |
| "//components/content_settings/core/common", |
| "//components/lens:features", |
| "//components/metrics_services_manager", |
| "//components/password_manager/core/common", |
| "//components/permissions", |
| "//components/permissions:permissions_common", |
| "//components/plus_addresses/core/browser:hats_utils", |
| "//components/plus_addresses/core/common:features", |
| "//components/policy/core/common:common_constants", |
| "//components/prefs", |
| "//components/privacy_sandbox:features", |
| "//components/privacy_sandbox:privacy_sandbox_prefs", |
| "//components/privacy_sandbox:tracking_protection_prefs", |
| "//components/safe_browsing/core/common:features", |
| "//components/safe_browsing/core/common:safe_browsing_prefs", |
| "//components/signin/public/base", |
| "//components/unified_consent", |
| "//components/variations/service", |
| "//components/version_info", |
| "//components/version_info:channel", |
| "//net", |
| |
| # `hats` includes some headers not componentized from //c/b/ui:ui, including |
| # performance_controls_hats_service.h, performance_controls_hats_service_factory.h, |
| # and site_settings_helper.h ... but without a circular dependency. |
| "//chrome/browser/ui", |
| ] |
| if (is_android) { |
| deps += [ |
| "//chrome/browser/flags:flags_android", |
| "//chrome/browser/ui/android/hats", |
| ] |
| } |
| if (enable_pdf_save_to_drive) { |
| deps += [ |
| "//pdf:buildflags", |
| "//pdf:features", |
| ] |
| } |
| public_deps = [ "//chrome/browser:browser_public_dependencies" ] |
| } |
| |
| if (!is_android) { |
| source_set("unit_tests") { |
| testonly = true |
| sources = [ |
| "hats_helper_unittest.cc", |
| "survey_config_unittest.cc", |
| "trust_safety_sentiment_service_factory_unittest.cc", |
| ] |
| |
| if (is_win || is_mac || is_linux) { |
| sources += [ "trust_safety_sentiment_service_unittest.cc" ] |
| } |
| |
| deps = [ |
| ":hats", |
| ":test_support", |
| "//base/test:test_support", |
| "//chrome/browser/content_settings:content_settings_factory", |
| "//chrome/browser/extensions", |
| "//chrome/common", |
| "//chrome/common:chrome_features", |
| "//chrome/test:test_support", |
| "//components/content_settings/core/test:test_support", |
| "//components/privacy_sandbox:tracking_protection_prefs", |
| "//components/signin/public/base", |
| "//components/unified_consent", |
| "//content/test:test_support", |
| ] |
| } |
| |
| source_set("test_support") { |
| testonly = true |
| sources = [ |
| "mock_hats_service.cc", |
| "mock_hats_service.h", |
| "mock_trust_safety_sentiment_service.cc", |
| "mock_trust_safety_sentiment_service.h", |
| ] |
| |
| deps = [ |
| ":hats", |
| "//testing/gmock", |
| ] |
| } |
| |
| source_set("browser_tests") { |
| testonly = true |
| defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] |
| sources = [ |
| "hats_service_browsertest.cc", |
| "trust_safety_sentiment_service_browsertest.cc", |
| ] |
| |
| deps = [ |
| ":hats", |
| ":test_support", |
| "//base", |
| "//base/test:test_support", |
| "//chrome/browser:browser_process", |
| "//chrome/browser/policy:test_support", |
| "//chrome/browser/prefs", |
| "//chrome/browser/ui/page_info", |
| "//chrome/browser/ui/views/page_info", |
| "//chrome/common", |
| "//chrome/common:chrome_features", |
| "//chrome/test:test_support", |
| "//chrome/test:test_support_ui", |
| "//components/autofill/core/common:features", |
| "//components/content_settings/core/common", |
| "//components/metrics_services_manager", |
| "//components/plus_addresses/core/browser:hats_utils", |
| "//components/plus_addresses/core/common:features", |
| "//components/policy:generated", |
| "//components/policy:policy_code_generate", |
| "//components/policy/core/common:common_constants", |
| "//components/variations", |
| "//components/variations/service", |
| "//components/version_info", |
| "//content/public/browser", |
| "//content/public/common", |
| "//content/test:test_support", |
| "//net:test_support", |
| ] |
| |
| # TODO(crbug.com/40031409): Fix code that adds exit-time destructors and |
| # enable the diagnostic by removing this line. |
| configs += [ "//build/config/compiler:no_exit_time_destructors" ] |
| } |
| } |