chromium/chrome/browser/touch_to_fill/password_manager/android/internal/BUILD.gn

# Copyright 2023 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("//build/config/locales.gni")
import("//chrome/common/features.gni")
import("//third_party/jni_zero/jni_zero.gni")
import("//tools/grit/grit_rule.gni")

generate_jni("jni") {
  sources = [
    "java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillBridge.java",
  ]
}

android_library("java") {
  deps = [
    ":java_resources",
    "//base:base_java",
    "//build/android:build_java",
    "//chrome/android:chrome_java",
    "//chrome/browser/flags:java",
    "//chrome/browser/password_manager/android:java",
    "//chrome/browser/profiles/android:java",
    "//chrome/browser/touch_to_fill/common/android:java",
    "//chrome/browser/touch_to_fill/common/android:java_resources",
    "//chrome/browser/touch_to_fill/password_manager/android:public_java",
    "//chrome/browser/ui/android/favicon:java",
    "//chrome/browser/util:java",
    "//components/browser_ui/bottomsheet/android:java",
    "//components/browser_ui/util/android:java",
    "//components/browser_ui/widget/android:java",
    "//components/embedder_support/android:simple_factory_key_java",
    "//components/embedder_support/android:util_java",
    "//components/favicon/android:java",
    "//components/image_fetcher:java",
    "//components/password_manager/core/browser:password_manager_java_enums",
    "//components/signin/public/android:java_resources",
    "//components/url_formatter/android:url_formatter_java",
    "//components/webauthn/android:java",
    "//content/public/android:content_java",
    "//content/public/common:common_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_recyclerview_recyclerview_java",
    "//third_party/jni_zero:jni_zero_java",
    "//ui/android:ui_java",
    "//url:gurl_java",
  ]

  srcjar_deps = [
    ":jni",
    "//chrome/browser/touch_to_fill/password_manager:java_enum_srcjar",
  ]

  sources = [
    "java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillBridge.java",
    "java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillCoordinator.java",
    "java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillMediator.java",
    "java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillProperties.java",
    "java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillResourceProvider.java",
    "java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillResourceProviderImpl.java",
    "java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillView.java",
    "java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillViewBinder.java",
    "java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillViewHolder.java",
  ]

  # Add the actual implementation where necessary so that downstream targets
  # can provide their own implementations.
  jar_excluded_patterns = [ "*/TouchToFillResourceProviderImpl.class" ]

  resources_package = "org.chromium.chrome.browser.touch_to_fill"
}

android_resources("java_resources") {
  deps = [
    ":java_strings_grd",
    "//ui/android:ui_java_resources",
  ]
  sources = [
    "java/res/drawable-night/touch_to_fill_header_image.xml",
    "java/res/drawable/touch_to_fill_header_image.xml",
    "java/res/drawable/touch_to_fill_more_passkeys_icon.xml",
    "java/res/layout/touch_to_fill_footer_item.xml",
    "java/res/layout/touch_to_fill_header_item.xml",
    "java/res/layout/touch_to_fill_list_item.xml",
    "java/res/layout/touch_to_fill_more_passkeys_item.xml",
    "java/res/values/dimens.xml",
  ]
}

java_strings_grd("java_strings_grd") {
  defines = chrome_grit_defines
  grd_file = "java/strings/android_touch_to_fill_strings.grd"
  outputs =
      [ "values/android_touch_to_fill_strings.xml" ] +
      process_file_template(
          android_bundle_locales_as_resources,
          [ "values-{{source_name_part}}/android_touch_to_fill_strings.xml" ])
}

android_library("resource_provider_public_impl_java") {
  sources = [ "java/src/org/chromium/chrome/browser/touch_to_fill/TouchToFillResourceProviderImpl.java" ]

  deps = [
    ":java",
    ":java_resources",
    "//third_party/androidx:androidx_annotation_annotation_java",
  ]

  resources_package = "org.chromium.chrome.browser.touch_to_fill"
}