blob: 1549741612a3eb7de1f8cbbb0557e6e24bfbbdba [file] [log] [blame]
# Copyright 2018 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/config/chromeos/ui_mode.gni")
source_set("components") {
sources = [
"../system_web_apps/system_web_app_types.h",
"app_icon_manager.cc",
"app_icon_manager.h",
"app_registrar.cc",
"app_registrar.h",
"app_registrar_observer.h",
"app_registry_controller.cc",
"app_registry_controller.h",
"app_shortcut_manager.h",
"external_install_options.cc",
"external_install_options.h",
"externally_installed_web_app_prefs.h",
"externally_managed_app_manager.h",
"file_handler_manager.h",
"file_handling_permission_context.cc",
"file_handling_permission_context.h",
"file_handling_permission_request_impl.cc",
"file_handling_permission_request_impl.h",
"install_bounce_metric.cc",
"install_bounce_metric.h",
"install_finalizer.h",
"install_manager.h",
"os_integration_manager.h",
"policy/web_app_policy_constants.cc",
"policy/web_app_policy_constants.h",
"preinstalled_app_install_features.cc",
"preinstalled_app_install_features.h",
"protocol_handler_manager.h",
"url_handler_manager.h",
"web_app_audio_focus_id_map.cc",
"web_app_audio_focus_id_map.h",
"web_app_callback_app_identity.h",
"web_app_chromeos_data.cc",
"web_app_chromeos_data.h",
"web_app_constants.cc",
"web_app_constants.h",
"web_app_data_retriever.cc",
"web_app_data_retriever.h",
"web_app_file_handler_registration.cc",
"web_app_file_handler_registration.h",
"web_app_helpers.h",
"web_app_icon_generator.cc",
"web_app_icon_generator.h",
"web_app_id.h",
"web_app_id_constants.cc",
"web_app_id_constants.h",
"web_app_install_utils.cc",
"web_app_install_utils.h",
"web_app_origin_association_manager.cc",
"web_app_origin_association_manager.h",
"web_app_origin_association_task.cc",
"web_app_origin_association_task.h",
"web_app_prefs_utils.cc",
"web_app_prefs_utils.h",
"web_app_protocol_handler_registration.cc",
"web_app_protocol_handler_registration.h",
"web_app_provider_base.cc",
"web_app_provider_base.h",
"web_app_provider_base_factory.cc",
"web_app_provider_base_factory.h",
"web_app_run_on_os_login.cc",
"web_app_run_on_os_login.h",
"web_app_shortcut.cc",
"web_app_shortcut.h",
"web_app_shortcuts_menu.cc",
"web_app_shortcuts_menu.h",
"web_app_system_web_app_data.cc",
"web_app_system_web_app_data.h",
"web_app_ui_manager.h",
"web_app_uninstallation_via_os_settings_registration.cc",
"web_app_uninstallation_via_os_settings_registration.h",
"web_app_url_loader.cc",
"web_app_url_loader.h",
"web_app_utils.h",
"web_application_info.cc",
"web_application_info.h",
# TODO(nigeltao): move these two files from
# //chrome/browser/web_applications/components to a stand-alone
# //components/web_app_icon_downloader?
#
# There's //components/image_fetcher as well as code split between
# //content/public/browser/manifest_icon_downloader.h and
# //content/browser/manfest/manifest_icon_downloader.cc. Some or all of
# those might be similar enough to merge.
"web_app_icon_downloader.cc",
"web_app_icon_downloader.h",
]
if (is_chromeos_ash || is_chromeos_lacros) {
sources += [ "web_app_shortcut_chromeos.cc" ]
}
if (is_linux) {
# Desktop linux, doesn't count ChromeOS.
sources += [
"web_app_shortcut_linux.cc",
"web_app_shortcut_linux.h",
]
}
if (is_linux) {
sources += [ "web_app_run_on_os_login_linux.cc" ]
}
if (is_chromeos_ash || is_chromeos_lacros) {
sources += [ "web_app_run_on_os_login_chromeos.cc" ]
}
if (is_mac) {
sources += [
"app_shim_registry_mac.cc",
"app_shim_registry_mac.h",
"web_app_file_handler_registration_mac.cc",
"web_app_run_on_os_login_mac.mm",
"web_app_shortcut_mac.h",
"web_app_shortcut_mac.mm",
]
}
if (is_win) {
sources += [
"web_app_file_handler_registration_win.cc",
"web_app_handler_registration_utils_win.cc",
"web_app_handler_registration_utils_win.h",
"web_app_protocol_handler_registration_win.cc",
"web_app_run_on_os_login_win.cc",
"web_app_shortcut_win.cc",
"web_app_shortcut_win.h",
"web_app_shortcuts_menu_win.cc",
"web_app_shortcuts_menu_win.h",
"web_app_uninstallation_via_os_settings_registration_win.cc",
]
}
if (is_win || is_mac || (is_linux && !is_chromeos_lacros)) {
sources += [
"url_handler_launch_params.cc",
"url_handler_launch_params.h",
"url_handler_manager_impl.h",
"url_handler_prefs.cc",
"url_handler_prefs.h",
]
}
public_deps = [
"//components/services/app_service/public/cpp:app_share_target",
"//components/services/app_service/public/cpp:app_url_handling",
]
deps = [
"//base",
"//build:chromeos_buildflags",
"//chrome/app/resources:platform_locale_settings",
"//chrome/app/theme:chrome_unscaled_resources",
"//chrome/browser:browser_process",
"//chrome/browser/profiles:profile",
"//chrome/browser/web_applications:web_app_group",
"//chrome/common",
"//components/crx_file",
"//components/keyed_service/content",
"//components/permissions:permissions",
"//components/pref_registry",
"//components/services/app_service/public/cpp:protocol_handling",
"//components/services/app_service/public/mojom",
"//components/site_engagement/core/mojom:mojo_bindings",
"//components/user_manager:user_manager",
"//components/webapps/browser",
"//components/webapps/common:mojo_bindings",
"//components/webapps/services/web_app_origin_association:lib",
"//components/webapps/services/web_app_origin_association:service",
"//content/public/browser",
"//extensions/common:common_constants",
"//mojo/public/cpp/bindings",
"//net",
"//services/network/public/cpp",
"//services/preferences/public/cpp",
"//skia",
"//third_party/blink/public/common",
"//url",
]
if (is_win) {
deps += [ "//chrome/browser/web_applications/chrome_pwa_launcher:util" ]
}
if (is_win || is_mac || (is_linux && !is_chromeos_lacros)) {
deps += [ "//base/util/values:values_util" ]
}
}
source_set("unit_tests") {
testonly = true
sources = [
"externally_managed_app_manager_unittest.cc",
"file_handler_manager_unittest.cc",
"install_finalizer_unittest.cc",
"os_integration_manager_unittest.cc",
"preinstalled_app_install_features_unittest.cc",
"protocol_handler_manager_unittest.cc",
"web_app_constants_unittest.cc",
"web_app_data_retriever_unittest.cc",
"web_app_helpers_unittest.cc",
"web_app_icon_downloader_unittest.cc",
"web_app_icon_generator_unittest.cc",
"web_app_install_utils_unittest.cc",
"web_app_prefs_utils_unittest.cc",
"web_app_shortcut_unittest.cc",
"web_app_url_loader_unittest.cc",
"web_app_utils_unittest.cc",
]
if (is_win) {
sources += [
"web_app_file_handler_registration_win_unittest.cc",
"web_app_handler_registration_utils_win_unittest.cc",
"web_app_protocol_handler_registration_win_unittest.cc",
"web_app_run_on_os_login_win_unittest.cc",
"web_app_shortcut_win_unittest.cc",
]
}
if (is_mac) {
sources += [
"app_shim_registry_mac_unittest.cc",
"web_app_run_on_os_login_mac_unittest.mm",
"web_app_shortcut_mac_unittest.mm",
]
}
if (is_linux) {
# Desktop linux, doesn't count ChromeOS.
sources += [
"web_app_file_handler_registration_linux_unittest.cc",
"web_app_shortcut_linux_unittest.cc",
]
}
if (is_linux) {
sources += [ "web_app_run_on_os_login_linux_unittest.cc" ]
}
if (is_win || is_mac || (is_linux && !is_chromeos_lacros)) {
sources += [
"url_handler_manager_impl_unittest.cc",
"url_handler_prefs_unittest.cc",
]
}
deps = [
":components",
"//base/test:test_support",
"//build:chromeos_buildflags",
"//chrome/app/theme:theme_resources",
"//chrome/browser/profiles:profile",
"//chrome/browser/web_applications:web_app_test_group",
"//chrome/browser/web_applications:web_applications",
"//chrome/browser/web_applications:web_applications_test_support",
"//chrome/browser/web_applications/extensions:extensions",
"//chrome/test:test_support",
"//components/services/app_service/public/cpp:protocol_handling",
"//components/webapps/browser",
"//components/webapps/browser:test_support",
"//components/webapps/common:mojo_bindings",
"//content/public/browser",
"//services/preferences/public/cpp",
"//skia",
"//testing/gmock",
"//testing/gtest",
]
if (is_chromeos_ash) {
deps += [ "//chrome/browser/chromeos" ]
}
if (is_win) {
deps += [ "//chrome/browser/web_applications/chrome_pwa_launcher:util" ]
}
if (is_win || is_mac || (is_linux && !is_chromeos_lacros)) {
deps += [ "//components/services/app_service/public/cpp:app_url_handling" ]
}
}
source_set("browser_tests") {
testonly = true
sources = [
"web_app_origin_association_manager_browsertest.cc",
"web_app_url_loader_browsertest.cc",
]
if (is_linux) {
sources += [ "web_app_file_handler_registration_linux_browsertest.cc" ]
}
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
deps = [
":components",
"//base",
"//chrome/browser/profiles:profile",
"//chrome/browser/web_applications:web_applications_test_support",
"//chrome/test:test_support",
"//chrome/test:test_support_ui",
"//components/webapps/services/web_app_origin_association/test:test_support",
"//net:test_support",
"//third_party/blink/public/common",
"//url",
]
}