# Copyright 2017 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("//build/config/android/rules.gni") generate_jni("nonembedded_jni_headers") { sources = [ "java/src/org/chromium/android_webview/nonembedded/WebViewApkApplication.java" ] } # Contains classes needed by the webview apk, but not used when loading the apk # as a library. android_library("nonembedded_java") { sources = [ "java/src/org/chromium/android_webview/nonembedded/AwNonembeddedUmaRecorder.java", "java/src/org/chromium/android_webview/nonembedded/LicenseActivity.java", "java/src/org/chromium/android_webview/nonembedded/LicenseContentProvider.java", "java/src/org/chromium/android_webview/nonembedded/WebViewApkApplication.java", ] deps = [ ":devui_java", ":services_java", "//android_webview:android_webview_product_config_java", "//android_webview:common_aidl_java", "//android_webview:common_java", "//android_webview/proto:metrics_bridge_records_proto_java", "//base:base_java", "//base:jni_java", "//components/about_ui/android:aboutui_java", "//components/embedder_support/android:application_java", "//third_party/android_deps:com_google_protobuf_protobuf_javalite_java", "//ui/android:ui_java", ] annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] } android_library("devui_java") { sources = [ "java/src/org/chromium/android_webview/devui/CrashesListFragment.java", "java/src/org/chromium/android_webview/devui/DevUiBaseFragment.java", "java/src/org/chromium/android_webview/devui/FlagsFragment.java", "java/src/org/chromium/android_webview/devui/HomeFragment.java", "java/src/org/chromium/android_webview/devui/MainActivity.java", "java/src/org/chromium/android_webview/devui/PersistentErrorView.java", "java/src/org/chromium/android_webview/devui/WebViewPackageError.java", "java/src/org/chromium/android_webview/devui/util/CrashBugUrlFactory.java", "java/src/org/chromium/android_webview/devui/util/CrashInfoLoader.java", "java/src/org/chromium/android_webview/devui/util/UnuploadedFilesStateLoader.java", "java/src/org/chromium/android_webview/devui/util/UploadedCrashesInfoLoader.java", "java/src/org/chromium/android_webview/devui/util/WebViewCrashInfoCollector.java", "java/src/org/chromium/android_webview/devui/util/WebViewCrashLogParser.java", "java/src/org/chromium/android_webview/devui/util/WebViewPackageHelper.java", ] deps = [ ":devui_resources", ":system_webview_manifest", "//android_webview:common_aidl_java", "//android_webview:common_crash_java", "//android_webview:common_java", "//android_webview:common_platform_services_java", "//base:base_java", "//components/minidump_uploader:minidump_uploader_java", "//components/version_info/android:version_constants_java", "//third_party/android_deps:androidx_annotation_annotation_java", "//third_party/android_deps:androidx_fragment_fragment_java", "//ui/android:ui_java", ] } android_library("services_java") { sources = [ "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/DeveloperModeContentProvider.java", "java/src/org/chromium/android_webview/services/DeveloperUiService.java", "java/src/org/chromium/android_webview/services/MetricsBridgeService.java", "java/src/org/chromium/android_webview/services/VariationsSeedHolder.java", "java/src/org/chromium/android_webview/services/VariationsSeedServer.java", ] deps = [ ":system_webview_manifest", "//android_webview:common_aidl_java", "//android_webview:common_crash_java", "//android_webview:common_java", "//android_webview:common_platform_services_java", "//android_webview:common_variations_java", "//android_webview/proto:metrics_bridge_records_proto_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", "//third_party/android_deps:com_google_protobuf_protobuf_javalite_java", ] } source_set("nonembedded") { sources = [ "webview_apk_application.cc" ] deps = [ ":nonembedded_jni_headers", "//android_webview/common", "//base", # Called via JNI by LicenseContentProvider in :nonembedded_java. "//components/about_ui:about_ui_android", ] } # WebView icon used by upstream SystemWebView and Trichrome. android_resources("icon_resources") { sources = [ "java/res_icon/drawable-hdpi/icon_webview.png", "java/res_icon/drawable-mdpi/icon_webview.png", "java/res_icon/drawable-xhdpi/icon_webview.png", "java/res_icon/drawable-xxhdpi/icon_webview.png", ] custom_package = "org.chromium.android_webview.icon" } android_resources("devui_resources") { sources = [ "java/res_devui/drawable/blue_circle.xml", "java/res_devui/drawable/ic_action_home.xml", "java/res_devui/drawable/ic_alert_error.xml", "java/res_devui/drawable/ic_flag.xml", "java/res_devui/layout/activity_main.xml", "java/res_devui/layout/crashes_list_item_body.xml", "java/res_devui/layout/crashes_list_item_header.xml", "java/res_devui/layout/flag_states.xml", "java/res_devui/layout/fragment_crashes_list.xml", "java/res_devui/layout/fragment_flags.xml", "java/res_devui/layout/fragment_home.xml", "java/res_devui/layout/persistent_error_message.xml", "java/res_devui/layout/toggleable_flag.xml", "java/res_devui/layout/two_line_list_item.xml", "java/res_devui/layout/two_line_sublist_item.xml", "java/res_devui/menu/crashes_options_menu.xml", "java/res_devui/menu/options_menu.xml", "java/res_devui/values-night/colors.xml", "java/res_devui/values-night/styles.xml", "java/res_devui/values/colors.xml", "java/res_devui/values/strings.xml", "java/res_devui/values/styles.xml", ] custom_package = "org.chromium.android_webview.devui" } android_resources("devui_launcher_icon_resources") { sources = [] custom_package = "org.chromium.android_webview.devui.icon" android_manifest = "java/DeveloperUiLauncherManifest.xml" } android_resources("monochrome_devui_launcher_icon_resources") { sources = [] android_manifest = "java/MonochromeDeveloperUiLauncherManifest.xml" custom_package = "org.chromium.android_webview.devui.icon" } jinja_template("system_webview_manifest") { input = "java/AndroidManifest.xml" output = system_webview_android_manifest variables = [ "manifest_package=$system_webview_package_name" ] } jinja_template("trichrome_webview_manifest") { input = "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", ] } if (android_64bit_target_cpu) { jinja_template("trichrome_webview_64_32_manifest") { input = "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", ] } jinja_template("trichrome_webview_32_manifest") { input = "java/AndroidManifest.xml" output = trichrome_webview_32_android_manifest variables = trichrome_jinja_variables + [ "trichrome_version=$trichrome_32_version_code", "manifest_package=$system_webview_package_name", "library=libmonochrome.so", ] } }