# Copyright 2019 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("//chrome/android/features/android_library_factory_tmpl.gni")
import("//third_party/jni_zero/jni_zero.gni")
# Minimal Java library for the DownloadFileProvider which will be included in
# the base module.
android_library("file_provider_java") {
sources = [
"java/src/org/chromium/chrome/browser/download/DirectoryOption.java",
"java/src/org/chromium/chrome/browser/download/DownloadDirectoryProvider.java",
"java/src/org/chromium/chrome/browser/download/DownloadFileProvider.java",
]
deps = [
"//base:base_java",
"//base:content_uri_utils_java",
"//components/embedder_support/android:util_java",
"//content/public/android:content_main_dex_java",
"//third_party/androidx:androidx_annotation_annotation_java",
"//third_party/androidx:androidx_core_core_java",
]
}
android_library("java") {
sources = [
"java/src/org/chromium/chrome/browser/download/DangerousDownloadDialogBridge.java",
"java/src/org/chromium/chrome/browser/download/DownloadConstants.java",
"java/src/org/chromium/chrome/browser/download/DownloadDelegateImpl.java",
"java/src/org/chromium/chrome/browser/download/DownloadDialogBridge.java",
"java/src/org/chromium/chrome/browser/download/DownloadFilter.java",
"java/src/org/chromium/chrome/browser/download/DownloadInfo.java",
"java/src/org/chromium/chrome/browser/download/DownloadLocationDialogMetrics.java",
"java/src/org/chromium/chrome/browser/download/DownloadManagerBridge.java",
"java/src/org/chromium/chrome/browser/download/DownloadMessageUiController.java",
"java/src/org/chromium/chrome/browser/download/DownloadStartupUtils.java",
"java/src/org/chromium/chrome/browser/download/DownloadStatus.java",
"java/src/org/chromium/chrome/browser/download/InsecureDownloadDialogBridge.java",
"java/src/org/chromium/chrome/browser/download/MediaStoreHelper.java",
"java/src/org/chromium/chrome/browser/download/MimeUtils.java",
"java/src/org/chromium/chrome/browser/download/StringUtils.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DangerousDownloadDialog.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadDialogUtils.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogController.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogProperties.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogViewBinder.java",
"java/src/org/chromium/chrome/browser/download/dialogs/InsecureDownloadDialog.java",
"java/src/org/chromium/chrome/browser/download/dialogs/OpenDownloadCustomView.java",
"java/src/org/chromium/chrome/browser/download/dialogs/OpenDownloadDialog.java",
"java/src/org/chromium/chrome/browser/download/dialogs/OpenDownloadDialogProperties.java",
"java/src/org/chromium/chrome/browser/download/dialogs/OpenDownloadDialogViewBinder.java",
"java/src/org/chromium/chrome/browser/download/home/DownloadManagerCoordinator.java",
"java/src/org/chromium/chrome/browser/download/home/DownloadManagerUiConfig.java",
"java/src/org/chromium/chrome/browser/download/home/DownloadManagerUiConfigHelper.java",
"java/src/org/chromium/chrome/browser/download/home/FaviconProvider.java",
"java/src/org/chromium/chrome/browser/download/home/JustNowProvider.java",
"java/src/org/chromium/chrome/browser/download/interstitial/DownloadInterstitialCoordinator.java",
"java/src/org/chromium/chrome/browser/download/interstitial/NewDownloadTab.java",
"java/src/org/chromium/chrome/browser/download/interstitial/NewDownloadTabProvider.java",
"java/src/org/chromium/chrome/browser/download/items/OfflineContentAggregatorFactory.java",
"java/src/org/chromium/chrome/browser/download/settings/DownloadDirectoryAdapter.java",
"java/src/org/chromium/chrome/browser/download/settings/DownloadLocationHelperImpl.java",
"java/src/org/chromium/chrome/browser/download/settings/DownloadLocationPreference.java",
"java/src/org/chromium/chrome/browser/download/settings/DownloadLocationPreferenceAdapter.java",
"java/src/org/chromium/chrome/browser/download/settings/DownloadLocationPreferenceDialog.java",
"java/src/org/chromium/chrome/browser/download/settings/DownloadSettings.java",
]
deps = [
":file_provider_java",
":java_resources",
"//base:base_java",
"//base:content_uri_utils_java",
"//build/android:build_java",
"//chrome/browser/flags:java",
"//chrome/browser/preferences:java",
"//chrome/browser/profiles/android:java",
"//chrome/browser/settings:java",
"//chrome/browser/tab:java",
"//chrome/browser/ui/android/pdf:java",
"//chrome/browser/ui/messages/android:java",
"//chrome/browser/util:java",
"//components/browser_ui/modaldialog/android:java",
"//components/browser_ui/settings/android:java",
"//components/browser_ui/styles/android:java",
"//components/browser_ui/util/android:java",
"//components/browser_ui/widget/android:java",
"//components/download/internal/common:internal_java",
"//components/download/public/common:public_java",
"//components/embedder_support/android:util_java",
"//components/feature_engagement:feature_engagement_java",
"//components/messages/android:java",
"//components/offline_items_collection/core:core_java",
"//components/prefs/android:java",
"//components/user_prefs/android:java",
"//content/public/android:content_java",
"//net/android:net_java",
"//third_party/android_deps:material_design_java",
"//third_party/androidx:androidx_annotation_annotation_java",
"//third_party/androidx:androidx_appcompat_appcompat_resources_java",
"//third_party/androidx:androidx_core_core_java",
"//third_party/androidx:androidx_fragment_fragment_java",
"//third_party/androidx:androidx_preference_preference_java",
"//third_party/jni_zero:jni_zero_java",
"//ui/android:ui_java",
"//url:gurl_java",
]
srcjar_deps = [
":jni_headers",
"//chrome:download_enum_javagen",
]
resources_package = "org.chromium.chrome.browser.download"
}
android_library_factory("factory_java") {
# These deps will be inherited by the resulting android_library target.
deps = [
":java",
"//base:base_java",
"//chrome/browser/ui/messages/android:java",
"//components/feature_engagement:feature_engagement_java",
"//components/offline_items_collection/core:core_java",
"//components/prefs/android:java",
"//ui/android:ui_java",
]
# This internal file will be replaced by a generated file so the resulting
# android_library target does not actually depend on this internal file.
sources = [
"//chrome/browser/download/internal/android/java/src/org/chromium/chrome/browser/download/DownloadMessageUiControllerFactory.java",
"//chrome/browser/download/internal/android/java/src/org/chromium/chrome/browser/download/home/DownloadManagerCoordinatorFactory.java",
"//chrome/browser/download/internal/android/java/src/org/chromium/chrome/browser/download/interstitial/DownloadInterstitialCoordinatorFactory.java",
]
}
generate_jni("jni_headers") {
sources = [
"java/src/org/chromium/chrome/browser/download/DangerousDownloadDialogBridge.java",
"java/src/org/chromium/chrome/browser/download/DownloadDialogBridge.java",
"java/src/org/chromium/chrome/browser/download/DownloadInfo.java",
"java/src/org/chromium/chrome/browser/download/DownloadManagerBridge.java",
"java/src/org/chromium/chrome/browser/download/DownloadStartupUtils.java",
"java/src/org/chromium/chrome/browser/download/InsecureDownloadDialogBridge.java",
"java/src/org/chromium/chrome/browser/download/MimeUtils.java",
"java/src/org/chromium/chrome/browser/download/StringUtils.java",
"java/src/org/chromium/chrome/browser/download/items/OfflineContentAggregatorFactory.java",
]
}
android_library("download_java_tests") {
testonly = true
sources = [
"java/src/org/chromium/chrome/browser/download/DownloadFileProviderTest.java",
"java/src/org/chromium/chrome/browser/download/MimeUtilsTest.java",
"java/src/org/chromium/chrome/browser/download/StringUtilsTest.java",
]
deps = [
":file_provider_java",
":java",
"//base:base_java",
"//base:base_java_test_support",
"//chrome/browser/flags:java",
"//chrome/browser/preferences:java",
"//chrome/browser/profiles/android:java",
"//chrome/browser/settings:test_support_java",
"//chrome/test/android:chrome_java_unit_test_support",
"//components/browser_ui/settings/android:java",
"//components/browser_ui/util/android:java",
"//components/offline_items_collection/core:core_java",
"//components/policy/android:policy_java_test_support",
"//components/prefs/android:java",
"//components/user_prefs/android:java",
"//content/public/test/android:content_java_test_support",
"//third_party/android_deps:espresso_java",
"//third_party/androidx:androidx_preference_preference_java",
"//third_party/androidx:androidx_test_core_java",
"//third_party/androidx:androidx_test_monitor_java",
"//third_party/androidx:androidx_test_runner_java",
"//third_party/junit",
"//third_party/mockito:mockito_java",
]
}
robolectric_library("junit_tests") {
sources = [
"java/src/org/chromium/chrome/browser/download/DownloadDialogBridgeUnitTest.java",
"java/src/org/chromium/chrome/browser/download/DownloadDirectoryProviderUnitTest.java",
"java/src/org/chromium/chrome/browser/download/DownloadLocationDialogMetricsUnitTest.java",
"java/src/org/chromium/chrome/browser/download/dialogs/DownloadDialogUtilsUnitTest.java",
]
deps = [
":file_provider_java",
":java",
"//base:base_java",
"//base:base_java_test_support",
"//base:base_junit_test_support",
"//chrome/browser/flags:java",
"//chrome/browser/preferences:java",
"//chrome/browser/profiles/android:java",
"//chrome/test/android:chrome_java_unit_test_support",
"//components/offline_items_collection/core:core_java",
"//components/prefs/android:java",
"//net/android:net_java",
"//third_party/jni_zero:jni_zero_java",
"//third_party/junit",
"//third_party/mockito:mockito_java",
"//ui/android:ui_full_java",
]
}
android_resources("java_resources") {
sources = [
"java/res/drawable/ic_incognito_download_message.xml",
"java/res/drawable/infobar_download_complete.xml",
"java/res/layout/confirm_oma_download.xml",
"java/res/layout/download_location_dialog.xml",
"java/res/layout/download_location_preference.xml",
"java/res/layout/download_location_preference_item.xml",
"java/res/layout/download_location_spinner_dropdown_item.xml",
"java/res/layout/download_location_spinner_item.xml",
"java/res/layout/open_download_dialog.xml",
"java/res/values-v17/dimens.xml",
"java/res/values-v17/styles.xml",
"java/res/xml/download_preferences.xml",
]
deps = [
"//chrome/browser/ui/android/strings:ui_strings_grd",
"//components/browser_ui/modaldialog/android:java_resources",
"//components/browser_ui/strings/android:browser_ui_strings_grd",
"//components/browser_ui/styles/android:java_resources",
"//components/browser_ui/widget/android:java_resources",
"//ui/android:ui_java_resources",
]
}