# Copyright 2022 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")
generate_jni("accessibility_jni_headers") {
sources = [
"java/src/org/chromium/components/browser_ui/accessibility/FontSizePrefs.java",
"java/src/org/chromium/components/browser_ui/accessibility/PageZoomMetrics.java",
]
}
source_set("android") {
sources = [
"font_size_prefs_android.cc",
"font_size_prefs_android.h",
"page_zoom_metrics.cc",
"page_zoom_metrics.h",
]
deps = [
":accessibility_jni_headers",
"//base",
"//components/prefs",
"//components/user_prefs",
"//content/public/browser",
"//services/metrics/public/cpp:ukm_builders",
]
}
# Constants only target without dependencies to allow embedders to only include relevant code.
android_library("constants_java") {
sources = [ "java/src/org/chromium/components/browser_ui/accessibility/AccessibilityConstants.java" ]
}
android_library("lib_java") {
srcjar_deps = [ ":accessibility_jni_headers" ]
sources = [
"java/src/org/chromium/components/browser_ui/accessibility/AccessibilitySettingsDelegate.java",
"java/src/org/chromium/components/browser_ui/accessibility/DeviceAccessibilitySettingsHandler.java",
"java/src/org/chromium/components/browser_ui/accessibility/FontSizePrefs.java",
"java/src/org/chromium/components/browser_ui/accessibility/PageZoomCoordinator.java",
"java/src/org/chromium/components/browser_ui/accessibility/PageZoomCoordinatorDelegate.java",
"java/src/org/chromium/components/browser_ui/accessibility/PageZoomMediator.java",
"java/src/org/chromium/components/browser_ui/accessibility/PageZoomMetrics.java",
"java/src/org/chromium/components/browser_ui/accessibility/PageZoomPreference.java",
"java/src/org/chromium/components/browser_ui/accessibility/PageZoomProperties.java",
"java/src/org/chromium/components/browser_ui/accessibility/PageZoomViewBinder.java",
]
deps = [
":java_resources",
":page_zoom_utils_java",
"//base:base_java",
"//build/android:build_java",
"//components/browser_ui/settings/android:java",
"//components/browser_ui/site_settings/android:java",
"//components/prefs/android:java",
"//components/user_prefs/android:java",
"//content/public/android:content_full_java",
"//third_party/androidx:androidx_annotation_annotation_java",
"//third_party/androidx:androidx_fragment_fragment_java",
"//third_party/androidx:androidx_preference_preference_java",
"//third_party/jni_zero:jni_zero_java",
"//ui/accessibility:ax_base_java",
"//ui/android:ui_no_recycler_view_java",
]
resources_package = "org.chromium.components.browser_ui.accessibility"
}
android_library("page_zoom_utils_java") {
sources = [
"java/src/org/chromium/components/browser_ui/accessibility/PageZoomUma.java",
"java/src/org/chromium/components/browser_ui/accessibility/PageZoomUtils.java",
]
deps = [
":constants_java",
"//base:base_java",
"//content/public/android:content_full_java",
"//third_party/androidx:androidx_annotation_annotation_java",
"//third_party/androidx:androidx_preference_preference_java",
]
}
android_resources("java_resources") {
sources = [
"java/res/anim/slide_out_child_bottom.xml",
"java/res/drawable/ic_zoom.xml",
"java/res/drawable/page_zoom_background.xml",
"java/res/drawable/page_zoom_ripple.xml",
"java/res/layout/custom_preference.xml",
"java/res/layout/page_zoom_preference.xml",
"java/res/layout/page_zoom_slider.xml",
"java/res/layout/page_zoom_view.xml",
"java/res/layout/preference_text_scale.xml",
"java/res/layout/text_size_contrast_slider.xml",
"java/res/values/dimens.xml",
"java/res/values/styles.xml",
"java/res/xml/accessibility_preferences.xml",
]
deps = [
"//components/browser_ui/strings/android:browser_ui_strings_grd",
"//components/browser_ui/styles/android:java_resources",
"//third_party/androidx:androidx_preference_preference_java",
]
}
robolectric_library("junit") {
testonly = true
sources = [
"java/src/org/chromium/components/browser_ui/accessibility/PageZoomMediatorUnitTest.java",
"java/src/org/chromium/components/browser_ui/accessibility/PageZoomUtilsUnitTest.java",
]
deps = [
":lib_java",
"//base:base_java",
"//base:base_java_test_support",
"//base:base_junit_test_support",
"//content/public/android:content_full_java",
"//third_party/androidx:androidx_test_runner_java",
"//third_party/jni_zero:jni_zero_java",
"//third_party/junit",
"//third_party/mockito:mockito_java",
"//ui/android:ui_no_recycler_view_java",
]
}
android_library("unit_device_javatests") {
testonly = true
resources_package = "org.chromium.components.browser_ui.accessibility"
sources = [ "java/src/org/chromium/components/browser_ui/accessibility/PageZoomViewTest.java" ]
deps = [
":java_resources",
":lib_java",
"//base:base_java_test_support",
"//base:tasks_java",
"//content/public/android:content_java",
"//content/public/test/android:content_java_test_support",
"//third_party/android_deps:espresso_java",
"//third_party/androidx:androidx_test_runner_java",
"//third_party/hamcrest:hamcrest_java",
"//third_party/jni_zero:jni_zero_java",
"//third_party/junit:junit",
"//third_party/mockito:mockito_java",
"//ui/android:ui_java_test_support",
]
}
source_set("unit_tests") {
testonly = true
sources = [ "page_zoom_metrics_unittest.cc" ]
deps = [
"//components/browser_ui/accessibility/android",
"//components/ukm:test_support",
"//testing/gtest",
]
}