blob: 9b4ff3797af917c9aea22bacece34ea6ecfdaf21 [file] [log] [blame]
# 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("//build/config/android/rules.gni")
import("//third_party/jni_zero/jni_zero.gni")
generate_jni("jni_headers") {
sources = [
"java/src/org/chromium/chrome/browser/safety_hub/MagicStackBridge.java",
"java/src/org/chromium/chrome/browser/safety_hub/MagicStackEntry.java",
"java/src/org/chromium/chrome/browser/safety_hub/NotificationPermissionReviewBridge.java",
"java/src/org/chromium/chrome/browser/safety_hub/NotificationPermissions.java",
"java/src/org/chromium/chrome/browser/safety_hub/PermissionsData.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubHatsBridge.java",
"java/src/org/chromium/chrome/browser/safety_hub/UnsubscribedNotificationsNotificationManager.java",
"java/src/org/chromium/chrome/browser/safety_hub/UnusedSitePermissionsBridge.java",
]
}
java_cpp_enum("java_enum_srcjar") {
sources = [ "//chrome/browser/ui/safety_hub/revoked_permissions_result.h" ]
}
android_library("java") {
sources = [
"java/src/org/chromium/chrome/browser/safety_hub/MagicStackBridge.java",
"java/src/org/chromium/chrome/browser/safety_hub/MagicStackEntry.java",
"java/src/org/chromium/chrome/browser/safety_hub/NotificationPermissionReviewBridge.java",
"java/src/org/chromium/chrome/browser/safety_hub/NotificationPermissions.java",
"java/src/org/chromium/chrome/browser/safety_hub/PermissionsData.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubAccountPasswordsDataSource.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubAccountPasswordsModuleMediator.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubAccountPasswordsSignedOutModuleHelper.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubBaseFragment.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubBrowserStateModuleMediator.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubCompromisedPasswordsModuleHelper.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubExpandablePreference.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubExpandablePreferenceCategory.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubFetchService.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubFetchServiceFactory.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubFetchTask.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubFragment.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubHatsBridge.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubHatsHelper.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubLocalPasswordsDataSource.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubLocalPasswordsModuleMediator.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubMagicStackBuilder.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubMagicStackCoordinator.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubMagicStackMediator.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubMagicStackView.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubMagicStackViewBinder.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubMagicStackViewProperties.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubMetricUtils.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegate.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegateImpl.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleHelper.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleMediator.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleMediatorDelegate.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleProperties.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleViewBinder.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubNoCompromisedPasswordsModuleHelper.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubNoSavedPasswordsModuleHelper.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubNotificationsFragment.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubNotificationsModuleMediator.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubNotificationsPreference.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubPasswordsCheckingModuleHelper.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubPasswordsFetchService.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubPasswordsModuleMediator.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubPermissionsFragment.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubPermissionsPreference.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubPermissionsRevocationModuleMediator.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubReusedPasswordsModuleHelper.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubSafeBrowsingModuleMediator.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubSubpageFragment.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubUnavailableAccountCompromisedPasswordsModuleHelper.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubUnavailablePasswordsModuleHelper.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubUpdateCheckModuleMediator.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubUtils.java",
"java/src/org/chromium/chrome/browser/safety_hub/SafetyHubWeakPasswordsModuleHelper.java",
"java/src/org/chromium/chrome/browser/safety_hub/UnsubscribedNotificationsNotificationManager.java",
"java/src/org/chromium/chrome/browser/safety_hub/UnusedSitePermissionsBridge.java",
]
deps = [
":java_resources",
"//base:base_java",
"//build/android:build_java",
"//chrome/browser/android/lifecycle:java",
"//chrome/browser/flags:java",
"//chrome/browser/magic_stack/android:java",
"//chrome/browser/notifications:java",
"//chrome/browser/omaha/android:java",
"//chrome/browser/password_manager/android:java",
"//chrome/browser/password_manager/android/pwd_check_wrapper:java",
"//chrome/browser/preferences:java",
"//chrome/browser/preferences:pref_service_java",
"//chrome/browser/profiles/android:java",
"//chrome/browser/safe_browsing/android:java",
"//chrome/browser/settings:java",
"//chrome/browser/signin/services/android:java",
"//chrome/browser/sync/android:java",
"//chrome/browser/tab:java",
"//chrome/browser/tabmodel:java",
"//chrome/browser/ui/android/hats:factory_java",
"//chrome/browser/ui/android/hats:java",
"//chrome/browser/ui/android/signin:java",
"//chrome/browser/ui/messages/android:java",
"//components/background_task_scheduler:background_task_scheduler_task_ids_java",
"//components/background_task_scheduler:factory_java",
"//components/background_task_scheduler:public_java",
"//components/browser_ui/notifications/android:java",
"//components/browser_ui/settings/android:java",
"//components/browser_ui/site_settings/android:java",
"//components/browser_ui/util/android:java",
"//components/browser_ui/widget/android:java",
"//components/content_settings/core/common:content_settings_types_java",
"//components/favicon/android:java",
"//components/password_manager/core/browser:password_manager_java_enums",
"//components/prefs/android:java",
"//components/safe_browsing/android:safe_browsing_java",
"//components/sync/android:sync_java",
"//components/user_prefs/android:java",
"//content/public/android:content_java",
"//third_party/androidx:androidx_annotation_annotation_java",
"//third_party/androidx:androidx_appcompat_appcompat_resources_java",
"//third_party/androidx:androidx_browser_browser_java",
"//third_party/androidx:androidx_core_core_java",
"//third_party/androidx:androidx_fragment_fragment_java",
"//third_party/androidx:androidx_preference_preference_java",
"//third_party/androidx:androidx_recyclerview_recyclerview_java",
"//third_party/androidx:androidx_vectordrawable_vectordrawable_java",
"//third_party/jni_zero:jni_zero_java",
"//ui/android:ui_java",
"//url:url_java",
]
srcjar_deps = [
":java_enum_srcjar",
":jni_headers",
]
resources_package = "org.chromium.chrome.browser.safety_hub"
}
robolectric_library("junit") {
resources_package = "org.chromium.chrome.browser.safety_hub"
sources = [
"junit/src/org/chromium/chrome/browser/safety_hub/MagicStackBridgeTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubAccountPasswordsDataSourceTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubAccountPasswordsModuleMediatorTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubBrowserStateModuleMediatorTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubFetchServiceTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubFetchTaskTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubHatsHelperUnitTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubLocalPasswordsDataSourceTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubLocalPasswordsModuleMediatorTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubMagicStackMediatorTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubMagicStackViewBinderTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleDelegateTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubModuleMediatorTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubNotificationsModuleMediatorTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubPasswordsFetchServiceTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubPasswordsModuleMediatorTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubPermissionsRevocationModuleMediatorTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubSafeBrowsingModuleMediatorTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubTestRule.java",
"junit/src/org/chromium/chrome/browser/safety_hub/SafetyHubUpdateCheckModuleMediatorTest.java",
"junit/src/org/chromium/chrome/browser/safety_hub/UnsubscribedNotificationsNotificationManagerTest.java",
]
deps = [
":java",
":java_resources",
"//base:base_java",
"//base:base_java_test_support",
"//base:base_junit_test_support",
"//chrome/browser/android/lifecycle:java",
"//chrome/browser/flags:java",
"//chrome/browser/magic_stack/android:java",
"//chrome/browser/omaha/android:java",
"//chrome/browser/password_manager/android:java",
"//chrome/browser/password_manager/android:settings_interface_java",
"//chrome/browser/password_manager/android:test_support_java",
"//chrome/browser/preferences:java",
"//chrome/browser/preferences:pref_service_java",
"//chrome/browser/profiles/android:java",
"//chrome/browser/safe_browsing/android:java",
"//chrome/browser/settings:factory_java",
"//chrome/browser/signin/services/android:java",
"//chrome/browser/sync/android:java",
"//chrome/browser/tabmodel:java",
"//chrome/browser/ui/android/hats:factory_java",
"//chrome/browser/ui/android/hats:java",
"//chrome/browser/ui/android/hats/test:test_support_java",
"//chrome/browser/ui/android/signin:java",
"//chrome/test/android:chrome_java_unit_test_support",
"//components/background_task_scheduler:background_task_scheduler_task_ids_java",
"//components/background_task_scheduler:factory_java",
"//components/background_task_scheduler:public_java",
"//components/browser_ui/notifications/android:java",
"//components/browser_ui/notifications/android:test_support_java",
"//components/browser_ui/notifications/android:utils_java",
"//components/browser_ui/settings/android:java",
"//components/content_settings/core/common:content_settings_types_java",
"//components/prefs/android:java",
"//components/signin/public/android:signin_java_test_support",
"//components/sync/android:sync_java",
"//components/user_prefs/android:java",
"//content/public/android:content_full_java",
"//content/public/test/android:content_java_test_support",
"//google_apis/gaia/android:java",
"//third_party/android_deps:espresso_java",
"//third_party/androidx:androidx_annotation_annotation_java",
"//third_party/androidx:androidx_preference_preference_java",
"//third_party/androidx:androidx_test_runner_java",
"//third_party/hamcrest:hamcrest_core_java",
"//third_party/hamcrest:hamcrest_library_java",
"//third_party/jni_zero:jni_zero_java",
"//third_party/junit",
"//third_party/mockito:mockito_java",
"//ui/android:ui_java",
"//ui/android:ui_java_test_support",
]
}
android_library("javatests") {
testonly = true
resources_package = "org.chromium.chrome.browser.safety_hub"
sources = [
"javatests/src/org/chromium/chrome/browser/safety_hub/FakeNotificationPermissionReviewBridge.java",
"javatests/src/org/chromium/chrome/browser/safety_hub/FakeUnusedSitePermissionsBridge.java",
"javatests/src/org/chromium/chrome/browser/safety_hub/SafetyHubHatsHelperTest.java",
"javatests/src/org/chromium/chrome/browser/safety_hub/SafetyHubTest.java",
"javatests/src/org/chromium/chrome/browser/safety_hub/UnsubscribedNotificationsNotificationTest.java",
]
deps = [
":java",
":java_resources",
"//base:base_java_test_support",
"//base:log_java",
"//base:supplier_java",
"//base:tasks_java",
"//base:time_utils_java",
"//build/android:build_java",
"//chrome/android:chrome_java",
"//chrome/android/javatests:chrome_test_java_helper",
"//chrome/browser/flags:java",
"//chrome/browser/omaha/android:java",
"//chrome/browser/password_manager/android:java",
"//chrome/browser/password_manager/android:test_support_java",
"//chrome/browser/preferences:java",
"//chrome/browser/profiles/android:java",
"//chrome/browser/safe_browsing/android:java",
"//chrome/browser/settings:test_support_java",
"//chrome/browser/tab:java",
"//chrome/browser/tabmodel:java",
"//chrome/test/android:chrome_java_integration_test_support",
"//chrome/test/android:chrome_java_test_support_common",
"//chrome/test/android:chrome_java_transit",
"//components/browser_ui/notifications/android:java",
"//components/browser_ui/notifications/android:test_support_java",
"//components/browser_ui/notifications/android:utils_java",
"//components/content_settings/core/common:content_settings_types_java",
"//components/policy/android:policy_java_test_support",
"//components/prefs/android:java",
"//components/signin/public/android:java",
"//components/signin/public/android:signin_java_test_support",
"//components/user_prefs/android:java",
"//content/public/android:content_full_java",
"//content/public/test/android:content_java_test_support",
"//third_party/android_deps:espresso_java",
"//third_party/androidx:androidx_fragment_fragment_java",
"//third_party/androidx:androidx_preference_preference_java",
"//third_party/androidx:androidx_test_monitor_java",
"//third_party/androidx:androidx_test_runner_java",
"//third_party/hamcrest:hamcrest_java",
"//third_party/jni_zero:jni_zero_java",
"//third_party/junit",
"//third_party/mockito:mockito_java",
"//ui/android:ui_java_test_support",
"//ui/android:ui_no_recycler_view_java",
"//url:url_java",
]
}
source_set("android") {
sources = [
"magic_stack_bridge.cc",
"magic_stack_bridge.h",
"notification_permission_review_bridge.cc",
"notification_permission_review_bridge.h",
"safety_hub_hats_bridge.cc",
"unused_site_permissions_bridge.cc",
"unused_site_permissions_bridge.h",
]
public_deps = [ "//chrome/browser/ui/safety_hub" ]
deps = [
":jni_headers",
"//chrome/browser/profiles:profile",
"//chrome/browser/ui",
"//chrome/browser/ui/hats",
"//chrome/common:constants",
"//components/content_settings/core/common",
"//components/page_info",
"//components/pref_registry",
"//components/prefs",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"notification_permission_review_bridge_unittest.cc",
"unused_site_permissions_bridge_unittest.cc",
]
deps = [
":android",
"//base/test:test_support",
"//chrome/browser/content_settings:content_settings_factory",
"//chrome/browser/engagement",
"//chrome/browser/permissions",
"//chrome/browser/ui",
"//chrome/browser/ui/safety_hub",
"//chrome/browser/ui/safety_hub:test_support",
"//chrome/test:test_support",
"//components/content_settings/core/browser",
"//components/content_settings/core/common",
"//components/permissions:permissions_common",
"//content/test: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" ]
}
android_resources("java_resources") {
sources = [
"java/res/drawable/safety_hub_magic_stack_icon_background.xml",
"java/res/drawable/safety_hub_notifications_icon.xml",
"java/res/drawable/safety_hub_safety_tips_icon.xml",
"java/res/layout/safety_hub_bottom_elements.xml",
"java/res/layout/safety_hub_button_widget.xml",
"java/res/layout/safety_hub_expandable_preference.xml",
"java/res/layout/safety_hub_list_menu_widget.xml",
"java/res/layout/safety_hub_magic_stack_view.xml",
"java/res/values/dimens.xml",
"java/res/values/ids.xml",
"java/res/xml/safety_hub_preferences.xml",
"java/res/xml/safety_hub_subpage_preferences.xml",
]
deps = [
"//chrome/android:chrome_app_java_resources",
"//chrome/browser/ui/android/strings:ui_strings_grd",
"//components/browser_ui/settings/android:java_resources",
]
}