naiveproxy/extensions/common/BUILD.gn
2018-08-14 22:19:20 +00:00

453 lines
15 KiB
Plaintext

# Copyright 2014 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/features.gni")
import("//build/config/jumbo.gni")
import("//components/nacl/features.gni")
import("//extensions/buildflags/buildflags.gni")
import("//mojo/public/tools/bindings/mojom.gni")
# TODO(crbug.com/731689): Assert that extensions are enabled.
source_set("common_constants") {
if (is_chromecast) {
defines = [ "IS_CHROMECAST" ]
}
sources = [
"constants.cc",
"constants.h",
]
deps = [
"//base",
]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
}
if (enable_extensions) {
mojom("mojo") {
sources = [
"mojo/app_window.mojom",
"mojo/guest_view.mojom",
"mojo/keep_alive.mojom",
]
if (proprietary_codecs && enable_wifi_display) {
sources += [ "mojo/wifi_display_session_service.mojom" ]
}
public_deps = [
"//content/public/common:interfaces",
"//extensions/common/api:mojom",
"//mojo/public/mojom/base",
"//ui/gfx/geometry/mojo",
"//url/mojom:url_mojom_gurl",
]
overridden_deps = [ "//content/public/common:interfaces" ]
component_deps = [ "//content/public/common" ]
}
# This must be a static library because extensions common depends on
# GetTrustedICAPublicKey in extensions/browser which isn't always linked
# in. TODO(brettw): This reverse dependency should be fixed.
jumbo_static_library("common") {
sources = [
"alias.h",
"api/bluetooth/bluetooth_manifest_data.cc",
"api/bluetooth/bluetooth_manifest_data.h",
"api/bluetooth/bluetooth_manifest_handler.cc",
"api/bluetooth/bluetooth_manifest_handler.h",
"api/bluetooth/bluetooth_manifest_permission.cc",
"api/bluetooth/bluetooth_manifest_permission.h",
"api/declarative/declarative_constants.cc",
"api/declarative/declarative_constants.h",
"api/declarative/declarative_manifest_data.cc",
"api/declarative/declarative_manifest_data.h",
"api/declarative/declarative_manifest_handler.cc",
"api/declarative/declarative_manifest_handler.h",
"api/declarative_net_request/constants.cc",
"api/declarative_net_request/constants.h",
"api/declarative_net_request/dnr_manifest_data.cc",
"api/declarative_net_request/dnr_manifest_data.h",
"api/declarative_net_request/dnr_manifest_handler.cc",
"api/declarative_net_request/dnr_manifest_handler.h",
"api/declarative_net_request/utils.cc",
"api/declarative_net_request/utils.h",
"api/messaging/message.h",
"api/messaging/port_id.cc",
"api/messaging/port_id.h",
"api/printer_provider/usb_printer_manifest_data.cc",
"api/printer_provider/usb_printer_manifest_data.h",
"api/printer_provider/usb_printer_manifest_handler.cc",
"api/printer_provider/usb_printer_manifest_handler.h",
"api/sockets/sockets_manifest_data.cc",
"api/sockets/sockets_manifest_data.h",
"api/sockets/sockets_manifest_handler.cc",
"api/sockets/sockets_manifest_handler.h",
"api/sockets/sockets_manifest_permission.cc",
"api/sockets/sockets_manifest_permission.h",
"common_manifest_handlers.cc",
"common_manifest_handlers.h",
"common_param_traits.h",
"csp_validator.cc",
"csp_validator.h",
"dom_action_types.h",
"draggable_region.cc",
"draggable_region.h",
"error_utils.cc",
"error_utils.h",
"event_filter.cc",
"event_filter.h",
"event_filtering_info.cc",
"event_filtering_info.h",
"event_matcher.cc",
"event_matcher.h",
"extension.cc",
"extension.h",
"extension_api.cc",
"extension_api.h",
"extension_features.cc",
"extension_features.h",
"extension_icon_set.cc",
"extension_icon_set.h",
"extension_id.h",
"extension_l10n_util.cc",
"extension_l10n_util.h",
"extension_message_generator.cc",
"extension_message_generator.h",
"extension_messages.cc",
"extension_messages.h",
"extension_paths.cc",
"extension_paths.h",
"extension_resource.cc",
"extension_resource.h",
"extension_resource_path_normalizer.cc",
"extension_resource_path_normalizer.h",
"extension_set.cc",
"extension_set.h",
"extension_updater_uma.h",
"extension_urls.cc",
"extension_urls.h",
"extension_utility_types.h",
"extensions_aliases.cc",
"extensions_aliases.h",
"extensions_client.cc",
"extensions_client.h",
"feature_switch.cc",
"feature_switch.h",
"features/behavior_feature.cc",
"features/behavior_feature.h",
"features/complex_feature.cc",
"features/complex_feature.h",
"features/feature.cc",
"features/feature.h",
"features/feature_channel.cc",
"features/feature_channel.h",
"features/feature_provider.cc",
"features/feature_provider.h",
"features/feature_session_type.cc",
"features/feature_session_type.h",
"features/feature_util.cc",
"features/feature_util.h",
"features/json_feature_provider_source.cc",
"features/json_feature_provider_source.h",
"features/manifest_feature.cc",
"features/manifest_feature.h",
"features/permission_feature.cc",
"features/permission_feature.h",
"features/simple_feature.cc",
"features/simple_feature.h",
"file_util.cc",
"file_util.h",
"guest_view/extensions_guest_view_messages.h",
"hashed_extension_id.cc",
"hashed_extension_id.h",
"host_id.cc",
"host_id.h",
"image_util.cc",
"image_util.h",
"install_warning.cc",
"install_warning.h",
"manifest.cc",
"manifest.h",
"manifest_constants.cc",
"manifest_constants.h",
"manifest_handler.cc",
"manifest_handler.h",
"manifest_handler_helpers.cc",
"manifest_handler_helpers.h",
"manifest_handlers/app_isolation_info.cc",
"manifest_handlers/app_isolation_info.h",
"manifest_handlers/automation.cc",
"manifest_handlers/automation.h",
"manifest_handlers/background_info.cc",
"manifest_handlers/background_info.h",
"manifest_handlers/content_capabilities_handler.cc",
"manifest_handlers/content_capabilities_handler.h",
"manifest_handlers/content_scripts_handler.cc",
"manifest_handlers/content_scripts_handler.h",
"manifest_handlers/csp_info.cc",
"manifest_handlers/csp_info.h",
"manifest_handlers/default_locale_handler.cc",
"manifest_handlers/default_locale_handler.h",
"manifest_handlers/externally_connectable.cc",
"manifest_handlers/externally_connectable.h",
"manifest_handlers/file_handler_info.cc",
"manifest_handlers/file_handler_info.h",
"manifest_handlers/icons_handler.cc",
"manifest_handlers/icons_handler.h",
"manifest_handlers/incognito_info.cc",
"manifest_handlers/incognito_info.h",
"manifest_handlers/kiosk_mode_info.cc",
"manifest_handlers/kiosk_mode_info.h",
"manifest_handlers/mime_types_handler.cc",
"manifest_handlers/mime_types_handler.h",
"manifest_handlers/oauth2_manifest_handler.cc",
"manifest_handlers/oauth2_manifest_handler.h",
"manifest_handlers/offline_enabled_info.cc",
"manifest_handlers/offline_enabled_info.h",
"manifest_handlers/options_page_info.cc",
"manifest_handlers/options_page_info.h",
"manifest_handlers/permissions_parser.cc",
"manifest_handlers/permissions_parser.h",
"manifest_handlers/requirements_info.cc",
"manifest_handlers/requirements_info.h",
"manifest_handlers/sandboxed_page_info.cc",
"manifest_handlers/sandboxed_page_info.h",
"manifest_handlers/shared_module_info.cc",
"manifest_handlers/shared_module_info.h",
"manifest_handlers/web_accessible_resources_info.cc",
"manifest_handlers/web_accessible_resources_info.h",
"manifest_handlers/webview_info.cc",
"manifest_handlers/webview_info.h",
"manifest_url_handlers.cc",
"manifest_url_handlers.h",
"message_bundle.cc",
"message_bundle.h",
"one_shot_event.cc",
"one_shot_event.h",
"permissions/api_permission.cc",
"permissions/api_permission.h",
"permissions/api_permission_set.cc",
"permissions/api_permission_set.h",
"permissions/base_set_operators.h",
"permissions/extensions_api_permissions.cc",
"permissions/extensions_api_permissions.h",
"permissions/manifest_permission.cc",
"permissions/manifest_permission.h",
"permissions/manifest_permission_set.cc",
"permissions/manifest_permission_set.h",
"permissions/media_galleries_permission.cc",
"permissions/media_galleries_permission.h",
"permissions/media_galleries_permission_data.cc",
"permissions/media_galleries_permission_data.h",
"permissions/permission_message.cc",
"permissions/permission_message.h",
"permissions/permission_message_provider.cc",
"permissions/permission_message_provider.h",
"permissions/permission_message_util.cc",
"permissions/permission_message_util.h",
"permissions/permission_set.cc",
"permissions/permission_set.h",
"permissions/permissions_data.cc",
"permissions/permissions_data.h",
"permissions/permissions_info.cc",
"permissions/permissions_info.h",
"permissions/permissions_provider.h",
"permissions/set_disjunction_permission.h",
"permissions/settings_override_permission.cc",
"permissions/settings_override_permission.h",
"permissions/socket_permission.cc",
"permissions/socket_permission.h",
"permissions/socket_permission_data.cc",
"permissions/socket_permission_data.h",
"permissions/socket_permission_entry.cc",
"permissions/socket_permission_entry.h",
"permissions/usb_device_permission.cc",
"permissions/usb_device_permission.h",
"permissions/usb_device_permission_data.cc",
"permissions/usb_device_permission_data.h",
"stack_frame.cc",
"stack_frame.h",
"switches.cc",
"switches.h",
"url_pattern.cc",
"url_pattern.h",
"url_pattern_set.cc",
"url_pattern_set.h",
"user_script.cc",
"user_script.h",
"value_builder.cc",
"value_builder.h",
"value_counter.cc",
"value_counter.h",
"view_type.cc",
"view_type.h",
]
configs += [
"//build/config:precompiled_headers",
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
"//build/config/compiler:no_size_t_to_int_warning",
]
public_deps = [
":common_constants",
":mojo",
"//content/public/common",
"//ipc",
"//skia",
]
deps = [
"//base",
# TODO(benwells): figure out what to do with the api target and
# api resources compiled into the chrome resource bundle.
# http://crbug.com/162530
"//chrome:resources",
"//components/crx_file",
"//components/nacl/common:buildflags",
"//components/url_formatter",
"//components/url_matcher",
"//components/version_info",
"//crypto",
"//device/bluetooth",
"//device/usb",
"//device/usb/public/cpp",
"//device/usb/public/mojom",
"//extensions:extensions_resources",
"//extensions/common/api",
"//extensions/strings",
"//net",
"//third_party/boringssl",
"//third_party/icu",
"//third_party/re2",
"//ui/base",
"//ui/gfx/geometry",
"//ui/gfx/ipc",
"//ui/gfx/ipc/geometry",
"//ui/gfx/ipc/skia",
"//url",
]
if (enable_nacl) {
sources += [
"manifest_handlers/nacl_modules_handler.cc",
"manifest_handlers/nacl_modules_handler.h",
]
}
if (is_chromeos) {
sources += [
"manifest_handlers/action_handlers_handler.cc",
"manifest_handlers/action_handlers_handler.h",
]
}
}
source_set("test_support") {
testonly = true
sources = [
"api/declarative_net_request/test_utils.cc",
"api/declarative_net_request/test_utils.h",
]
deps = [
":common",
"//base",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"api/declarative/declarative_manifest_unittest.cc",
"api/declarative_net_request/dnr_manifest_unittest.cc",
"api/printer_provider/usb_printer_manifest_unittest.cc",
"api/sockets/sockets_manifest_permission_unittest.cc",
"component_extension_url_pattern_unittest.cc",
"csp_validator_unittest.cc",
"event_filter_unittest.cc",
"extension_builder_unittest.cc",
"extension_icon_set_unittest.cc",
"extension_l10n_util_unittest.cc",
"extension_messages_unittest.cc",
"extension_resource_path_normalizer_unittest.cc",
"extension_resource_unittest.cc",
"extension_set_unittest.cc",
"extension_unittest.cc",
"features/complex_feature_unittest.cc",
"features/feature_provider_unittest.cc",
"features/simple_feature_unittest.cc",
"file_util_unittest.cc",
"image_util_unittest.cc",
"manifest_handler_unittest.cc",
"manifest_handlers/content_capabilities_manifest_unittest.cc",
"manifest_handlers/csp_info_unittest.cc",
"manifest_handlers/default_locale_manifest_unittest.cc",
"manifest_handlers/externally_connectable_unittest.cc",
"manifest_handlers/file_handler_manifest_unittest.cc",
"manifest_handlers/icons_handler_unittest.cc",
"manifest_handlers/incognito_manifest_unittest.cc",
"manifest_handlers/kiosk_mode_info_unittest.cc",
"manifest_handlers/oauth2_manifest_unittest.cc",
"manifest_handlers/shared_module_manifest_unittest.cc",
"message_bundle_unittest.cc",
"one_shot_event_unittest.cc",
"permissions/api_permission_unittest.cc",
"permissions/api_permission_set_unittest.cc",
"permissions/manifest_permission_set_unittest.cc",
"permissions/socket_permission_unittest.cc",
"permissions/usb_device_permission_unittest.cc",
"stack_frame_unittest.cc",
"url_pattern_set_unittest.cc",
"url_pattern_unittest.cc",
"user_script_unittest.cc",
"value_builder_unittest.cc",
"value_counter_unittest.cc",
]
deps = [
":common",
":test_support",
"//base",
"//base:i18n",
"//base/test:test_support",
"//components/crx_file",
"//components/version_info:version_info",
"//device/usb",
"//device/usb:test_support",
"//extensions:extensions_resources",
# TODO(brettw) these tests should not be including headers from browser.
"//extensions:test_support",
"//extensions/browser",
"//extensions/strings",
"//ipc",
"//testing/gmock",
"//testing/gtest",
"//ui/base",
"//ui/gfx",
"//url",
]
if (is_chromeos) {
sources += [ "manifest_handlers/action_handlers_handler_unittest.cc" ]
}
data = [
"//extensions/common/permissions/api_permission.h",
"//tools/metrics/histograms/enums.xml",
]
}
} # enable_extensions