chromium/chrome/browser/tab_resumption/BUILD.gn

# 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")

android_library("java") {
  srcjar_deps = [
    ":chrome_browser_tab_resumption_enums_srcjar",
    ":jni_headers",
  ]
  sources = [
    "java/src/org/chromium/chrome/browser/tab_resumption/AppInfo.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/ForeignSessionSuggestionBackend.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/LocalTabTabResumptionDataProvider.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/LocalTileView.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/MixedTabResumptionDataProvider.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/MultiTabObserver.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/SuggestionBackend.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/SuggestionBundle.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/SuggestionEntry.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/SyncDerivedSuggestionEntrySource.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/SyncDerivedTabResumptionDataProvider.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/TabResumptionDataProvider.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleBuilder.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleCoordinator.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleEnablement.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleMediator.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleMetricsUtils.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleProperties.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleUtils.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleView.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleViewBinder.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/TabResumptionTileContainerView.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/TabResumptionTileView.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/TrainingInfo.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/UrlImageProvider.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/UrlImageSourceImpl.java",
    "java/src/org/chromium/chrome/browser/tab_resumption/VisitedUrlRankingBackend.java",
  ]
  deps = [
    ":java_resources",
    "//base:base_java",
    "//build/android:build_java",
    "//chrome/browser/flags:java",
    "//chrome/browser/magic_stack/android:java",
    "//chrome/browser/page_image_service/android:java",
    "//chrome/browser/profiles/android:java",
    "//chrome/browser/recent_tabs:java",
    "//chrome/browser/signin/services/android:java",
    "//chrome/browser/sync/android:java",
    "//chrome/browser/tab:java",
    "//chrome/browser/tab_ui/android:java",
    "//chrome/browser/tabmodel:java",
    "//chrome/browser/ui/android/favicon:java",
    "//components/browser_ui/util/android:java",
    "//components/browser_ui/widget/android:java",
    "//components/browser_ui/widget/android:java_resources",
    "//components/embedder_support/android:simple_factory_key_java",
    "//components/embedder_support/android:util_java",
    "//components/favicon/android:java",
    "//components/image_fetcher:java",
    "//components/page_image_service/mojom:mojo_bindings_java",
    "//components/sync/android:sync_java",
    "//components/visited_url_ranking/android:visited_url_ranking_java",
    "//content/public/android:content_full_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/jni_zero:jni_zero_java",
    "//ui/android:ui_java_resources",
    "//ui/android:ui_no_recycler_view_java",
    "//url:gurl_java",
  ]
  resources_package = "org.chromium.chrome.browser.tab_resumption"
}

generate_jni("jni_headers") {
  sources = [ "java/src/org/chromium/chrome/browser/tab_resumption/VisitedUrlRankingBackend.java" ]
}

java_cpp_enum("chrome_browser_tab_resumption_enums_srcjar") {
  sources = [ "visited_url_ranking_backend.h" ]
}

android_resources("java_resources") {
  sources = [
    "java/res/drawable/tab_resumption_module_icon_background.xml",
    "java/res/drawable/tab_resumption_module_ripple.xml",
    "java/res/drawable/tab_resumption_module_tile_reason_background.xml",
    "java/res/layout/tab_resumption_module_divider.xml",
    "java/res/layout/tab_resumption_module_layout.xml",
    "java/res/layout/tab_resumption_module_local_tile_layout.xml",
    "java/res/layout/tab_resumption_module_multi_tile_layout.xml",
    "java/res/layout/tab_resumption_module_single_tile_layout.xml",
    "java/res/values/dimens.xml",
  ]
  deps = [
    "//chrome/browser/ui/android/strings:ui_strings_grd",
    "//components/browser_ui/strings/android:browser_ui_strings_grd",
    "//components/browser_ui/styles/android:java_resources",
  ]
}

robolectric_library("junit") {
  testonly = true
  resources_package = "org.chromium.chrome.browser.tab_resumption"

  sources = [
    "junit/src/org/chromium/chrome/browser/tab_resumption/ForeignSessionSuggestionBackendUnitTest.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/LocalTabTabResumptionDataProviderUnitTest.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/MixedTabResumptionDataProviderUnitTest.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/SyncDerivedSuggestionEntrySourceUnitTest.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/SyncDerivedTabResumptionDataProviderUnitTest.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleCoordinatorUnitTest.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleEnablementUnitTest.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleMediatorUnitTest.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleMetricsUtilsUnitTest.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleSuggestionsUnitTest.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleUtilsUnitTest.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/TabResumptionModuleViewUnitTest.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/TestSupport.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/TestSupportExtended.java",
    "junit/src/org/chromium/chrome/browser/tab_resumption/UrlImageSourceImplUnitTest.java",
  ]

  deps = [
    ":java",
    ":java_resources",
    "//base:base_java",
    "//base:base_java_test_support",
    "//base:base_junit_test_support",
    "//chrome/browser/flags:java",
    "//chrome/browser/magic_stack/android:java",
    "//chrome/browser/page_image_service/android:java",
    "//chrome/browser/profiles/android:java",
    "//chrome/browser/recent_tabs:java",
    "//chrome/browser/signin/services/android:java",
    "//chrome/browser/sync/android:java",
    "//chrome/browser/tab:java",
    "//chrome/browser/tab_ui/android:java",
    "//chrome/browser/tabmodel:java",
    "//components/browser_ui/theme/android:java_resources",
    "//components/browser_ui/widget/android:java",
    "//components/browser_ui/widget/android:java_resources",
    "//components/embedder_support/android:util_java",
    "//components/favicon/android:java",
    "//components/sync/android:sync_java",
    "//components/sync_device_info:sync_device_info_java",
    "//components/visited_url_ranking/android:visited_url_ranking_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/androidx:androidx_test_core_java",
    "//third_party/androidx:androidx_test_runner_java",
    "//third_party/jni_zero:jni_zero_java",
    "//third_party/junit:junit",
    "//third_party/mockito:mockito_java",
    "//ui/android:ui_java",
    "//url:gurl_java",
    "//url:gurl_junit_test_support",
  ]
}