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

# Copyright 2020 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("password_check_enums_srcjar") {
  sources = [ "password_check_ui_status.h" ]
}

# Wrap the java_cpp_enum in android_library so it can be used by both
# chrome_java and modules.
android_library("password_check_java_enums") {
  deps = [ "//third_party/androidx:androidx_annotation_annotation_java" ]
  srcjar_deps = [ ":password_check_enums_srcjar" ]
}

source_set("unit_tests") {
  testonly = true
  sources = [ "password_check_manager_unittest.cc" ]
  deps = [
    ":password_check_enums_srcjar",
    "//base/test:test_support",
    "//chrome/browser",
    "//chrome/browser/sync",
    "//chrome/test:test_support",
    "//components/password_manager/core/browser",
    "//components/signin/public/identity_manager",
    "//components/signin/public/identity_manager:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]
}

android_library("public_java") {
  deps = [
    ":java_resources",
    ":password_check_java_enums",
    ":public_ui_java",
    "internal:public_ui_factory_java",
    "//base:base_java",
    "//chrome/browser/password_manager/android:java",
    "//chrome/browser/password_manager/android:settings_interface_java",
    "//chrome/browser/tab:java",
    "//components/browser_ui/settings/android:java",
    "//components/browser_ui/util/android:java",
    "//components/browser_ui/widget/android:java",
    "//components/password_manager/core/browser:password_manager_java_enums",
    "//components/ukm/android:java",
    "//content/public/android:content_full_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_recyclerview_recyclerview_java",
    "//third_party/androidx:androidx_vectordrawable_vectordrawable_java",
    "//ui/android:ui_no_recycler_view_java",
    "//url:gurl_java",
  ]
  sources = [
    "java/src/org/chromium/chrome/browser/password_check/PasswordChangeType.java",
    "java/src/org/chromium/chrome/browser/password_check/PasswordCheck.java",
    "java/src/org/chromium/chrome/browser/password_check/PasswordCheckFragmentView.java",
    "java/src/org/chromium/chrome/browser/password_check/PasswordCheckMetricsRecorder.java",
    "java/src/org/chromium/chrome/browser/password_check/PasswordCheckResolutionAction.java",
    "java/src/org/chromium/chrome/browser/password_check/PasswordCheckUkmRecorder.java",
    "java/src/org/chromium/chrome/browser/password_check/PasswordCheckUserAction.java",
  ]
  resources_package = "org.chromium.chrome.browser.password_check"
}

android_library("public_ui_java") {
  deps = [
    "//third_party/jni_zero:jni_zero_java",
    "//url:gurl_java",
  ]
  sources = [
    "java/src/org/chromium/chrome/browser/password_check/CompromisedCredential.java",
    "java/src/org/chromium/chrome/browser/password_check/PasswordCheckComponentUi.java",
  ]
}

robolectric_binary("password_check_junit_tests") {
  testonly = true
  resources_package = "org.chromium.chrome.browser.password_check"

  sources = [ "junit/src/org/chromium/chrome/browser/password_check/PasswordCheckControllerTest.java" ]

  deps = [
    ":public_ui_java",
    "internal:internal_factory_java",
    "internal:internal_java",
    "internal:public_ui_factory_java",
    "//base:base_java",
    "//base:base_java_test_support",
    "//base:base_junit_test_support",
    "//chrome/browser/device_reauth/android:java",
    "//chrome/browser/flags:java",
    "//chrome/browser/password_check/android:password_check_java_enums",
    "//chrome/browser/password_check/android:public_java",
    "//chrome/browser/password_manager/android:java",
    "//chrome/browser/password_manager/android:settings_interface_java",
    "//chrome/browser/settings:java",
    "//chrome/test/android:chrome_java_unit_test_support",
    "//components/browser_ui/settings/android:java",
    "//components/password_manager/core/browser:password_manager_java_enums",
    "//third_party/android_deps:espresso_java",
    "//third_party/androidx:androidx_appcompat_appcompat_java",
    "//third_party/androidx:androidx_test_core_java",
    "//third_party/hamcrest:hamcrest_java",
    "//third_party/junit",
    "//ui/android:ui_full_java",
    "//url:gurl_java",
  ]
}

android_library("test_java") {
  testonly = true
  resources_package = "org.chromium.chrome.browser.password_check"

  sources = [
    "javatests/src/org/chromium/chrome/browser/password_check/PasswordCheckIntegrationTest.java",
    "javatests/src/org/chromium/chrome/browser/password_check/PasswordCheckViewTest.java",
  ]

  deps = [
    ":public_java",
    ":public_ui_java",
    "internal:internal_java",
    "internal:internal_ui_factory_java",
    "internal:java_resources",
    "//base:base_java_test_support",
    "//chrome/android:chrome_app_java_resources",
    "//chrome/android:chrome_java",
    "//chrome/android:chrome_test_java",
    "//chrome/android:chrome_test_util_java",
    "//chrome/browser/feedback/android:java",
    "//chrome/browser/flags:java",
    "//chrome/browser/password_check/android:password_check_java_enums",
    "//chrome/browser/password_check/android/internal:public_factory_java",
    "//chrome/browser/password_manager/android:java",
    "//chrome/browser/password_manager/android:settings_interface_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/embedder_support/android:util_java",
    "//components/password_manager/core/browser:password_manager_java_enums",
    "//content/public/test/android:content_java_test_support",
    "//third_party/android_deps:espresso_java",
    "//third_party/android_deps:material_design_java",
    "//third_party/androidx:androidx_annotation_annotation_java",
    "//third_party/androidx:androidx_appcompat_appcompat_java",
    "//third_party/androidx:androidx_appcompat_appcompat_resources_java",
    "//third_party/androidx:androidx_fragment_fragment_java",
    "//third_party/androidx:androidx_recyclerview_recyclerview_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_full_java",
    "//ui/android:ui_utils_java",
    "//url:gurl_java",
  ]
}

generate_jni("jni_headers") {
  visibility = [ "//chrome/browser" ]
  sources = [ "java/src/org/chromium/chrome/browser/password_check/CompromisedCredential.java" ]
  public_deps =
      [ "//chrome/browser/password_check/android/internal:internal_jni" ]
}

android_resources("java_resources") {
  sources = [
    "java/res/drawable-night/password_check_header_red.xml",
    "java/res/drawable-night/password_check_neutral.xml",
    "java/res/drawable-night/password_checkup_warning.xml",
    "java/res/drawable/password_check_header_red.xml",
    "java/res/drawable/password_check_neutral.xml",
    "java/res/drawable/password_checkup_warning.xml",
  ]
  deps = [
    "//chrome/browser/ui/android/strings:ui_strings_grd",
    "//components/browser_ui/settings/android:java_resources",
    "//components/strings:components_strings_grd",
  ]
}