Commit d886ddf4 authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

[iOS][WidgetKit] Add extension skeleton and flag

bug: 1138710
Change-Id: I9c1c787837d6c64e7ef88c66bf9070bb7d073547
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2477236Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819816}
parent 3bc15bfa
......@@ -11,6 +11,9 @@ declare_args() {
ios_enable_content_widget_extension = true
ios_enable_search_widget_extension = true
# Enable iOS 14, WidgetKit extension.
ios_enable_widget_kit_extension = false
# Enable share extension.
ios_enable_share_extension = true
......
......@@ -384,6 +384,9 @@ ios_app_bundle("chrome") {
if (ios_enable_credential_provider_extension) {
deps += [ ":credential_provider_extension_bundle" ]
}
if (ios_enable_widget_kit_extension) {
deps += [ ":widget_kit_extension_bundle" ]
}
}
extra_substitutions = [
......@@ -451,4 +454,14 @@ if (current_toolchain == default_toolchain) {
outputs = [ "{{bundle_contents_dir}}/PlugIns/{{source_file_part}}" ]
}
}
if (ios_enable_widget_kit_extension) {
bundle_data("widget_kit_extension_bundle") {
_widget_extension_target = "//ios/chrome/widget_kit_extension"
public_deps = [ _widget_extension_target ]
sources = [ get_label_info(_widget_extension_target, "root_out_dir") +
"/widget_kit_extension.appex" ]
outputs = [ "{{bundle_contents_dir}}/PlugIns/{{source_file_part}}" ]
}
}
}
# Copyright 2020 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("//build/apple/tweak_info_plist.gni")
import("//build/config/ios/rules.gni")
import("//build/config/locales.gni")
import("//build/config/mac/base_rules.gni")
import("//ios/build/chrome_build.gni")
import("//ios/build/config.gni")
import("//ios/chrome/extension_repack.gni")
import("//ios/chrome/tools/strings/generate_localizable_strings.gni")
import("//ios/public/provider/chrome/browser/build_config.gni")
tweak_info_plist("tweak_info_plist") {
info_plist = "Info.plist"
}
compile_entitlements("entitlements") {
substitutions = [
"IOS_BUNDLE_ID_PREFIX=$ios_app_bundle_id_prefix",
"CHROMIUM_BUNDLE_ID=$chromium_bundle_id",
]
output_name = "$target_gen_dir/widget_kit_extension.appex.entitlements"
entitlements_templates =
[ "entitlements/external/widget_kit_extension.appex.entitlements" ]
if (ios_chrome_cpe_entitlements_additions != []) {
entitlements_templates += ios_chrome_cpe_entitlements_additions
}
}
ios_appex_bundle("widget_kit_extension") {
sources = []
configs += [ "//build/config/compiler:enable_arc" ]
frameworks = [
"WidgetKit.framework",
"Foundation.framework",
"SwiftUI.framework",
]
entitlements_target = ":entitlements"
info_plist_target = ":tweak_info_plist"
xcode_product_bundle_id = "$chromium_bundle_id.WidgetKitExtension"
extra_substitutions = [ "PRODUCT_BUNDLE_IDENTIFIER=$ios_app_bundle_id_prefix.$xcode_product_bundle_id" ]
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>widget-extension</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.widgetkit-extension</string>
</dict>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
<key>com.apple.security.application-groups</key>
<array>
<string>group.${IOS_BUNDLE_ID_PREFIX}.chrome</string>
<string>group.${IOS_BUNDLE_ID_PREFIX}.common</string>
</array>
</dict>
</plist>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment