chromium/chrome/browser/prefetch/android/BUILD.gn

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

java_cpp_enum("preload_pages_state_generated_enum") {
  sources = [ "//chrome/browser/preloading/preloading_prefs.h" ]
}

android_library("java") {
  sources = [
    "java/src/org/chromium/chrome/browser/prefetch/settings/ExtendedPreloadingSettingsFragment.java",
    "java/src/org/chromium/chrome/browser/prefetch/settings/PreloadPagesSettingsBridge.java",
    "java/src/org/chromium/chrome/browser/prefetch/settings/PreloadPagesSettingsFragment.java",
    "java/src/org/chromium/chrome/browser/prefetch/settings/PreloadPagesSettingsFragmentBase.java",
    "java/src/org/chromium/chrome/browser/prefetch/settings/RadioButtonGroupPreloadPagesSettings.java",
    "java/src/org/chromium/chrome/browser/prefetch/settings/StandardPreloadingSettingsFragment.java",
  ]
  deps = [
    ":java_resources",
    "//base:supplier_java",
    "//build/android:build_java",
    "//chrome/browser/android/lifecycle:java",
    "//chrome/browser/feedback/android:java",
    "//chrome/browser/flags:java",
    "//chrome/browser/preferences:java",
    "//chrome/browser/profiles/android:java",
    "//chrome/browser/settings:java",
    "//components/browser_ui/settings/android:java",
    "//components/browser_ui/util/android:java",
    "//components/browser_ui/widget/android:java",
    "//components/minidump_uploader:minidump_uploader_java",
    "//third_party/android_deps:material_design_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/androidx:androidx_fragment_fragment_java",
    "//third_party/androidx:androidx_preference_preference_java",
    "//third_party/androidx:androidx_vectordrawable_vectordrawable_java",
    "//third_party/jni_zero:jni_zero_java",
  ]
  srcjar_deps = [
    ":jni_headers",
    ":preload_pages_state_generated_enum",
  ]

  resources_package = "org.chromium.chrome.browser.prefetch.settings"
}

android_library("javatests") {
  testonly = true
  resources_package = "org.chromium.chrome.browser.prefetch.settings"
  sources = [ "java/src/org/chromium/chrome/browser/prefetch/settings/PreloadPagesSettingsFragmentTest.java" ]
  deps = [
    ":java",
    ":java_resources",
    "//base:base_java_test_support",
    "//base:tasks_java",
    "//chrome/android:chrome_java",
    "//chrome/browser/feedback/android:factory_java",
    "//chrome/browser/feedback/android:java",
    "//chrome/browser/flags:java",
    "//chrome/browser/preferences:java",
    "//chrome/browser/profiles/android:java",
    "//chrome/browser/settings:java",
    "//chrome/browser/settings:test_support_java",
    "//chrome/test/android:chrome_java_integration_test_support",
    "//components/browser_ui/settings/android:java",
    "//components/browser_ui/widget/android: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_fragment_fragment_java",
    "//third_party/androidx:androidx_preference_preference_java",
    "//third_party/androidx:androidx_test_runner_java",
    "//third_party/hamcrest:hamcrest_java",
    "//third_party/junit",
    "//third_party/mockito:mockito_java",
  ]
}

android_resources("java_resources") {
  sources = [
    "java/res/layout/radio_button_group_preload_pages_preference.xml",
    "java/res/xml/extended_preloading_preferences.xml",
    "java/res/xml/preload_pages_preferences.xml",
    "java/res/xml/standard_preloading_preferences.xml",
  ]
  deps = [
    "//chrome/browser/feedback/android:java_resources",
    "//chrome/browser/ui/android/strings:ui_strings_grd",
    "//components/browser_ui/settings/android:java_resources",
  ]
}

generate_jni("jni_headers") {
  visibility = [
    ":*",
    "//chrome/android:jni_headers",
    "//chrome/browser",
  ]
  sources = [ "java/src/org/chromium/chrome/browser/prefetch/settings/PreloadPagesSettingsBridge.java" ]
}