blob: b246697b99e37f6e89268abc3dc712aa01ad0158 [file] [log] [blame]
# Copyright 2015 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/buildflag_header.gni")
import("//build/config/ui.gni")
import("//chromecast/chromecast.gni")
import("//media/media_options.gni")
import("//testing/test.gni")
import("//tools/grit/grit_rule.gni")
if (is_android) {
import("//build/config/android/rules.gni")
}
buildflag_header("browser_buildflags") {
header = "browser_buildflags.h"
flags = [ "ENABLE_CAST_AUDIO_MANAGER_MIXER=$enable_cast_audio_manager_mixer" ]
}
cast_source_set("prefs") {
sources = [
"pref_service_helper.cc",
"pref_service_helper.h",
]
if (chromecast_branding == "public") {
sources += [ "pref_service_helper_simple.cc" ]
}
deps = [
"//base",
"//chromecast:chromecast_buildflags",
"//chromecast/base",
"//components/prefs",
]
if (is_android) {
deps += [ "//components/cdm/browser" ]
}
}
cast_source_set("browser") {
sources = [
"application_media_capabilities.cc",
"application_media_capabilities.h",
"application_media_info_manager.cc",
"application_media_info_manager.h",
"bluetooth/cast_bluetooth_chooser.cc",
"bluetooth/cast_bluetooth_chooser.h",
"cast_browser_context.cc",
"cast_browser_context.h",
"cast_browser_main_parts.cc",
"cast_browser_main_parts.h",
"cast_browser_process.cc",
"cast_browser_process.h",
"cast_content_browser_client.cc",
"cast_content_browser_client.h",
"cast_content_gesture_handler.cc",
"cast_content_gesture_handler.h",
"cast_download_manager_delegate.cc",
"cast_download_manager_delegate.h",
"cast_feature_list_creator.cc",
"cast_feature_list_creator.h",
"cast_http_user_agent_settings.cc",
"cast_http_user_agent_settings.h",
"cast_media_blocker.cc",
"cast_media_blocker.h",
"cast_navigation_ui_data.cc",
"cast_navigation_ui_data.h",
"cast_net_log.cc",
"cast_net_log.h",
"cast_network_contexts.cc",
"cast_network_contexts.h",
"cast_network_delegate.cc",
"cast_network_delegate.h",
"cast_network_request_interceptor.cc",
"cast_network_request_interceptor.h",
"cast_overlay_manifests.cc",
"cast_overlay_manifests.h",
"cast_permission_manager.cc",
"cast_permission_manager.h",
"cast_quota_permission_context.cc",
"cast_quota_permission_context.h",
"cast_resource_dispatcher_host_delegate.cc",
"cast_resource_dispatcher_host_delegate.h",
"cast_session_id_map.cc",
"cast_session_id_map.h",
"cast_web_contents_impl.cc",
"cast_web_contents_impl.h",
"cast_web_contents_manager.cc",
"cast_web_contents_manager.h",
"cast_web_view_default.cc",
"cast_web_view_default.h",
"cast_web_view_factory.cc",
"cast_web_view_factory.h",
"default_navigation_throttle.cc",
"default_navigation_throttle.h",
"devtools/cast_devtools_manager_delegate.cc",
"devtools/cast_devtools_manager_delegate.h",
"devtools/remote_debugging_server.cc",
"devtools/remote_debugging_server.h",
"general_audience_browsing_navigation_throttle.cc",
"general_audience_browsing_navigation_throttle.h",
"general_audience_browsing_service.cc",
"general_audience_browsing_service.h",
"lru_renderer_cache.cc",
"lru_renderer_cache.h",
"media/media_caps_impl.cc",
"media/media_caps_impl.h",
"media/supported_codec_finder.cc",
"media/supported_codec_finder.h",
"queryable_data_host_cast.cc",
"queryable_data_host_cast.h",
"renderer_prelauncher.cc",
"renderer_prelauncher.h",
"service/cast_service_simple.cc",
"service/cast_service_simple.h",
"tts/tts_controller.h",
"tts/tts_controller_impl.cc",
"tts/tts_controller_impl.h",
"tts/tts_platform.cc",
"tts/tts_platform.h",
"tts/tts_platform_stub.cc",
"tts/tts_platform_stub.h",
"url_request_context_factory.cc",
"url_request_context_factory.h",
]
if (chromecast_branding == "public") {
sources += [
"cast_browser_main_parts_simple.cc",
"cast_content_browser_client_simple.cc",
"cast_network_request_interceptor_simple.cc",
]
}
public_deps = [
":prefs",
":public",
"//chromecast/browser/metrics",
"//chromecast/metrics",
]
deps = [
":browser_buildflags",
"//base",
"//base:i18n",
"//cc",
"//chromecast:chromecast_buildflags",
"//chromecast/activity",
"//chromecast/app:cast_crash_client",
"//chromecast/app:chromecast_settings",
"//chromecast/app:resources",
"//chromecast/base",
"//chromecast/base:cast_sys_info_util",
"//chromecast/base:cast_version",
"//chromecast/browser/bluetooth/public/mojom",
"//chromecast/browser/general_audience_browsing/mojom",
"//chromecast/common",
"//chromecast/common:queryable_data",
"//chromecast/common/media",
"//chromecast/common/mojom",
"//chromecast/graphics",
"//chromecast/media",
"//chromecast/media:libcast_media",
"//chromecast/media/base:video_plane_controller",
"//chromecast/media/service",
"//chromecast/net",
"//chromecast/service",
"//components/download/public/common:public",
"//components/metrics",
"//components/metrics:gpu",
"//components/metrics:net",
"//components/variations/net",
# TODO(gfhuang): Eliminate this dependency if ScreenInfoMetricsProvider
# isn't needed. crbug.com/541577
"//components/metrics:ui",
"//components/network_hints/browser",
"//components/network_session_configurator/common",
"//components/policy/core/browser",
"//components/prefs",
"//components/proxy_config",
"//components/safe_search_api",
"//components/safe_search_api:safe_search_client",
"//components/viz/service",
"//content/public/browser",
"//content/public/common",
"//content/public/common:service_names",
"//device/bluetooth",
"//gpu",
"//ipc",
"//media",
"//media/mojo/services:media_manifest",
"//net",
"//services/media_session/public/mojom",
"//services/service_manager/public/cpp",
"//ui/base",
"//ui/compositor",
"//ui/display",
"//ui/events",
"//ui/events/devices",
"//ui/gl",
]
if (is_android) {
sources += [
"android/cast_content_window_android.cc",
"android/cast_content_window_android.h",
"android/cast_metrics_helper_android.cc",
]
deps += [
":jni_headers",
"//components/cdm/browser",
"//components/embedder_support/android:view",
]
} else {
sources += [
"cast_display_configurator.cc",
"cast_display_configurator.h",
"cast_touch_device_manager.cc",
"cast_touch_device_manager.h",
]
deps += [
"//mojo/public/cpp/bindings",
"//ui/aura",
]
}
if (is_linux) {
sources += [
"cast_memory_pressure_monitor.cc",
"cast_memory_pressure_monitor.h",
"memory_pressure_controller_impl.cc",
"memory_pressure_controller_impl.h",
]
deps += [ "//third_party/fontconfig" ]
}
if (use_aura) {
sources += [
"cast_content_window_aura.cc",
"cast_content_window_aura.h",
]
deps += [ "//ui/views:views" ]
}
if (!is_fuchsia) {
# TODO(crbug.com/753619): Enable crash reporting on Fuchsia.
deps += [
"//components/crash/content/app",
"//components/crash/content/browser",
]
# TODO(crbug.com/933142): Fuchsia needs its own methods to bridge with heap
# profiling service
deps += [
"//components/heap_profiling",
"//components/services/heap_profiling",
"//components/services/heap_profiling/public/cpp",
"//components/services/heap_profiling/public/mojom",
]
}
if (use_ozone) {
deps += [ "//ui/ozone" ]
}
if (enable_mojo_media) {
deps += [
"//media/mojo/interfaces:constants",
"//media/mojo/services",
]
}
if (enable_external_mojo_services) {
deps += [ "//chromecast/external_mojo/broker_service" ]
}
if (enable_chromecast_extensions) {
sources += [
"cast_extension_host.cc",
"cast_extension_host.h",
"cast_extension_message_filter.cc",
"cast_extension_message_filter.h",
"cast_extension_url_loader_factory.cc",
"cast_extension_url_loader_factory.h",
"extension_page.cc",
"extension_page.h",
"extensions/api/accessibility_private/accessibility_extension_api.cc",
"extensions/api/accessibility_private/accessibility_extension_api.h",
"extensions/api/automation_internal/chromecast_automation_internal_api_delegate.cc",
"extensions/api/automation_internal/chromecast_automation_internal_api_delegate.h",
"extensions/api/bookmarks/bookmarks_api.cc",
"extensions/api/bookmarks/bookmarks_api.h",
"extensions/api/braille_display_private/braille_display_private_api.cc",
"extensions/api/braille_display_private/braille_display_private_api.h",
"extensions/api/history/history_api.cc",
"extensions/api/history/history_api.h",
"extensions/api/i18n/i18n_api.cc",
"extensions/api/i18n/i18n_api.h",
"extensions/api/identity/identity_api.cc",
"extensions/api/identity/identity_api.h",
"extensions/api/notifications/notifications_api.cc",
"extensions/api/notifications/notifications_api.h",
"extensions/api/settings_private/settings_private_api.cc",
"extensions/api/settings_private/settings_private_api.h",
"extensions/api/tabs/tabs_api.cc",
"extensions/api/tabs/tabs_api.h",
"extensions/api/tabs/tabs_constants.cc",
"extensions/api/tabs/tabs_constants.h",
"extensions/api/tts/tts_extension_api.cc",
"extensions/api/tts/tts_extension_api.h",
"extensions/api/tts/tts_extension_api_constants.cc",
"extensions/api/tts/tts_extension_api_constants.h",
"extensions/cast_extension_host_delegate.cc",
"extensions/cast_extension_host_delegate.h",
"extensions/cast_extension_system.cc",
"extensions/cast_extension_system.h",
"extensions/cast_extension_system_factory.cc",
"extensions/cast_extension_system_factory.h",
"extensions/cast_extension_web_contents_observer.cc",
"extensions/cast_extension_web_contents_observer.h",
"extensions/cast_extensions_api_client.cc",
"extensions/cast_extensions_api_client.h",
"extensions/cast_extensions_browser_api_provider.cc",
"extensions/cast_extensions_browser_api_provider.h",
"extensions/cast_extensions_browser_client.cc",
"extensions/cast_extensions_browser_client.h",
"extensions/cast_prefs.cc",
"extensions/cast_prefs.h",
"extensions/stub_storage_monitor.cc",
]
if (use_aura) {
sources += [
"accessibility/accessibility_manager.cc",
"accessibility/accessibility_manager.h",
"accessibility/accessibility_sound_player.h",
"accessibility/accessibility_sound_proxy.cc",
"accessibility/accessibility_sound_proxy.h",
"accessibility/touch_exploration_controller.cc",
"accessibility/touch_exploration_controller.h",
"accessibility/touch_exploration_manager.cc",
"accessibility/touch_exploration_manager.h",
"ui/aura/accessibility/automation_manager_aura.cc",
"ui/aura/accessibility/automation_manager_aura.h",
"ui/aura/accessibility/ax_tree_source_aura.cc",
"ui/aura/accessibility/ax_tree_source_aura.h",
]
}
deps += [
"//chromecast/common/extensions_api:api",
"//components/guest_view/browser",
"//components/keyed_service/content",
"//components/pref_registry",
"//components/storage_monitor",
"//components/user_prefs:user_prefs",
"//components/version_info",
"//components/zoom",
"//extensions/browser",
"//extensions/browser:core_api_provider",
"//extensions/common",
"//extensions/common/api",
"//google_apis:google_apis",
"//ui/events:gesture_detection",
"//ui/views:views",
"//ui/wm/public:public",
]
}
if (enable_cast_wayland_server) {
sources += [
"exo/wayland_server_controller.cc",
"exo/wayland_server_controller.h",
"exo/wm_helper_cast_shell.cc",
"exo/wm_helper_cast_shell.h",
]
deps += [
"//components/exo",
"//components/exo/wayland",
"//services/viz/privileged/interfaces/compositing",
"//ui/display/manager",
]
}
configs += [ "//media/audio:platform_config" ]
if (chromecast_branding != "public") {
deps += [
"//chromecast/internal/shell/browser:cast_content_browser_internal_manifest_overlay",
"//chromecast/internal/shell/browser:cast_content_packaged_services_internal_manifest_overlay",
"//chromecast/internal/shell/browser:cast_content_renderer_internal_manifest_overlay",
]
defines = [ "USE_INTERNAL_OVERLAY_MANIFESTS=1" ]
}
}
cast_source_set("network_context_manager") {
sources = [
"network_context_manager.cc",
"network_context_manager.h",
]
deps = [
"//base",
"//components/variations/net",
"//content/public/browser",
"//net",
"//services/network:network_service",
]
}
# Lightweight target for Cast interfaces that wrap //content/public/browser.
# This target should only include interfaces which are required for unit tests.
cast_source_set("public") {
sources = [
"cast_content_window.cc",
"cast_content_window.h",
"cast_web_contents.cc",
"cast_web_contents.h",
"cast_web_view.cc",
"cast_web_view.h",
]
# Need to expose this so that internal public_configs are propagated.
public_deps = [
"//chromecast/common/mojom",
"//content/public/browser",
]
deps = [
"//base",
"//chromecast/graphics",
"//content/public/common",
"//ui/events",
"//url",
]
}
cast_source_set("test_support") {
testonly = true
sources = [
"test/cast_browser_test.cc",
"test/cast_browser_test.h",
]
public_deps = [
":browser",
"//content/test:test_support",
]
deps = [
"//base",
"//chromecast/base",
"//components/prefs:test_support",
"//content/public/browser",
"//content/public/common",
"//testing/gtest",
]
}
cast_source_set("browsertests") {
testonly = true
sources = [
"cast_content_gesture_handler_test.cc",
"cast_media_blocker_browsertest.cc",
"cast_web_contents_browsertest.cc",
"renderer_prelauncher_test.cc",
"test/cast_features_browsertest.cc",
"test/cast_navigation_browsertest.cc",
]
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
deps = [
":test_support",
"//base",
"//chromecast:chromecast_buildflags",
"//chromecast/base",
"//chromecast/base:chromecast_switches",
"//chromecast/base/metrics",
"//components/prefs",
"//content/public/browser",
"//content/test:test_support",
"//media:test_support",
"//net:test_support",
]
data = [
"//chromecast/browser/test/data/",
"//media/test/data/",
]
}
cast_source_set("unittests") {
testonly = true
sources = [
"bluetooth/cast_bluetooth_chooser_unittest.cc",
"cast_media_blocker_unittest.cc",
"cast_network_delegate_unittest.cc",
"cast_session_id_map_unittest.cc",
"devtools/cast_devtools_manager_delegate_unittest.cc",
"lru_renderer_cache_test.cc",
"network_context_manager_unittest.cc",
]
deps = [
":browser",
":network_context_manager",
"//base",
"//chromecast/base",
"//content/public/browser",
"//content/test:test_support",
"//net:test_support",
"//services/network:test_support",
"//ui/events/devices:devices",
"//ui/gl:test_support",
]
if (!is_android) {
sources += [ "cast_touch_device_manager_unittest.cc" ]
}
if (enable_chromecast_extensions && use_aura) {
sources += [ "accessibility/touch_exploration_controller_unittest.cc" ]
deps += [
"//ui/aura:test_support",
"//ui/events:test_support",
]
}
}
if (is_android) {
generate_jni("jni_headers") {
sources = [
"android/apk/src/org/chromium/chromecast/shell/CastContentWindowAndroid.java",
"android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java",
"android/apk/src/org/chromium/chromecast/shell/CastMetricsHelper.java",
"android/apk/src/org/chromium/chromecast/shell/CastSysInfoAndroid.java",
]
if (is_android_things_non_public) {
sources += [ "android/apk/src/org/chromium/chromecast/shell/CastSysInfoAndroidThings.java" ]
}
}
java_cpp_enum("java_enums") {
sources = [
"cast_content_window.h",
]
}
}