blob: 6d6db7c147fe31ceb8b64023c2580d384ad006e5 [file] [log] [blame]
# 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/ui.gni")
import("//build/util/lastchange.gni")
import("//build/util/process_version.gni")
import("//components/nacl/features.gni")
import("//extensions/buildflags/buildflags.gni")
import("//testing/test.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
if (is_linux) {
import("//build/linux/extract_symbols.gni")
}
assert(enable_extensions)
grit("resources") {
source = "app_shell_resources.grd"
outputs = [
"grit/app_shell_resources.h",
"app_shell_resources.pak",
]
}
source_set("app_shell_lib") {
# TODO(jamescook): investigate and get rid of test dependencies. This library
# is testonly because it depends on testonly libraries, namely
# //content/shell:content_shell_lib. See http://crbug.com/438283
testonly = true
deps = [
":resources",
":version_header",
"//apps",
"//base",
"//components/feedback",
"//components/guest_view/browser",
"//components/guest_view/renderer",
"//components/keep_alive_registry",
"//components/keyed_service/content:content",
"//components/nacl/common:buildflags",
"//components/network_session_configurator/common",
"//components/pref_registry",
"//components/prefs",
"//components/sessions",
"//components/storage_monitor",
"//components/update_client",
"//components/user_prefs",
"//components/version_info",
"//content",
"//content/shell:content_shell_lib",
"//device/base",
"//device/bluetooth",
"//device/usb",
"//extensions:extensions_resources",
"//extensions:shell_and_test_pak",
"//extensions/browser",
"//extensions/browser:core_api_provider",
"//extensions/browser/kiosk",
"//extensions/common",
"//extensions/common:core_api_provider",
"//extensions/common/api",
"//extensions/renderer",
"//extensions/shell/browser/system_logs",
"//extensions/shell/common/api",
"//extensions/shell/common/api:extensions_features",
"//google_apis",
"//third_party/blink/public:blink",
"//ui/base",
"//ui/base/ime",
]
# TODO(michaelpg): remove Mac support and always use aura.
if (use_aura) {
deps += [
"//ui/aura",
"//ui/views",
]
if (use_x11) {
deps += [ "//ui/events/devices/x11" ]
}
}
sources = [
"app/shell_main_delegate.cc",
"app/shell_main_delegate.h",
"app/shell_main_delegate_mac.mm",
"browser/api/feedback_private/shell_feedback_private_delegate.cc",
"browser/api/feedback_private/shell_feedback_private_delegate.h",
"browser/api/identity/identity_api.cc",
"browser/api/identity/identity_api.h",
"browser/api/runtime/shell_runtime_api_delegate.cc",
"browser/api/runtime/shell_runtime_api_delegate.h",
"browser/default_shell_browser_main_delegate.cc",
"browser/default_shell_browser_main_delegate.h",
"browser/delegates/shell_kiosk_delegate.cc",
"browser/delegates/shell_kiosk_delegate.h",
"browser/desktop_controller.cc",
"browser/desktop_controller.h",
"browser/shell_app_delegate.cc",
"browser/shell_app_delegate.h",
"browser/shell_app_view_guest_delegate.cc",
"browser/shell_app_view_guest_delegate.h",
"browser/shell_app_window_client.cc",
"browser/shell_app_window_client.h",
"browser/shell_app_window_client_mac.mm",
"browser/shell_audio_controller_chromeos.cc",
"browser/shell_audio_controller_chromeos.h",
"browser/shell_browser_context.cc",
"browser/shell_browser_context.h",
"browser/shell_browser_context_keyed_service_factories.cc",
"browser/shell_browser_context_keyed_service_factories.h",
"browser/shell_browser_main_delegate.h",
"browser/shell_browser_main_parts.cc",
"browser/shell_browser_main_parts.h",
"browser/shell_content_browser_client.cc",
"browser/shell_content_browser_client.h",
"browser/shell_desktop_controller_mac.h",
"browser/shell_desktop_controller_mac.mm",
"browser/shell_device_client.cc",
"browser/shell_device_client.h",
"browser/shell_display_info_provider.cc",
"browser/shell_display_info_provider.h",
"browser/shell_extension_host_delegate.cc",
"browser/shell_extension_host_delegate.h",
"browser/shell_extension_loader.cc",
"browser/shell_extension_loader.h",
"browser/shell_extension_system.cc",
"browser/shell_extension_system.h",
"browser/shell_extension_system_factory.cc",
"browser/shell_extension_system_factory.h",
"browser/shell_extension_web_contents_observer.cc",
"browser/shell_extension_web_contents_observer.h",
"browser/shell_extensions_api_client.cc",
"browser/shell_extensions_api_client.h",
"browser/shell_extensions_browser_api_provider.cc",
"browser/shell_extensions_browser_api_provider.h",
"browser/shell_extensions_browser_client.cc",
"browser/shell_extensions_browser_client.h",
"browser/shell_keep_alive_requester.cc",
"browser/shell_keep_alive_requester.h",
"browser/shell_native_app_window.cc",
"browser/shell_native_app_window.h",
"browser/shell_native_app_window_mac.h",
"browser/shell_native_app_window_mac.mm",
"browser/shell_navigation_ui_data.cc",
"browser/shell_navigation_ui_data.h",
"browser/shell_network_controller_chromeos.cc",
"browser/shell_network_controller_chromeos.h",
"browser/shell_network_delegate.cc",
"browser/shell_network_delegate.h",
"browser/shell_oauth2_token_service.cc",
"browser/shell_oauth2_token_service.h",
"browser/shell_oauth2_token_service_delegate.cc",
"browser/shell_oauth2_token_service_delegate.h",
"browser/shell_prefs.cc",
"browser/shell_prefs.h",
"browser/shell_special_storage_policy.cc",
"browser/shell_special_storage_policy.h",
"browser/shell_speech_recognition_manager_delegate.cc",
"browser/shell_speech_recognition_manager_delegate.h",
"browser/shell_update_query_params_delegate.cc",
"browser/shell_update_query_params_delegate.h",
"browser/shell_url_request_context_getter.cc",
"browser/shell_url_request_context_getter.h",
"browser/shell_virtual_keyboard_delegate.cc",
"browser/shell_virtual_keyboard_delegate.h",
"browser/shell_web_view_guest_delegate.cc",
"browser/shell_web_view_guest_delegate.h",
"common/shell_content_client.cc",
"common/shell_content_client.h",
"common/shell_extensions_api_provider.cc",
"common/shell_extensions_api_provider.h",
"common/shell_extensions_client.cc",
"common/shell_extensions_client.h",
"common/switches.cc",
"common/switches.h",
"renderer/shell_content_renderer_client.cc",
"renderer/shell_content_renderer_client.h",
"renderer/shell_extensions_renderer_client.cc",
"renderer/shell_extensions_renderer_client.h",
]
if (use_aura) {
sources += [
"browser/root_window_controller.cc",
"browser/root_window_controller.h",
"browser/shell_app_window_client_aura.cc",
"browser/shell_desktop_controller_aura.cc",
"browser/shell_desktop_controller_aura.h",
"browser/shell_native_app_window_aura.cc",
"browser/shell_native_app_window_aura.h",
]
deps += [
"//ui/base/user_activity",
"//ui/platform_window",
"//ui/wm",
"//ui/wm/public",
]
if (is_chromeos) {
deps += [ "//ui/ozone" ]
}
}
if (is_desktop_linux) {
sources += [
"app/shell_crash_reporter_client.cc",
"app/shell_crash_reporter_client.h",
"browser/api/file_system/shell_file_system_delegate.cc",
"browser/api/file_system/shell_file_system_delegate.h",
]
deps += [
"//components/crash/content/app",
"//components/crash/core/common",
"//components/upload_list",
"//components/version_info:generate_version_info",
]
}
if (is_chromeos) {
sources += [
"browser/api/vpn_provider/vpn_service_factory.cc",
"browser/shell_screen.cc",
"browser/shell_screen.h",
]
deps += [
"//chromeos:chromeos_constants",
"//chromeos/audio",
"//chromeos/dbus",
"//chromeos/disks",
"//chromeos/login/login_state",
"//chromeos/network",
"//ui/chromeos",
"//ui/display/manager",
]
}
if (enable_nacl) {
sources += [
"browser/shell_nacl_browser_delegate.cc",
"browser/shell_nacl_browser_delegate.h",
]
deps += [
"//components/nacl/browser",
"//components/nacl/common",
"//components/nacl/loader",
"//components/nacl/renderer",
"//components/nacl/renderer/plugin:nacl_trusted_plugin",
"//ppapi/shared_impl:shared_impl",
]
if (is_linux) {
deps += [ "//components/nacl/loader:nacl_helper" ]
if (enable_nacl_nonsfi) {
deps += [ "//components/nacl/loader:helper_nonsfi" ]
}
}
}
}
executable("app_shell") {
# testonly because :app_shell_lib is testonly. See :app_shell_lib comment.
testonly = true
sources = [
"app/shell_main.cc",
]
deps = [
":app_shell_lib",
"//build/win:default_exe_manifest",
"//content/public/app:both",
"//extensions:shell_and_test_pak",
]
if (is_win) {
configs += [ "//build/config/win:windowed" ]
configs -= [ "//build/config/win:console" ]
deps += [ "//sandbox/win:sandbox" ]
}
}
test("app_shell_unittests") {
sources = [
"../test/extensions_unittests_main.cc",
"browser/api/identity/identity_api_unittest.cc",
"browser/shell_content_browser_client_unittest.cc",
"browser/shell_extension_loader_unittest.cc",
"browser/shell_keep_alive_requester_unittest.cc",
"browser/shell_oauth2_token_service_unittest.cc",
"browser/shell_prefs_unittest.cc",
"browser/system_logs/shell_system_logs_fetcher_unittest.cc",
"test/shell_test_extensions_browser_client.cc",
"test/shell_test_extensions_browser_client.h",
]
data = [
"//extensions/test/data/",
"$root_out_dir/extensions_shell_and_test.pak",
#"$root_out_dir/natives_blob.bin", # move to gin
]
deps = [
":app_shell_lib",
"//apps",
"//base",
"//base/test:test_support",
"//components/crx_file",
"//components/feedback",
"//components/keep_alive_registry",
"//components/prefs",
"//components/user_prefs",
"//content/test:test_support",
"//extensions:shell_and_test_pak",
"//extensions:test_support",
"//extensions/browser",
"//extensions/common",
"//extensions/common/api",
"//extensions/shell/browser/system_logs",
"//google_apis",
"//testing/gtest",
"//ui/gl:test_support",
"//ui/platform_window",
]
data_deps = [
# "//gin", # TODO(dpranke): Either gin or v8 data is needed ...
"//third_party/mesa_headers",
]
if (use_aura) {
sources += [
"browser/root_window_controller_unittest.cc",
"browser/shell_desktop_controller_aura_unittest.cc",
"browser/shell_native_app_window_aura_unittest.cc",
"test/shell_test_base_aura.cc",
"test/shell_test_base_aura.h",
"test/shell_test_helper_aura.cc",
"test/shell_test_helper_aura.h",
]
deps += [
"//ui/aura:test_support",
"//ui/base:test_support",
"//ui/compositor:test_support",
]
}
if (is_chromeos) {
sources += [
"browser/shell_audio_controller_chromeos_unittest.cc",
"browser/shell_screen_unittest.cc",
]
deps += [
"//chromeos:chromeos_constants",
"//chromeos/audio",
"//chromeos/dbus:test_support",
]
}
if (enable_nacl) {
sources += [ "browser/shell_nacl_browser_delegate_unittest.cc" ]
}
}
process_version("version_header") {
template_file = "common/version.h.in"
sources = [
"//chrome/VERSION",
lastchange_file,
]
output = "$target_gen_dir/common/version.h"
}
source_set("browser_tests") {
testonly = true
sources = [
"browser/api/runtime/runtime_apitest.cc",
"browser/shell_browsertest.cc",
"test/shell_apitest.cc",
"test/shell_apitest.h",
"test/shell_test.cc",
"test/shell_test.h",
"test/shell_test_launcher_delegate.cc",
"test/shell_test_launcher_delegate.h",
"test/shell_tests_main.cc",
"test/test_shell_main_delegate.cc",
"test/test_shell_main_delegate.h",
]
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
deps = [
":app_shell_lib",
"//base",
"//base/test:test_support",
"//components/keep_alive_registry",
"//components/version_info",
"//content/shell:content_shell_lib",
"//content/test:test_support",
"//extensions:test_support",
"//extensions/browser",
"//extensions/browser:test_support",
"//extensions/common",
"//ui/base",
]
if (use_aura) {
sources += [ "browser/shell_desktop_controller_aura_browsertest.cc" ]
deps += [ "//ui/aura" ]
}
}
source_set("unit_tests") {
testonly = true
sources = []
deps = [
":app_shell_lib",
"//base",
"//base/test:test_support",
"//extensions/browser",
]
if (is_chromeos) {
deps += [
"//chromeos:chromeos_constants",
"//components/keyed_service/content",
]
}
}
if (is_desktop_linux && is_official_build) {
extract_symbols("app_shell_linux_symbols") {
# testonly because :app_shell is testonly. See :app_shell_lib comment.
testonly = true
binary = "$root_out_dir/app_shell"
symbol_file = "$root_out_dir/app_shell.breakpad.$current_cpu"
deps = [
":app_shell",
]
}
}