summaryrefslogtreecommitdiff
path: root/chromium/ios/web_view
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ios/web_view')
-rw-r--r--chromium/ios/web_view/BUILD.gn50
-rw-r--r--chromium/ios/web_view/features.gni11
-rw-r--r--chromium/ios/web_view/shell/BUILD.gn23
-rw-r--r--chromium/ios/web_view/shell/test/BUILD.gn11
-rw-r--r--chromium/ios/web_view/test/BUILD.gn1
5 files changed, 69 insertions, 27 deletions
diff --git a/chromium/ios/web_view/BUILD.gn b/chromium/ios/web_view/BUILD.gn
index 627cb45bafe..23240a5d1fa 100644
--- a/chromium/ios/web_view/BUILD.gn
+++ b/chromium/ios/web_view/BUILD.gn
@@ -5,6 +5,7 @@
import("//build/config/ios/ios_sdk.gni")
import("//build/config/ios/rules.gni")
import("//build/config/locales.gni")
+import("//build/mac/tweak_info_plist.gni")
import("//components/cronet/native/include/headers.gni")
import("//components/grpc_support/include/headers.gni")
import("//ios/build/config.gni")
@@ -278,6 +279,7 @@ source_set("web_view_sources") {
"//components/pref_registry",
"//components/prefs",
"//components/proxy_config",
+ "//components/safe_browsing/core/common:safe_browsing_prefs",
"//components/security_state/ios",
"//components/signin/core/browser",
"//components/signin/ios/browser",
@@ -303,6 +305,7 @@ source_set("web_view_sources") {
"//ios/components/webui:url_constants",
"//ios/components/webui/sync_internals",
"//ios/net",
+ "//ios/third_party/webkit",
"//ios/web",
"//ios/web/common",
"//ios/web/common:user_agent",
@@ -327,8 +330,32 @@ source_set("web_view_sources") {
]
}
-# Generate the umbrella header.
-action("web_view_umbrella_header") {
+# Two umbrella headers may be generated:
+# - One that matches ios_web_view_output_name, e.g. CronetChromeWebView.h
+# - Another that is hardcoded as ChromeWebView.h
+#
+# This is needed to fix the issue where the generated .modulemap points to a
+# non-existent umbrella header.
+#
+# TODO(crbug.com/1084855): Remove :web_view_umbrella_header_old after all
+# clients migrate off of it.
+if (ios_web_view_generate_extra_umbrella_header) {
+ action("web_view_umbrella_header") {
+ script = "//build/config/ios/generate_umbrella_header.py"
+
+ full_header_path = target_gen_dir + "/" + ios_web_view_output_name + ".h"
+ outputs = [ full_header_path ]
+
+ args = [
+ "--output-path",
+ rebase_path(full_header_path, root_build_dir),
+ ]
+
+ args += rebase_path(ios_web_view_public_headers, root_build_dir)
+ }
+}
+
+action("web_view_umbrella_header_old") {
script = "//build/config/ios/generate_umbrella_header.py"
full_header_path = target_gen_dir + "/ChromeWebView.h"
@@ -342,12 +369,19 @@ action("web_view_umbrella_header") {
args += rebase_path(ios_web_view_public_headers, root_build_dir)
}
+tweak_info_plist("info_plist") {
+ info_plists = [ "Info.plist" ]
+}
+
ios_framework_bundle("web_view") {
output_name = ios_web_view_output_name
- info_plist = "Info.plist"
+ info_plist_target = ":info_plist"
- public_headers = ios_web_view_public_headers
- public_headers += get_target_outputs(":web_view_umbrella_header")
+ public_headers = get_target_outputs(":web_view_umbrella_header_old")
+ if (ios_web_view_generate_extra_umbrella_header) {
+ public_headers += get_target_outputs(":web_view_umbrella_header")
+ }
+ public_headers += ios_web_view_public_headers
if (ios_web_view_include_cronet) {
public_headers += [ "//components/cronet/ios/Cronet.h" ]
public_headers += grpc_public_headers
@@ -362,10 +396,14 @@ ios_framework_bundle("web_view") {
deps = [
":web_view_sources",
- ":web_view_umbrella_header",
+ "//ios/third_party/webkit",
"//ios/web/public/init",
"//testing/gtest:ios_coverage_utils",
]
+ deps += [ ":web_view_umbrella_header_old" ]
+ if (ios_web_view_generate_extra_umbrella_header) {
+ deps += [ ":web_view_umbrella_header" ]
+ }
if (ios_web_view_include_cronet) {
deps += [ "//components/cronet/ios:cronet_sources" ]
}
diff --git a/chromium/ios/web_view/features.gni b/chromium/ios/web_view/features.gni
index 6d731811537..772ba8f1f98 100644
--- a/chromium/ios/web_view/features.gni
+++ b/chromium/ios/web_view/features.gni
@@ -9,3 +9,14 @@ declare_args() {
# Controls the output name of the built framework.
ios_web_view_output_name = "ChromeWebView"
}
+
+declare_args() {
+ # If ios_web_view_output_name is overriden, e.g. to CronetChromeWebView, we
+ # need to generate an extra umbrella header to match the output name of the
+ # framework bundle.
+ #
+ # TODO(crbug.com/1084855): Remove this after all clients migrate to the
+ # umbrella header that matches the framework.
+ ios_web_view_generate_extra_umbrella_header =
+ ios_web_view_output_name != "ChromeWebView"
+}
diff --git a/chromium/ios/web_view/shell/BUILD.gn b/chromium/ios/web_view/shell/BUILD.gn
index 70bb0f1199e..3920690e072 100644
--- a/chromium/ios/web_view/shell/BUILD.gn
+++ b/chromium/ios/web_view/shell/BUILD.gn
@@ -3,7 +3,6 @@
# found in the LICENSE file.
import("//build/config/ios/rules.gni")
-import("//ios/third_party/features.gni")
declare_args() {
# Authorization service implementation used in ios_web_view_shell. Uses a fake
@@ -40,18 +39,16 @@ ios_app_bundle("ios_web_view_shell") {
]
entitlements_path = ios_web_view_shell_entitlements_path
- if (ios_third_party_material_components_built_as_framework) {
- if (ios_web_view_shell_links_with_material_components_framework) {
- deps += [
- "//ios/third_party/material_components_ios:material_components_ios+bundle",
- "//ios/third_party/material_components_ios:material_components_ios+link",
- ]
- } else {
- assert_no_deps = [
- "//ios/third_party/material_components_ios:material_components_ios+bundle",
- "//ios/third_party/material_components_ios:material_components_ios+link",
- ]
- }
+ if (ios_web_view_shell_links_with_material_components_framework) {
+ deps += [
+ "//ios/third_party/material_components_ios:material_components_ios+bundle",
+ "//ios/third_party/material_components_ios:material_components_ios+link",
+ ]
+ } else {
+ assert_no_deps = [
+ "//ios/third_party/material_components_ios:material_components_ios+bundle",
+ "//ios/third_party/material_components_ios:material_components_ios+link",
+ ]
}
configs += [ "//build/config/compiler:enable_arc" ]
diff --git a/chromium/ios/web_view/shell/test/BUILD.gn b/chromium/ios/web_view/shell/test/BUILD.gn
index 63c4ddf4815..b717678567f 100644
--- a/chromium/ios/web_view/shell/test/BUILD.gn
+++ b/chromium/ios/web_view/shell/test/BUILD.gn
@@ -4,8 +4,8 @@
import("//ios/build/config.gni")
import("//ios/third_party/earl_grey/ios_eg_test.gni")
-import("//ios/third_party/features.gni")
+# TODO(crbug.com/698657): Remove these EarlGrey tests or convert to EarlGrey 2.
group("all_tests") {
testonly = true
deps = [ ":ios_web_view_shell_egtests" ]
@@ -19,19 +19,14 @@ ios_eg_test("ios_web_view_shell_egtests") {
deps = [
":earl_grey_test_support",
"//ios/testing:http_server_bundle_data",
+ "//ios/third_party/material_components_ios:material_components_ios+bundle",
+ "//ios/third_party/material_components_ios:material_components_ios+link",
"//ios/web_view:web_view+link",
"//ios/web_view/shell:shell",
"//ios/web_view/test:test_support",
"//net:test_support",
]
- if (ios_third_party_material_components_built_as_framework) {
- deps += [
- "//ios/third_party/material_components_ios:material_components_ios+bundle",
- "//ios/third_party/material_components_ios:material_components_ios+link",
- ]
- }
-
configs += [ "//build/config/compiler:enable_arc" ]
assert_no_deps = ios_assert_no_deps
diff --git a/chromium/ios/web_view/test/BUILD.gn b/chromium/ios/web_view/test/BUILD.gn
index be963be4a49..7a84ea756f1 100644
--- a/chromium/ios/web_view/test/BUILD.gn
+++ b/chromium/ios/web_view/test/BUILD.gn
@@ -61,6 +61,7 @@ source_set("test_support") {
deps = [
"//base:base",
"//base/test:test_support",
+ "//ios/third_party/webkit",
"//testing/gtest",
"//ui/base",
]