blob: 682c00841d699044e2f92d8e3e5de79fa8f5360e [file] [log] [blame]
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//android_webview/system_webview_apk_tmpl.gni")
import("//android_webview/variables.gni")
import("//android_webview/webview_repack_locales.gni")
import("//build/android/resource_sizes.gni")
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//build/config/locales.gni")
import("//chrome/android/chrome_common_shared_library.gni")
import("//chrome/android/chrome_public_apk_tmpl.gni")
import("//chrome/android/trichrome.gni")
import("//components/gwp_asan/buildflags/buildflags.gni")
import("//components/spellcheck/spellcheck_build_features.gni")
import("//tools/grit/repack.gni")
import("//tools/resources/generate_resource_whitelist.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
if (enable_resource_whitelist_generation) {
system_webview_pak_whitelist =
"$target_gen_dir/system_webview_pak_whitelist.txt"
}
group("android_webview") {
if (public_android_sdk) {
deps = [
":system_webview_apk",
]
}
}
generate_jni("common_jni_headers") {
sources = [
"java/src/org/chromium/android_webview/common/AwResource.java",
"java/src/org/chromium/android_webview/common/crash/AwCrashReporterClient.java",
]
}
generate_jni("browser_jni_headers") {
sources = [
"java/src/org/chromium/android_webview/AndroidProtocolHandler.java",
"java/src/org/chromium/android_webview/AwAutofillClient.java",
"java/src/org/chromium/android_webview/AwBrowserContext.java",
"java/src/org/chromium/android_webview/AwBrowserProcess.java",
"java/src/org/chromium/android_webview/AwContents.java",
"java/src/org/chromium/android_webview/AwContentsBackgroundThreadClient.java",
"java/src/org/chromium/android_webview/AwContentsClientBridge.java",
"java/src/org/chromium/android_webview/AwContentsIoThreadClient.java",
"java/src/org/chromium/android_webview/AwContentsLifecycleNotifier.java",
"java/src/org/chromium/android_webview/AwContentsStatics.java",
"java/src/org/chromium/android_webview/AwCookieManager.java",
"java/src/org/chromium/android_webview/AwDebug.java",
"java/src/org/chromium/android_webview/AwDevToolsServer.java",
"java/src/org/chromium/android_webview/AwFeatureList.java",
"java/src/org/chromium/android_webview/AwFormDatabase.java",
"java/src/org/chromium/android_webview/AwHttpAuthHandler.java",
"java/src/org/chromium/android_webview/AwPdfExporter.java",
"java/src/org/chromium/android_webview/AwProxyController.java",
"java/src/org/chromium/android_webview/AwQuotaManagerBridge.java",
"java/src/org/chromium/android_webview/AwRenderProcess.java",
"java/src/org/chromium/android_webview/AwSettings.java",
"java/src/org/chromium/android_webview/AwTracingController.java",
"java/src/org/chromium/android_webview/AwVariationsSeedBridge.java",
"java/src/org/chromium/android_webview/AwWebContentsDelegate.java",
"java/src/org/chromium/android_webview/AwWebResourceInterceptResponse.java",
"java/src/org/chromium/android_webview/AwWebResourceResponse.java",
"java/src/org/chromium/android_webview/InputStreamUtil.java",
"java/src/org/chromium/android_webview/JsReplyProxy.java",
"java/src/org/chromium/android_webview/PopupTouchHandleDrawable.java",
"java/src/org/chromium/android_webview/WebMessageListenerHolder.java",
"java/src/org/chromium/android_webview/gfx/AwDrawFnImpl.java",
"java/src/org/chromium/android_webview/gfx/AwGLFunctor.java",
"java/src/org/chromium/android_webview/gfx/AwPicture.java",
"java/src/org/chromium/android_webview/gfx/JavaBrowserViewRendererHelper.java",
"java/src/org/chromium/android_webview/metrics/AwMetricsLogUploader.java",
"java/src/org/chromium/android_webview/metrics/AwMetricsServiceClient.java",
"java/src/org/chromium/android_webview/permission/AwPermissionRequest.java",
]
deps = [
":cancellation_signal_android_jar_jni_headers",
]
}
generate_jar_jni("cancellation_signal_android_jar_jni_headers") {
classes = [ "android/os/CancellationSignal.class" ]
}
jinja_template("system_webview_manifest") {
input = "apk/java/AndroidManifest.xml"
output = system_webview_android_manifest
variables = [ "manifest_package=$system_webview_package_name" ]
}
jinja_template("trichrome_webview_manifest") {
input = "apk/java/AndroidManifest.xml"
output = trichrome_webview_android_manifest
variables = trichrome_jinja_variables + [
"trichrome_version=$trichrome_version_code",
"manifest_package=$system_webview_package_name",
"library=libmonochrome.so",
]
}
jinja_template("trichrome_webview_64_32_manifest") {
input = "apk/java/AndroidManifest.xml"
output = trichrome_webview_64_32_android_manifest
variables = trichrome_jinja_variables + [
"use32bitAbi=",
"trichrome_version=$trichrome_64_32_version_code",
"manifest_package=$system_webview_package_name",
"library=libmonochrome_64.so",
]
}
webview_repack_locales("repack_locales") {
input_locales = locales
output_locales = locales
if (enable_resource_whitelist_generation) {
repack_whitelist = system_webview_pak_whitelist
deps = [
":system_webview_pak_whitelist",
]
}
}
android_assets("locale_pak_assets") {
disable_compression = true
renaming_sources = []
renaming_destinations = []
foreach(_locale, locales) {
renaming_sources += [ "$root_out_dir/android_webview/locales/$_locale.pak" ]
renaming_destinations += [ "stored-locales/$_locale.pak" ]
}
treat_as_locale_paks = true
deps = [
":repack_locales",
]
}
repack("repack_pack") {
sources = [
"$root_gen_dir/content/content_resources.pak",
"$root_gen_dir/net/net_resources.pak",
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
"$root_gen_dir/weblayer/weblayer_resources.pak",
"$target_gen_dir/aw_resources.pak",
"$target_gen_dir/components_resources.pak",
"$target_gen_dir/mojo_bindings_resources.pak",
"$target_gen_dir/webui_resources.pak",
]
deps = [
":generate_aw_resources",
":generate_components_resources",
":generate_mojo_resources",
":generate_webui_resources",
"//content:resources",
"//net:net_resources",
"//third_party/blink/public:resources",
"//weblayer:resources",
]
output = "$target_gen_dir/resources.pak"
if (enable_resource_whitelist_generation) {
repack_whitelist = system_webview_pak_whitelist
deps += [ ":system_webview_pak_whitelist" ]
}
}
repack("repack_100_percent") {
sources = [
"$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
"$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_100_percent.pak",
"$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
]
deps = [
"//content/app/resources",
"//third_party/blink/public:scaled_resources_100_percent",
"//ui/resources",
]
output = "$target_gen_dir/chrome_100_percent.pak"
if (enable_resource_whitelist_generation) {
repack_whitelist = system_webview_pak_whitelist
deps += [ ":system_webview_pak_whitelist" ]
}
}
android_assets("pak_file_assets") {
sources = [
"$target_gen_dir/chrome_100_percent.pak",
"$target_gen_dir/resources.pak",
]
deps = [
":repack_100_percent",
":repack_pack",
]
disable_compression = true
}
# These assets are needed by both monochrome and stand alone WebView, but not by
# Chrome or TrichromeWebView.
android_assets("monochrome_webview_assets") {
deps = [
"//third_party/icu:icu_assets",
]
if (use_v8_context_snapshot) {
deps += [ "//tools/v8_context_snapshot:v8_context_snapshot_assets" ]
} else {
deps += [ "//v8:v8_external_startup_data_assets" ]
}
if (android_64bit_target_cpu && build_apk_secondary_abi) {
deps += [ ":v8_snapshot_secondary_abi_assets" ]
}
}
android_assets("stub_assets") {
renaming_sources = [ "$root_gen_dir/components/resources/about_credits.html" ]
renaming_destinations = [ "webview_licenses.notice" ]
deps = [
"//components/resources:about_credits",
]
}
android_resources("resources") {
resource_dirs = [ "java/res" ]
custom_package = "org.chromium.android_webview"
deps = [
":strings_grd",
]
}
grit("generate_aw_resources") {
source = "ui/aw_resources.grd"
outputs = [
"grit/aw_resources.h",
"aw_resources.pak",
]
}
grit("generate_aw_strings") {
source = "ui/aw_strings.grd"
outputs = [
"grit/aw_strings.h",
]
foreach(_locale, locales) {
outputs += [ "aw_strings_${_locale}.pak" ]
}
}
grit("generate_webui_resources") {
source = "../ui/webui/resources/webui_resources.grd"
# The .grd contains references to generated files.
source_is_generated = true
# webui/resources has way too many resources. The whitelist is trim this down
# to a reasonable size
_whitelist = "ui/grit_resources_whitelist.txt"
inputs = [
_whitelist,
]
grit_flags = [
"-w",
rebase_path(_whitelist, root_build_dir),
]
outputs = [
"grit/webui_resources.h",
"grit/webui_resources_map.cc",
"grit/webui_resources_map.h",
"webui_resources.pak",
]
}
grit("generate_mojo_resources") {
source = "../mojo/public/js/mojo_bindings_resources.grd"
# The .grd contains references to generated files.
source_is_generated = true
# See :generate_webui_resources for an explanation of the whitelist
_whitelist = "ui/grit_resources_whitelist.txt"
inputs = [
_whitelist,
]
grit_flags = [
"-w",
rebase_path(_whitelist, root_build_dir),
"-E",
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
]
outputs = [
"grit/mojo_bindings_resources.h",
"grit/mojo_bindings_resources_map.cc",
"grit/mojo_bindings_resources_map.h",
"mojo_bindings_resources.pak",
]
deps = [
"//mojo/public/js:bindings_lite",
]
}
grit("generate_components_resources") {
source = "../components/resources/components_resources.grd"
# The .grd contains references to generated files.
source_is_generated = true
use_brotli = true
# See :generate_webui_resources for an explanation of the whitelist
_whitelist = "ui/grit_resources_whitelist.txt"
inputs = [
_whitelist,
]
_about_credits_file = get_label_info("//components/resources",
"target_gen_dir") + "/about_credits.html"
grit_flags = [
"-w",
rebase_path(_whitelist, root_build_dir),
"-E",
"about_credits_file=" + rebase_path(_about_credits_file, root_build_dir),
]
outputs = [
"grit/components_resources.h",
"components_resources.pak",
]
deps = [
"//components/resources:about_credits",
]
}
grit("generate_components_strings") {
source = "../components/components_strings.grd"
# components_strings contains strings from all components. WebView
# will never display most of them, so we try to limit the included
# strings. This whitelist trims about 50% more than the compile-based
# whitelist generated by :system_webview_pak_whitelist.
whitelist = rebase_path("ui/grit_strings_whitelist.txt", root_build_dir)
inputs = [
"//android_webview/ui/grit_strings_whitelist.txt",
]
grit_flags = [
"-w",
whitelist,
]
outputs = [
"grit/components_strings.h",
"java/res/values-am/components_strings.xml",
"java/res/values-ar/components_strings.xml",
"java/res/values-bg/components_strings.xml",
"java/res/values-bn/components_strings.xml",
"java/res/values-ca/components_strings.xml",
"java/res/values-cs/components_strings.xml",
"java/res/values-da/components_strings.xml",
"java/res/values-de/components_strings.xml",
"java/res/values-el/components_strings.xml",
"java/res/values-en-rGB/components_strings.xml",
"java/res/values-es/components_strings.xml",
"java/res/values-es-rUS/components_strings.xml",
"java/res/values-et/components_strings.xml",
"java/res/values-fa/components_strings.xml",
"java/res/values-fi/components_strings.xml",
"java/res/values-fr/components_strings.xml",
"java/res/values-gu/components_strings.xml",
"java/res/values-hi/components_strings.xml",
"java/res/values-hr/components_strings.xml",
"java/res/values-hu/components_strings.xml",
"java/res/values-in/components_strings.xml",
"java/res/values-it/components_strings.xml",
"java/res/values-iw/components_strings.xml",
"java/res/values-ja/components_strings.xml",
"java/res/values-kn/components_strings.xml",
"java/res/values-ko/components_strings.xml",
"java/res/values-lt/components_strings.xml",
"java/res/values-lv/components_strings.xml",
"java/res/values-ml/components_strings.xml",
"java/res/values-mr/components_strings.xml",
"java/res/values-ms/components_strings.xml",
"java/res/values-nb/components_strings.xml",
"java/res/values-nl/components_strings.xml",
"java/res/values-pl/components_strings.xml",
"java/res/values-pt-rBR/components_strings.xml",
"java/res/values-pt-rPT/components_strings.xml",
"java/res/values-ro/components_strings.xml",
"java/res/values-ru/components_strings.xml",
"java/res/values-sk/components_strings.xml",
"java/res/values-sl/components_strings.xml",
"java/res/values-sr/components_strings.xml",
"java/res/values-sv/components_strings.xml",
"java/res/values-sw/components_strings.xml",
"java/res/values-ta/components_strings.xml",
"java/res/values-te/components_strings.xml",
"java/res/values-th/components_strings.xml",
"java/res/values-tl/components_strings.xml",
"java/res/values-tr/components_strings.xml",
"java/res/values-uk/components_strings.xml",
"java/res/values-vi/components_strings.xml",
"java/res/values-zh-rCN/components_strings.xml",
"java/res/values-zh-rTW/components_strings.xml",
"java/res/values/components_strings.xml",
]
foreach(_locale, locales_with_fake_bidi) {
outputs += [ "components_strings_${_locale}.pak" ]
}
}
source_set("webview_entry_point") {
deps = [
":common",
"//base",
"//weblayer:weblayer_lib",
]
sources = [
"lib/webview_entry_point.cc",
]
}
shared_library("libwebviewchromium") {
deps = [
":webview_entry_point",
"//components/about_ui:about_ui_android",
]
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
configs += [ "//build/config/android:hide_all_but_jni" ]
}
if (android_64bit_target_cpu) {
android_assets("v8_snapshot_secondary_abi_assets") {
_secondary_abi_out_dir =
get_label_info("//v8($android_secondary_abi_toolchain)", "root_out_dir")
assert(android_64bit_target_cpu,
"32-bit targets shouldn't have secondary abi")
arch_suffix = "32"
if (use_v8_context_snapshot) {
renaming_sources = [ "$_secondary_abi_out_dir/v8_context_snapshot.bin" ]
renaming_destinations = [ "v8_context_snapshot_$arch_suffix.bin" ]
} else {
renaming_sources = [ "$_secondary_abi_out_dir/snapshot_blob.bin" ]
renaming_destinations = [ "snapshot_blob_$arch_suffix.bin" ]
}
disable_compression = true
deps = [
"//tools/v8_context_snapshot($android_secondary_abi_toolchain)",
"//v8($android_secondary_abi_toolchain)",
]
}
}
template("webview_library") {
chrome_common_shared_library(target_name) {
forward_variables_from(invoker, "*")
deps = [
":webview_entry_point",
]
is_webview = true
}
}
if (defined(android_secondary_abi_toolchain)) {
# Note here that on a given system, the webview-only library needs the same
# library name as the browser library, since the system webview factory will
# differentiate only by ABI.
if (current_toolchain == android_secondary_abi_toolchain) {
# This target is the 32-bit WebView library that pairs with a 64-bit
# browser. It is suffixed with _64 because its name must match the 64-bit
# browser library.
webview_library("monochrome_64") {
}
} else {
# Inverse of above, for the original 32-bit case.
webview_library("monochrome") {
}
}
} else {
# 32-bit WebView library used in 32-bit only builds of 64/32 targets.
webview_library("monochrome_64") {
}
}
if (enable_resource_whitelist_generation) {
generate_resource_whitelist("system_webview_pak_whitelist") {
deps = [
":libwebviewchromium",
]
inputs = [
"$root_out_dir/lib.unstripped/libwebviewchromium$shlib_extension",
]
output = system_webview_pak_whitelist
}
}
source_set("common") {
sources = [
"lib/aw_main_delegate.cc",
"lib/aw_main_delegate.h",
"lib/webview_jni_onload.cc",
"lib/webview_jni_onload.h",
]
deps = [
":browser_jni_headers",
"//android_webview/apk",
"//android_webview/browser",
"//android_webview/browser/gfx",
"//android_webview/common",
"//android_webview/gpu",
"//android_webview/renderer",
"//components/autofill/core/common",
"//components/crash/android:crashpad_main",
"//components/gwp_asan/buildflags",
"//components/safe_browsing/android:safe_browsing_api_handler",
"//components/services/heap_profiling/public/cpp",
"//components/spellcheck:buildflags",
"//components/spellcheck/common",
"//components/version_info",
"//components/version_info/android:channel_getter",
"//content/public/app:both",
"//content/public/browser",
"//content/public/common:content_descriptor_keys",
"//gin",
"//gpu/command_buffer/service",
"//gpu/ipc:gl_in_process_context",
"//ui/events:gesture_detection",
"//weblayer:weblayer_lib",
]
if (enable_gwp_asan) {
deps += [ "//components/gwp_asan/client" ]
}
}
java_group("android_webview_java") {
deps = [
":browser_java",
]
}
android_library("browser_java") {
java_files = [
"java/src/org/chromium/android_webview/AndroidProtocolHandler.java",
"java/src/org/chromium/android_webview/AutofillActionModeCallback.java",
"java/src/org/chromium/android_webview/AwActionModeCallback.java",
"java/src/org/chromium/android_webview/AwAutofillClient.java",
"java/src/org/chromium/android_webview/AwAutofillManager.java",
"java/src/org/chromium/android_webview/AwAutofillProvider.java",
"java/src/org/chromium/android_webview/AwAutofillUMA.java",
"java/src/org/chromium/android_webview/AwBrowserContext.java",
"java/src/org/chromium/android_webview/AwBrowserProcess.java",
"java/src/org/chromium/android_webview/AwConsoleMessage.java",
"java/src/org/chromium/android_webview/AwContents.java",
"java/src/org/chromium/android_webview/AwContentsBackgroundThreadClient.java",
"java/src/org/chromium/android_webview/AwContentsClient.java",
"java/src/org/chromium/android_webview/AwContentsClientBridge.java",
"java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java",
"java/src/org/chromium/android_webview/AwContentsIoThreadClient.java",
"java/src/org/chromium/android_webview/AwContentsLifecycleNotifier.java",
"java/src/org/chromium/android_webview/AwContentsStatics.java",
"java/src/org/chromium/android_webview/AwCookieManager.java",
"java/src/org/chromium/android_webview/AwDebug.java",
"java/src/org/chromium/android_webview/AwDevToolsServer.java",
"java/src/org/chromium/android_webview/AwFeatures.java",
"java/src/org/chromium/android_webview/AwFeatureList.java",
"java/src/org/chromium/android_webview/AwFirebaseConfig.java",
"java/src/org/chromium/android_webview/AwFormDatabase.java",
"java/src/org/chromium/android_webview/AwGeolocationPermissions.java",
"java/src/org/chromium/android_webview/AwHistogramRecorder.java",
"java/src/org/chromium/android_webview/AwHttpAuthHandler.java",
"java/src/org/chromium/android_webview/AwLayoutSizer.java",
"java/src/org/chromium/android_webview/AwNetworkChangeNotifierRegistrationPolicy.java",
"java/src/org/chromium/android_webview/AwPdfExporter.java",
"java/src/org/chromium/android_webview/AwPrintDocumentAdapter.java",
"java/src/org/chromium/android_webview/AwProxyController.java",
"java/src/org/chromium/android_webview/AwQuotaManagerBridge.java",
"java/src/org/chromium/android_webview/AwRenderProcess.java",
"java/src/org/chromium/android_webview/AwRenderProcessGoneDetail.java",
"java/src/org/chromium/android_webview/AwScrollOffsetManager.java",
"java/src/org/chromium/android_webview/AwServiceWorkerClient.java",
"java/src/org/chromium/android_webview/AwServiceWorkerController.java",
"java/src/org/chromium/android_webview/AwServiceWorkerSettings.java",
"java/src/org/chromium/android_webview/AwSettings.java",
"java/src/org/chromium/android_webview/AwSupportLibIsomorphic.java",
"java/src/org/chromium/android_webview/AwSwitches.java",
"java/src/org/chromium/android_webview/AwTracingController.java",
"java/src/org/chromium/android_webview/AwVariationsSeedBridge.java",
"java/src/org/chromium/android_webview/AwViewAndroidDelegate.java",
"java/src/org/chromium/android_webview/AwViewMethods.java",
"java/src/org/chromium/android_webview/AwWebContentsDelegate.java",
"java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java",
"java/src/org/chromium/android_webview/AwWebContentsObserver.java",
"java/src/org/chromium/android_webview/AwWebResourceInterceptResponse.java",
"java/src/org/chromium/android_webview/AwWebResourceResponse.java",
"java/src/org/chromium/android_webview/AwZoomControls.java",
"java/src/org/chromium/android_webview/CleanupReference.java",
"java/src/org/chromium/android_webview/ClientCertLookupTable.java",
"java/src/org/chromium/android_webview/DefaultVideoPosterRequestHandler.java",
"java/src/org/chromium/android_webview/ErrorCodeConversionHelper.java",
"java/src/org/chromium/android_webview/FindAddress.java",
"java/src/org/chromium/android_webview/FullScreenView.java",
"java/src/org/chromium/android_webview/HttpAuthDatabase.java",
"java/src/org/chromium/android_webview/InputStreamUtil.java",
"java/src/org/chromium/android_webview/JsPromptResultReceiver.java",
"java/src/org/chromium/android_webview/JsReplyProxy.java",
"java/src/org/chromium/android_webview/JsResultHandler.java",
"java/src/org/chromium/android_webview/JsResultReceiver.java",
"java/src/org/chromium/android_webview/NullAwViewMethods.java",
"java/src/org/chromium/android_webview/OverScrollGlow.java",
"java/src/org/chromium/android_webview/PopupTouchHandleDrawable.java",
"java/src/org/chromium/android_webview/ScrollAccessibilityHelper.java",
"java/src/org/chromium/android_webview/SslUtil.java",
"java/src/org/chromium/android_webview/VariationsSeedLoader.java",
"java/src/org/chromium/android_webview/ViewPositionObserver.java",
"java/src/org/chromium/android_webview/WebMessageListener.java",
"java/src/org/chromium/android_webview/WebMessageListenerHolder.java",
"java/src/org/chromium/android_webview/WebViewChromiumRunQueue.java",
"java/src/org/chromium/android_webview/gfx/AwDrawFnImpl.java",
"java/src/org/chromium/android_webview/gfx/AwFunctor.java",
"java/src/org/chromium/android_webview/gfx/AwGLFunctor.java",
"java/src/org/chromium/android_webview/gfx/AwPicture.java",
"java/src/org/chromium/android_webview/gfx/JavaBrowserViewRendererHelper.java",
"java/src/org/chromium/android_webview/metrics/AwMetricsLogUploader.java",
"java/src/org/chromium/android_webview/metrics/AwMetricsServiceClient.java",
"java/src/org/chromium/android_webview/safe_browsing/AwSafeBrowsingConfigHelper.java",
"java/src/org/chromium/android_webview/safe_browsing/AwSafeBrowsingConversionHelper.java",
"java/src/org/chromium/android_webview/safe_browsing/AwSafeBrowsingResponse.java",
"java/src/org/chromium/android_webview/permission/AwGeolocationCallback.java",
"java/src/org/chromium/android_webview/permission/AwPermissionRequest.java",
"java/src/org/chromium/android_webview/policy/AwPolicyProvider.java",
]
deps = [
":common_aidl_java",
":common_commandline_java",
":common_crash_java",
# This includes AwResource, which may be called via JNI. We're including it
# here because there's currently no good way to enforce that it gets included
# when it's depended on via JNI.
":common_java",
":common_platform_services_java",
":common_variations_utils_java",
":resources",
":system_webview_manifest",
"//base:base_java",
"//base:jni_java",
"//components/autofill/android:autofill_java",
"//components/autofill/android:provider_java",
"//components/background_task_scheduler:background_task_scheduler_task_ids_java",
"//components/content_capture/android:java",
"//components/crash/android:handler_java",
"//components/crash/android:java",
"//components/embedder_support/android:web_contents_delegate_java",
"//components/minidump_uploader:minidump_uploader_java",
"//components/navigation_interception/android:navigation_interception_java",
"//components/policy/android:policy_java",
"//components/safe_browsing/android:safe_browsing_java",
"//components/variations:load_seed_result_enum_java",
"//components/variations/android:variations_java",
"//components/version_info/android:version_constants_java",
"//components/viz/common:common_java",
"//content/public/android:content_java",
"//device/gamepad:java",
"//mojo/public/java:system_java",
"//mojo/public/java/system:system_impl_java",
"//net/android:net_java",
"//services/network/public/mojom:mojom_java",
"//third_party/android_deps:androidx_annotation_annotation_java",
"//third_party/blink/public:blink_headers_java",
"//ui/android:ui_java",
# These are needed for WebLayer.
"//components/viz/service:service_java",
"//weblayer/browser/java",
]
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
if (enable_spellcheck) {
deps += [ "//components/spellcheck/browser/android:java" ]
}
srcjar_deps = [
"//android_webview/browser:browser_enums",
"//components/safe_browsing/db:sb_threat_values",
]
android_manifest_for_lint = system_webview_android_manifest
min_sdk_version = 21
}
android_library("common_variations_utils_java") {
java_files = [ "java/src/org/chromium/android_webview/common/variations/VariationsUtils.java" ]
deps = [
"//android_webview/proto:aw_variations_seed_proto_java",
"//base:base_java",
"//components/variations/android:variations_java",
"//third_party/android_deps:com_google_protobuf_protobuf_lite_java",
]
}
java_strings_grd("strings_grd") {
grd_file = "java/strings/android_webview_strings.grd"
outputs = [
"values-am/android_webview_strings.xml",
"values-ar/android_webview_strings.xml",
"values-bg/android_webview_strings.xml",
"values-bn/android_webview_strings.xml",
"values-ca/android_webview_strings.xml",
"values-cs/android_webview_strings.xml",
"values-da/android_webview_strings.xml",
"values-de/android_webview_strings.xml",
"values-el/android_webview_strings.xml",
"values-en-rGB/android_webview_strings.xml",
"values-es/android_webview_strings.xml",
"values-es-rUS/android_webview_strings.xml",
"values-et/android_webview_strings.xml",
"values-fa/android_webview_strings.xml",
"values-fi/android_webview_strings.xml",
"values-fr/android_webview_strings.xml",
"values-gu/android_webview_strings.xml",
"values-hi/android_webview_strings.xml",
"values-hr/android_webview_strings.xml",
"values-hu/android_webview_strings.xml",
"values-in/android_webview_strings.xml",
"values-it/android_webview_strings.xml",
"values-iw/android_webview_strings.xml",
"values-ja/android_webview_strings.xml",
"values-kn/android_webview_strings.xml",
"values-ko/android_webview_strings.xml",
"values-lt/android_webview_strings.xml",
"values-lv/android_webview_strings.xml",
"values-ml/android_webview_strings.xml",
"values-mr/android_webview_strings.xml",
"values-ms/android_webview_strings.xml",
"values-nb/android_webview_strings.xml",
"values-nl/android_webview_strings.xml",
"values-pl/android_webview_strings.xml",
"values-pt-rBR/android_webview_strings.xml",
"values-pt-rPT/android_webview_strings.xml",
"values-ro/android_webview_strings.xml",
"values-ru/android_webview_strings.xml",
"values-sk/android_webview_strings.xml",
"values-sl/android_webview_strings.xml",
"values-sr/android_webview_strings.xml",
"values-sv/android_webview_strings.xml",
"values-sw/android_webview_strings.xml",
"values-ta/android_webview_strings.xml",
"values-te/android_webview_strings.xml",
"values-th/android_webview_strings.xml",
"values-tl/android_webview_strings.xml",
"values-tr/android_webview_strings.xml",
"values-uk/android_webview_strings.xml",
"values-vi/android_webview_strings.xml",
"values-zh-rCN/android_webview_strings.xml",
"values-zh-rTW/android_webview_strings.xml",
"values/android_webview_strings.xml",
]
}
# Separate target to allow for a dependency on GmsCore without pulling in all of
# android_webview_java. It compiles the abstract class; implementations are
# compiled separately.
android_library("common_platform_services_java") {
java_files = [
"java/src/org/chromium/android_webview/common/PlatformServiceBridge.java",
"java/src/org/chromium/android_webview/common/PlatformServiceBridgeImpl.java",
]
deps = [
"//base:base_java",
"//third_party/android_deps:androidx_annotation_annotation_java",
]
# The appropriate .class file will be loaded via a dependency to a library
# like :platform_service_bridge_upstream_implementation_java below. We only include the
# .java file because other files in the target depend on it.
jar_excluded_patterns = [ "*/PlatformServiceBridgeImpl.class" ]
}
# This target compiles the implementation of PlatformServiceBridge for AOSP targets.
android_library("platform_service_bridge_upstream_implementation_java") {
java_files = [ "java/src/org/chromium/android_webview/common/PlatformServiceBridgeImpl.java" ]
deps = [
":common_platform_services_java",
]
}
android_library("common_crash_java") {
java_files = [
"java/src/org/chromium/android_webview/common/crash/AwCrashReporterClient.java",
"java/src/org/chromium/android_webview/common/crash/CrashInfo.java",
"java/src/org/chromium/android_webview/common/crash/SystemWideCrashDirectories.java",
]
deps = [
"//base:base_java",
"//base:jni_java",
]
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
}
android_library("common_java") {
java_files = [
"java/src/org/chromium/android_webview/common/AwResource.java",
"java/src/org/chromium/android_webview/common/services/ServiceNames.java",
]
deps = [
"//base:base_java",
]
}
android_library("common_commandline_java") {
java_files =
[ "java/src/org/chromium/android_webview/common/CommandLineUtil.java" ]
deps = [
"//base:base_java",
]
}
android_aidl("common_aidl") {
import_include = [ "java/src" ]
sources = [
"java/src/org/chromium/android_webview/common/services/ICrashReceiverService.aidl",
"java/src/org/chromium/android_webview/common/services/IVariationsSeedServer.aidl",
]
}
android_library("common_aidl_java") {
srcjar_deps = [ ":common_aidl" ]
}
# Generate LocaleConfig.java so that android_webview_locale_config_java's
# compile step works.
generate_locale_config_srcjar("webview_locale_config") {
java_package = webview_locale_config_java_package
}
# LocaleConfig.java is excluded from the generated .jar
# (via. jar_excluded_patterns) and the final version is inserted at the APK
# level - with the list of pak locales populated by looking at the assets that
# are listed in the final APK's .build_config.
android_library("android_webview_locale_config_java") {
java_files = [ "java/src/org/chromium/android_webview/AwLocaleConfig.java" ]
srcjar_deps = [ ":webview_locale_config" ]
jar_excluded_patterns = [ "*/LocaleConfig.class" ]
}
if (public_android_sdk) {
system_webview_apk_tmpl("system_webview_apk") {
android_manifest = system_webview_android_manifest
android_manifest_dep = ":system_webview_manifest"
deps = upstream_only_webview_deps
apk_name = "SystemWebView"
min_sdk_version = 21
}
android_resource_sizes_test("resource_sizes_system_webview_apk") {
apk_name = "SystemWebView"
data_deps = [
":system_webview_apk",
]
}
system_webview_apk_tmpl("trichrome_webview_apk") {
android_manifest = trichrome_webview_android_manifest
android_manifest_dep = ":trichrome_webview_manifest"
# TODO(torne): make minsdk=Q once we no longer build hacky P version
min_sdk_version = android_sdk_version
deps = upstream_only_webview_deps
apk_name = "TrichromeWebView"
use_trichrome_library = true
uncompress_dex = use_uncompressed_dex
if (trichrome_synchronized_proguard) {
static_library_provider = "//chrome/android:trichrome_library_apk"
}
}
system_webview_apk_tmpl("trichrome_webview_64_32_apk") {
android_manifest = trichrome_webview_64_32_android_manifest
android_manifest_dep = ":trichrome_webview_64_32_manifest"
is_64_bit_browser = true
# TODO(torne): make minsdk=Q once we no longer build hacky P version
min_sdk_version = android_sdk_version
deps = upstream_only_webview_deps
apk_name = "TrichromeWebView6432"
use_trichrome_library = true
uncompress_dex = use_uncompressed_dex
if (trichrome_synchronized_proguard) {
static_library_provider = "//chrome/android:trichrome_library_apk"
}
}
# This target should be removed once Trichrome only supports Chrome bundle
# builds.
system_webview_apk_tmpl("trichrome_webview_for_bundle_apk") {
android_manifest = trichrome_webview_android_manifest
android_manifest_dep = ":trichrome_webview_manifest"
# TODO(torne): make minsdk=Q once we no longer build hacky P version
min_sdk_version = android_sdk_version
deps = upstream_only_webview_deps
apk_name = "TrichromeWebViewForBundle"
use_trichrome_library = true
uncompress_dex = use_uncompressed_dex
if (trichrome_synchronized_proguard) {
static_library_provider =
"//chrome/android:trichrome_library_for_bundle_apk"
}
}
}