# 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/config/ui.gni") import("//chromecast/chromecast.gni") import("//media/media_options.gni") import("//services/service_manager/public/service_manifest.gni") import("//testing/test.gni") import("//tools/grit/grit_rule.gni") if (is_android) { import("//build/config/android/rules.gni") } cast_source_set("browser") { sources = [ "application_media_capabilities.cc", "application_media_capabilities.h", "application_session_id_manager.cc", "application_session_id_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_download_manager_delegate.cc", "cast_download_manager_delegate.h", "cast_gesture_dispatcher.cc", "cast_gesture_dispatcher.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_delegate.cc", "cast_network_delegate.h", "cast_network_request_interceptor.cc", "cast_network_request_interceptor.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_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", "devtools/cast_devtools_manager_delegate.cc", "devtools/cast_devtools_manager_delegate.h", "devtools/remote_debugging_server.cc", "devtools/remote_debugging_server.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", "metrics/cast_metrics_prefs.cc", "metrics/cast_metrics_prefs.h", "metrics/cast_metrics_service_client.cc", "metrics/cast_metrics_service_client.h", "metrics/cast_stability_metrics_provider.cc", "metrics/cast_stability_metrics_provider.h", "network_context_manager.cc", "network_context_manager.h", "pref_service_helper.cc", "pref_service_helper.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", "pref_service_helper_simple.cc", ] } public_deps = [ ":public", ] deps = [ "//base", "//base:i18n", "//cc", "//chromecast:chromecast_buildflags", "//chromecast/app:cast_crash_client", "//chromecast/app:chromecast_settings", "//chromecast/app:resources", "//chromecast/base", "//chromecast/base:cast_sys_info", "//chromecast/base:cast_version", "//chromecast/browser:resources", "//chromecast/browser/bluetooth/public/mojom", "//chromecast/common", "//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", # 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/prefs", "//components/proxy_config", "//components/viz/service", "//content", "//content/public/browser", "//content/public/common", "//content/public/common:service_names", "//content/public/utility", "//device/bluetooth", "//gpu", "//ipc", "//media", "//net", "//services/network:network_service", "//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", "metrics/external_metrics.cc", "metrics/external_metrics.h", ] deps += [ "//components/metrics:serialization", "//third_party/fontconfig", ] } if (use_aura) { sources += [ "cast_content_window_aura.cc", "cast_content_window_aura.h", ] } if (!is_fuchsia) { # TODO(crbug.com/753619): Enable crash reporting on Fuchsia. deps += [ "//components/crash/content/app", "//components/crash/content/browser", ] } if (use_ozone) { deps += [ "//ui/ozone" ] } if (enable_mojo_media) { deps += [ "//media/mojo/interfaces:constants", "//media/mojo/services", ] } if (enable_chromecast_extensions) { sources += [ "cast_extension_host.cc", "cast_extension_host.h", "cast_extension_message_filter.cc", "cast_extension_message_filter.h", "cast_web_view_extension.cc", "cast_web_view_extension.h", "extension_request_protocol_handler.cc", "extension_request_protocol_handler.h", "extensions/api/accessibility_private/accessibility_extension_api.cc", "extensions/api/accessibility_private/accessibility_extension_api.h", "extensions/api/automation_internal/automation_event_router.cc", "extensions/api/automation_internal/automation_event_router.h", "extensions/api/automation_internal/automation_internal_api.cc", "extensions/api/automation_internal/automation_internal_api.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/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_display_info_provider.cc", "extensions/cast_display_info_provider.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", "cast_web_view_extension.h", "cast_web_view_extension.h", "ui/aura/accessibility/automation_manager_aura.cc", "ui/aura/accessibility/automation_manager_aura.h", "ui/aura/accessibility/ax_root_obj_wrapper.cc", "ui/aura/accessibility/ax_root_obj_wrapper.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", ] } configs += [ "//media/audio:platform_config" ] } # 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.h", "cast_web_view.cc", "cast_web_view.h", ] # Need to expose this so that internal public_configs are propagated. public_deps = [ "//content/public/browser", ] deps = [ "//base", "//chromecast/graphics", "//content", "//ui/events", "//url", ] } # This target generates an "overlay" interface spec, allowing the Cast build to # declare specific behavior and requirements for the "content_browser" service. # This is accomplished by generating a JSON file, which is packed into # cast_shell.pak, and loaded at runtime. This can be used to host additional # interfaces in "content_browser". # # NOTE: Do not add packaged_services here! packaged_services should instead be # added to "cast_content_packaged_services_manifest_overlay" below or # its internal counterpart. Please see that target for more details. service_manifest("cast_content_browser_manifest_overlay") { source = "cast_content_browser_manifest_overlay.json" if (chromecast_branding != "public") { overlays = [ "//chromecast/internal/shell/browser:cast_content_browser_internal_manifest_overlay" ] } } # This target generates an "overlay" interface spec, allowing the Cast build to # declare specific behavior and requirements for the "content_renderer" service. # This is accomplished by generating a JSON file, which is packed into # cast_shell.pak, and loaded at runtime. This can be used to host additional # interfaces in "content_renderer". service_manifest("cast_content_renderer_manifest_overlay") { source = "cast_content_renderer_manifest_overlay.json" } # This target is for packaged services that will run in the main (browser) # process. To host an embedded service, add the service's manifest target to the # list of "packaged_services" in this target, like so: # # package_services += [ "//path/to/foo/service:foo_manifest" ] # # You must also register the "foo" service with the content client. See # CastContentBrowserClient::RegisterInProcessServices() for details. # # NOTE: If your service's manifest is in chromecast/internal, do not add it # here! Instead, add the service to the internal counterpart, which is # referenced below. service_manifest("cast_content_packaged_services_manifest_overlay") { source = "cast_content_packaged_services_manifest_overlay.json" packaged_services = [ "//media/mojo/services:media_manifest" ] if (chromecast_branding != "public") { overlays = [ "//chromecast/internal/shell/browser:cast_content_packaged_services_internal_manifest_overlay" ] } } grit("resources") { visibility = [ ":browser", "//chromecast:cast_shell_pak", ] source = "cast_browser_resources.grd" output_dir = "$root_gen_dir/chromecast/browser" outputs = [ "grit/cast_browser_resources.h", "cast_browser_resources.pak", ] deps = [ ":cast_content_browser_manifest_overlay", ":cast_content_packaged_services_manifest_overlay", ":cast_content_renderer_manifest_overlay", ] } 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_gesture_dispatcher_test.cc", "cast_media_blocker_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", "//chromecast:chromecast_buildflags", "//chromecast/base", "//chromecast/base:chromecast_switches", "//chromecast/base/metrics", "//components/prefs", "//media:test_support", ] 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_touch_device_manager_unittest.cc", "devtools/cast_devtools_manager_delegate_unittest.cc", "lru_renderer_cache_test.cc", "network_context_manager_unittest.cc", ] deps = [ ":browser", "//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 (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" ] } jni_package = "chromecast" } }