blob: 5c80d0c4fcef2a76d97c71c24c295b6bb8240e63 [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",
]
}
generate_jni("native_jni") {
sources = [
"apk/java/src/com/android/webview/chromium/WebViewApkApplication.java",
"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/AwMetricsLogUploader.java",
"java/src/org/chromium/android_webview/AwMetricsServiceClient.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/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/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/permission/AwPermissionRequest.java",
]
deps = [
":cancellation_signal_android_jar_jni_headers",
]
}
generate_jar_jni("cancellation_signal_android_jar_jni_headers") {
classes = [ "android/os/CancellationSignal.class" ]
}
java_cpp_enum("aw_permission_request_resource") {
sources = [
"browser/permission/aw_permission_request.h",
]
}
java_cpp_enum("android_webview_java_enums_srcjar") {
sources = [
"browser/aw_renderer_priority.h",
]
}
java_cpp_enum("aw_error_ui") {
sources = [
"browser/safe_browsing/aw_safe_browsing_blocking_page.h",
]
}
java_cpp_enum("aw_safe_browsing_action") {
sources = [
"browser/safe_browsing/aw_url_checker_delegate_impl.h",
]
}
java_cpp_enum("aw_settings_force_dark_mode") {
sources = [
"browser/aw_settings.h",
]
}
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 + [
"manifest_package=$system_webview_package_name",
"library=libmonochrome.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",
"$target_gen_dir/aw_resources.pak",
"$target_gen_dir/components_resources.pak",
"$target_gen_dir/webui_resources.pak",
]
deps = [
":generate_aw_resources",
":generate_components_resources",
":generate_webui_resources",
"//content:resources",
"//net:net_resources",
"//third_party/blink/public: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("system_webview_resources") {
resource_dirs = [ "apk/java/res" ]
custom_package = system_webview_package_name
}
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_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",
]
sources = [
"lib/webview_entry_point.cc",
]
}
shared_library("libwebviewchromium") {
deps = [
":webview_entry_point",
]
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 {
sources = [
"$root_out_dir/natives_blob.bin",
]
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)",
]
}
}
if (defined(android_secondary_abi_toolchain)) {
template("webview_library") {
chrome_common_shared_library(target_name) {
forward_variables_from(invoker, "*")
deps = [
":webview_entry_point",
]
is_webview = true
}
}
# 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") {
}
}
}
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 = [
"apk/webview_apk_application.cc",
"browser/android_protocol_handler.cc",
"browser/android_protocol_handler.h",
"browser/aw_autofill_client.cc",
"browser/aw_autofill_client.h",
"browser/aw_browser_context.cc",
"browser/aw_browser_context.h",
"browser/aw_browser_main_parts.cc",
"browser/aw_browser_main_parts.h",
"browser/aw_browser_permission_request_delegate.h",
"browser/aw_browser_policy_connector.cc",
"browser/aw_browser_policy_connector.h",
"browser/aw_browser_process.cc",
"browser/aw_browser_process.h",
"browser/aw_browser_terminator.cc",
"browser/aw_browser_terminator.h",
"browser/aw_content_browser_client.cc",
"browser/aw_content_browser_client.h",
"browser/aw_content_browser_overlay_manifest.cc",
"browser/aw_content_browser_overlay_manifest.h",
"browser/aw_content_renderer_overlay_manifest.cc",
"browser/aw_content_renderer_overlay_manifest.h",
"browser/aw_contents.cc",
"browser/aw_contents.h",
"browser/aw_contents_client_bridge.cc",
"browser/aw_contents_client_bridge.h",
"browser/aw_contents_io_thread_client.cc",
"browser/aw_contents_io_thread_client.h",
"browser/aw_contents_lifecycle_notifier.cc",
"browser/aw_contents_lifecycle_notifier.h",
"browser/aw_contents_statics.cc",
"browser/aw_cookie_access_policy.cc",
"browser/aw_cookie_access_policy.h",
"browser/aw_debug.cc",
"browser/aw_devtools_manager_delegate.cc",
"browser/aw_devtools_manager_delegate.h",
"browser/aw_devtools_server.cc",
"browser/aw_devtools_server.h",
"browser/aw_download_manager_delegate.cc",
"browser/aw_download_manager_delegate.h",
"browser/aw_feature_list.cc",
"browser/aw_feature_list.h",
"browser/aw_feature_list_creator.cc",
"browser/aw_feature_list_creator.h",
"browser/aw_form_database.cc",
"browser/aw_form_database_service.cc",
"browser/aw_form_database_service.h",
"browser/aw_http_auth_handler.cc",
"browser/aw_http_auth_handler.h",
"browser/aw_javascript_dialog_manager.cc",
"browser/aw_javascript_dialog_manager.h",
"browser/aw_media_url_interceptor.cc",
"browser/aw_media_url_interceptor.h",
"browser/aw_metrics_log_uploader.cc",
"browser/aw_metrics_log_uploader.h",
"browser/aw_metrics_service_client.cc",
"browser/aw_metrics_service_client.h",
"browser/aw_pdf_exporter.cc",
"browser/aw_pdf_exporter.h",
"browser/aw_permission_manager.cc",
"browser/aw_permission_manager.h",
"browser/aw_print_manager.cc",
"browser/aw_print_manager.h",
"browser/aw_proxy_controller.cc",
"browser/aw_quota_manager_bridge.cc",
"browser/aw_quota_manager_bridge.h",
"browser/aw_quota_permission_context.cc",
"browser/aw_quota_permission_context.h",
"browser/aw_render_process.cc",
"browser/aw_render_process.h",
"browser/aw_render_process_gone_delegate.h",
"browser/aw_renderer_priority.h",
"browser/aw_resource_context.cc",
"browser/aw_resource_context.h",
"browser/aw_settings.cc",
"browser/aw_settings.h",
"browser/aw_speech_recognition_manager_delegate.cc",
"browser/aw_speech_recognition_manager_delegate.h",
"browser/aw_ssl_host_state_delegate.cc",
"browser/aw_ssl_host_state_delegate.h",
"browser/aw_variations_seed_bridge.cc",
"browser/aw_variations_seed_bridge.h",
"browser/aw_variations_service_client.cc",
"browser/aw_variations_service_client.h",
"browser/aw_web_contents_delegate.cc",
"browser/aw_web_contents_delegate.h",
"browser/aw_web_contents_view_delegate.cc",
"browser/aw_web_contents_view_delegate.h",
"browser/aw_web_ui_controller_factory.cc",
"browser/aw_web_ui_controller_factory.h",
"browser/cookie_manager.cc",
"browser/cookie_manager.h",
"browser/find_helper.cc",
"browser/find_helper.h",
"browser/icon_helper.cc",
"browser/icon_helper.h",
"browser/input_stream.cc",
"browser/input_stream.h",
"browser/js_java_interaction/js_api_handler.cc",
"browser/js_java_interaction/js_api_handler.h",
"browser/js_java_interaction/js_api_handler_factory.cc",
"browser/js_java_interaction/js_api_handler_factory.h",
"browser/js_java_interaction/js_java_configurator_host.cc",
"browser/js_java_interaction/js_java_configurator_host.h",
"browser/js_java_interaction/js_reply_proxy.cc",
"browser/js_java_interaction/js_reply_proxy.h",
"browser/memory_metrics_logger.cc",
"browser/memory_metrics_logger.h",
"browser/network_service/android_stream_reader_url_loader.cc",
"browser/network_service/android_stream_reader_url_loader.h",
"browser/network_service/aw_network_change_notifier.cc",
"browser/network_service/aw_network_change_notifier.h",
"browser/network_service/aw_network_change_notifier_factory.cc",
"browser/network_service/aw_network_change_notifier_factory.h",
"browser/network_service/aw_proxy_config_monitor.cc",
"browser/network_service/aw_proxy_config_monitor.h",
"browser/network_service/aw_proxying_restricted_cookie_manager.cc",
"browser/network_service/aw_proxying_restricted_cookie_manager.h",
"browser/network_service/aw_proxying_url_loader_factory.cc",
"browser/network_service/aw_proxying_url_loader_factory.h",
"browser/network_service/aw_url_loader_throttle.cc",
"browser/network_service/aw_url_loader_throttle.h",
"browser/network_service/aw_web_resource_request.cc",
"browser/network_service/aw_web_resource_request.h",
"browser/network_service/aw_web_resource_response.cc",
"browser/network_service/aw_web_resource_response.h",
"browser/network_service/input_stream_reader.cc",
"browser/network_service/input_stream_reader.h",
"browser/network_service/net_helpers.cc",
"browser/network_service/net_helpers.h",
"browser/permission/aw_permission_request.cc",
"browser/permission/aw_permission_request.h",
"browser/permission/aw_permission_request_delegate.cc",
"browser/permission/aw_permission_request_delegate.h",
"browser/permission/media_access_permission_request.cc",
"browser/permission/media_access_permission_request.h",
"browser/permission/permission_request_handler.cc",
"browser/permission/permission_request_handler.h",
"browser/permission/permission_request_handler_client.cc",
"browser/permission/permission_request_handler_client.h",
"browser/permission/simple_permission_request.cc",
"browser/permission/simple_permission_request.h",
"browser/popup_touch_handle_drawable.cc",
"browser/popup_touch_handle_drawable.h",
"browser/renderer_host/auto_login_parser.cc",
"browser/renderer_host/auto_login_parser.h",
"browser/renderer_host/aw_render_view_host_ext.cc",
"browser/renderer_host/aw_render_view_host_ext.h",
"browser/safe_browsing/aw_safe_browsing_blocking_page.cc",
"browser/safe_browsing/aw_safe_browsing_blocking_page.h",
"browser/safe_browsing/aw_safe_browsing_ui_manager.cc",
"browser/safe_browsing/aw_safe_browsing_ui_manager.h",
"browser/safe_browsing/aw_safe_browsing_whitelist_manager.cc",
"browser/safe_browsing/aw_safe_browsing_whitelist_manager.h",
"browser/safe_browsing/aw_url_checker_delegate_impl.cc",
"browser/safe_browsing/aw_url_checker_delegate_impl.h",
"browser/scoped_add_feature_flags.cc",
"browser/scoped_add_feature_flags.h",
"browser/state_serializer.cc",
"browser/state_serializer.h",
"browser/tracing/aw_trace_event_args_whitelist.cc",
"browser/tracing/aw_trace_event_args_whitelist.h",
"browser/tracing/aw_tracing_controller.cc",
"browser/tracing/aw_tracing_controller.h",
"browser/tracing/aw_tracing_delegate.cc",
"browser/tracing/aw_tracing_delegate.h",
"lib/aw_main_delegate.cc",
"lib/aw_main_delegate.h",
"lib/webview_jni_onload.cc",
"lib/webview_jni_onload.h",
]
public_deps = [
"//base",
]
deps = [
":generate_aw_resources",
":generate_aw_strings",
":generate_components_strings",
":native_jni",
"//android_webview/browser/gfx:gfx",
"//android_webview/common",
"//android_webview/common:common_mojom",
"//android_webview/gpu",
"//android_webview/public",
"//android_webview/renderer",
"//base/third_party/dynamic_annotations:dynamic_annotations",
"//components/about_ui",
"//components/autofill/android:provider",
"//components/autofill/content/browser",
"//components/autofill/content/common/mojom",
"//components/autofill/content/renderer",
"//components/cdm/browser",
"//components/cdm/renderer",
"//components/content_capture/android",
"//components/content_capture/browser",
"//components/content_capture/renderer",
"//components/crash/android:crashpad_main",
"//components/crash/content/app",
"//components/crash/content/browser",
"//components/crash/core/common",
"//components/download/public/common:public",
"//components/embedder_support/android:web_contents_delegate",
"//components/google/core/common",
"//components/gwp_asan/buildflags",
"//components/heap_profiling",
"//components/keyed_service/content",
"//components/metrics",
"//components/metrics:gpu",
"//components/metrics:metrics",
"//components/metrics:net",
"//components/metrics:ui",
"//components/minidump_uploader",
"//components/navigation_interception",
"//components/network_session_configurator/common",
"//components/policy:generated",
"//components/policy/content/",
"//components/policy/core/browser",
"//components/policy/core/common",
"//components/prefs",
"//components/printing/browser",
"//components/printing/common",
"//components/printing/renderer",
"//components/safe_browsing",
"//components/safe_browsing/android:safe_browsing_mobile",
"//components/safe_browsing/browser",
"//components/safe_browsing/common",
"//components/safe_browsing/renderer:throttles",
"//components/safe_browsing/triggers",
"//components/safe_browsing/web_ui",
"//components/services/heap_profiling",
"//components/services/heap_profiling/public/cpp",
"//components/services/heap_profiling/public/mojom",
"//components/spellcheck:buildflags",
"//components/spellcheck/common:interfaces",
"//components/url_matcher",
"//components/variations/service",
"//components/version_info:channel",
"//components/version_info/android:channel_getter",
"//components/visitedlink/browser",
"//components/visitedlink/renderer",
"//components/viz/service",
"//content",
"//content/public/app:both",
"//content/public/browser",
"//content/public/common",
"//content/public/common:content_descriptor_keys",
"//content/public/common:service_names",
"//crypto",
"//gin",
"//media",
"//media/midi",
"//media/mojo:buildflags",
"//net",
"//net:extras",
"//printing",
"//services/preferences/tracked:tracked",
"//services/resource_coordinator/public/cpp/memory_instrumentation",
"//services/resource_coordinator/public/cpp/memory_instrumentation:browser",
"//services/service_manager/public/cpp",
"//storage/browser",
"//storage/common",
"//third_party/blink/public:blink",
"//third_party/blink/public/common",
"//third_party/crashpad/crashpad/client",
"//ui/base",
"//ui/events:gesture_detection",
"//ui/shell_dialogs",
"//url",
"//v8",
]
if (enable_spellcheck) {
deps += [
"//components/spellcheck/browser",
"//components/spellcheck/renderer",
]
}
if (enable_gwp_asan) {
deps += [ "//components/gwp_asan/client" ]
}
configs += [
"//tools/v8_context_snapshot:use_v8_context_snapshot",
"//v8:external_startup_data",
]
}
android_library("android_webview_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/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/AwMetricsLogUploader.java",
"java/src/org/chromium/android_webview/AwMetricsServiceClient.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/AwSafeBrowsingConfigHelper.java",
"java/src/org/chromium/android_webview/AwSafeBrowsingConversionHelper.java",
"java/src/org/chromium/android_webview/AwSafeBrowsingResponse.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/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/ResourcesContextWrapperFactory.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/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/permission/AwGeolocationCallback.java",
"java/src/org/chromium/android_webview/permission/AwPermissionRequest.java",
"java/src/org/chromium/android_webview/policy/AwPolicyProvider.java",
"java/src/org/chromium/android_webview/ui/CrashesListActivity.java",
"java/src/org/chromium/android_webview/ui/util/CrashInfoLoader.java",
"java/src/org/chromium/android_webview/ui/util/UnuploadedFilesStateLoader.java",
"java/src/org/chromium/android_webview/ui/util/UploadedCrashesInfoLoader.java",
"java/src/org/chromium/android_webview/ui/util/WebViewCrashInfoCollector.java",
"java/src/org/chromium/android_webview/ui/util/WebViewCrashLogParser.java",
]
deps = [
":common_commandline_java",
":common_crash_info_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",
":services_java",
":strings_grd",
":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",
"//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:com_android_support_support_annotations_java",
"//third_party/blink/public:blink_headers_java",
"//ui/android:ui_java",
]
annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
if (enable_spellcheck) {
deps += [ "//components/spellcheck/browser/android:java" ]
}
srcjar_deps = [
":aw_permission_request_resource",
":android_webview_java_enums_srcjar",
":aw_error_ui",
":aw_safe_browsing_action",
":aw_settings_force_dark_mode",
"//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:com_android_support_support_annotations_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_info_java") {
java_files =
[ "java/src/org/chromium/android_webview/common/crash/CrashInfo.java" ]
deps = [
"//base:base_java",
]
}
android_library("common_java") {
java_files =
[ "java/src/org/chromium/android_webview/common/AwResource.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("services_variations_seed_server_aidl") {
import_include = [ "java/src" ]
sources = [
"java/src/org/chromium/android_webview/services/IVariationsSeedServer.aidl",
]
}
android_aidl("services_crash_receiver_aidl") {
import_include = [ "java/src" ]
sources = [
"java/src/org/chromium/android_webview/services/ICrashReceiverService.aidl",
]
}
# Keep WebView's services separate from other WebView code to keep their deps clean
# (and make them easy to move).
android_library("services_java") {
java_files = [
"java/src/org/chromium/android_webview/services/AwMinidumpUploadJobService.java",
"java/src/org/chromium/android_webview/services/AwMinidumpUploaderDelegate.java",
"java/src/org/chromium/android_webview/services/AwVariationsSeedFetcher.java",
"java/src/org/chromium/android_webview/services/CrashReceiverService.java",
"java/src/org/chromium/android_webview/services/VariationsSeedHolder.java",
"java/src/org/chromium/android_webview/services/VariationsSeedServer.java",
]
deps = [
":common_commandline_java",
":common_crash_info_java",
":common_platform_services_java",
":common_variations_utils_java",
":system_webview_manifest",
"//android_webview/apk:apk_java",
"//base:base_java",
"//components/background_task_scheduler:background_task_scheduler_task_ids_java",
"//components/minidump_uploader:minidump_uploader_java",
"//components/variations/android:variations_java",
"//components/version_info/android:version_constants_java",
]
srcjar_deps = [
":services_crash_receiver_aidl",
":services_variations_seed_server_aidl",
]
android_manifest_for_lint = system_webview_android_manifest
min_sdk_version = 21
}
# 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"
}
}
# 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"
}
}
}