# 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("//content/browser/browser.gni") import("//media/media_options.gni") source_set("browser") { # Only the public target should depend on this. All other targets (even # internal content ones) should depend on the public one. visibility = [ "//content/public/browser:browser_sources" ] configs += [ "//build/config:precompiled_headers", "//content/public/common:mojo_shell_client", ] defines = [] libs = [] ldflags = [] # Shared deps. See also non-iOS deps below. deps = [ "//base", "//base:base_static", "//components/mime_util", "//components/url_formatter", "//content:resources", "//content/browser/background_sync:background_sync_proto", "//content/browser/cache_storage:cache_storage_proto", "//content/browser/notifications:notification_proto", "//content/browser/service_worker:service_worker_proto", "//content/browser/speech/proto", "//content/public/common:common_sources", "//content/public/common:mojo_bindings", "//crypto", "//device/battery", "//device/vibration", "//google_apis", "//mojo/application/public/cpp:cpp_for_chromium", "//mojo/application/public/interfaces", "//mojo/common", "//mojo/package_manager", "//mojo/public/cpp/bindings", "//mojo/shell", "//net", "//net:extras", "//skia", "//sql", "//third_party/WebKit/public:blink_headers", "//third_party/npapi", "//third_party/re2", "//third_party/zlib", "//third_party/zlib:zip", "//ui/accessibility", "//ui/accessibility:ax_gen", "//ui/base", "//ui/base/ime", "//ui/events", "//ui/events:gesture_detection", "//ui/gfx", "//ui/gfx/geometry", "//ui/gl", "//ui/native_theme", "//ui/resources", "//ui/snapshot", ] if (is_ios) { # iOS doesn't get the normal file list and only takes these whitelisted # files. sources = [ "browser_context.cc", "browser_main_loop.cc", "browser_main_runner.cc", "browser_process_sub_thread.cc", "browser_thread_impl.cc", "browser_url_handler_impl.cc", "cert_store_impl.cc", "download/download_create_info.cc", "notification_service_impl.cc", "signed_certificate_timestamp_store_impl.cc", "user_metrics.cc", "web_contents/navigation_entry_impl.cc", ] } else { # Normal non-iOS sources get everything. sources = rebase_path(content_browser_gypi_values.private_browser_sources, ".", "//content") # TODO(GYP) these generated files are listed as sources in content_browser. # This is a bit suspicious. The GN grit template will make a source set # containing the generated code so it should be sufficient to just depend # on the grit rule. But maybe some of these will need to be added? # # Need this annoying rebase_path call to match what happened with the # sources. sources -= rebase_path( [ "$root_gen_dir/blink/grit/devtools_resources.h", "$root_gen_dir/blink/grit/devtools_resources_map.cc", "$root_gen_dir/blink/grit/devtools_resources_map.h", "$root_gen_dir/content/browser/tracing/grit/tracing_resources.h", "$root_gen_dir/ui/resources/grit/webui_resources_map.cc", ], ".") sources += [ "mojo/mojo_shell_client_host.cc", "mojo/mojo_shell_client_host.h", ] # Non-iOS deps. deps += [ "//cc", "//cc/surfaces", "//components/scheduler:common", "//content/app/resources", "//content/app/strings", "//content/browser/devtools:gen_devtools_protocol_handler", "//content/browser/devtools:resources", "//content/common:mojo_bindings", "//content/public/common:mojo_bindings", "//device/bluetooth", "//gin", "//mojo/application/public/interfaces", "//mojo/common:url_type_converters", "//mojo/converters/geometry", "//mojo/public/cpp/bindings", "//mojo/public/js", "//skia/public", "//storage/browser", "//storage/common", "//third_party/WebKit/public:image_resources", "//third_party/WebKit/public:resources", "//third_party/angle:commit_id", "//third_party/icu", "//third_party/leveldatabase", "//third_party/libyuv", "//ui/events/blink", "//ui/resources", "//ui/surface", "//ui/touch_selection", ] configs += [ "//v8:external_startup_data" ] } configs += [ "//content:content_implementation", "//third_party/WebKit/public:debug_devtools", ] if (toolkit_views) { deps += [ "//ui/events" ] } if (!is_win) { sources += [ "file_descriptor_info_impl.cc", "file_descriptor_info_impl.h", ] sources -= [ "renderer_host/web_input_event_aurawin.cc" ] } if (!is_win && !is_mac && !is_android && (!is_linux || !use_udev)) { sources += [ "gamepad/gamepad_platform_data_fetcher.cc" ] } if (enable_basic_printing || enable_print_preview) { deps += [ "//printing" ] } # TODO(GYP) # ['OS!="ios" and chrome_multiple_dll!=1', { # 'dependencies': [ # '../third_party/WebKit/public/blink.gyp:blink', # ], # }], if (!is_mac && !is_ios) { deps += [ "//sandbox" ] } if (!is_android && !is_ios) { deps += [ "//content/browser/tracing:resources" ] } if (enable_webrtc) { sources += rebase_path(content_browser_gypi_values.webrtc_browser_sources, ".", "//content") deps += [ "//jingle:jingle_glue" ] if (is_linux) { deps += [ "//third_party/libjingle:libjingle_webrtc" ] } if (is_linux || is_mac || is_win) { sources += [ "media/capture/desktop_capture_device.cc", "media/capture/desktop_capture_device.h", "media/capture/desktop_capture_device_uma_types.cc", "media/capture/desktop_capture_device_uma_types.h", ] if (use_aura) { sources += [ "media/capture/aura_window_capture_machine.cc", "media/capture/aura_window_capture_machine.h", "media/capture/desktop_capture_device_aura.cc", "media/capture/desktop_capture_device_aura.h", ] } defines += [ "ENABLE_SCREEN_CAPTURE=1" ] deps += [ "//third_party/webrtc/modules/desktop_capture" ] } } if (is_win) { sources -= [ "device_sensors/data_fetcher_shared_memory_default.cc", "geolocation/empty_wifi_data_provider.cc", ] defines += [ # This prevents the inclusion of atlhost.h which paired # with the windows 8 sdk it does the wrong thing. "__ATLHOST_H__", ] deps += [ "//third_party/iaccessible2", "//third_party/isimpledom", ] libs += [ "comctl32.lib", "dinput8.lib", "dwmapi.lib", "dxguid.lib", "oleacc.lib", "sensorsapi.lib", "portabledeviceguids.lib", ] # TODI(GYP) # 'msvs_settings': { # 'VCLinkerTool': { # 'DelayLoadDLLs': [ # 'dinput8.dll', # 'user32.dll', # 'dwmapi.dll', # ], } if (use_udev) { deps += [ "//device/udev_linux" ] } else { # Remove udev-specific sources. sources -= [ "device_monitor_udev.cc", "device_monitor_udev.h", ] if (is_linux) { # Already filtered out on non-Linux. sources -= [ "gamepad/gamepad_platform_data_fetcher_linux.cc", "udev_linux.cc", "udev_linux.h", ] } } if (enable_plugins) { sources += rebase_path(content_browser_gypi_values.plugin_browser_sources, ".", "//content") deps += [ "//ppapi/host", "//ppapi/proxy:ipc", "//ppapi/shared_impl", ] if (!use_ozone || use_pango) { sources -= [ "renderer_host/pepper/pepper_truetype_font_list_ozone.cc" ] } if (!use_pango) { sources -= [ "renderer_host/pepper/pepper_truetype_font_list_pango.cc" ] } } if (use_atk) { sources += rebase_path(content_browser_gypi_values.auralinux_browser_sources, ".", "//content") configs += [ "//build/config/linux:atk", "//build/config/linux:atk_warnings", "//build/config/linux:gconf", "//build/config/linux:glib", ] } if (is_linux && use_aura) { deps += [ "//build/linux:fontconfig" ] } if (use_x11) { configs += [ "//build/config/linux:x11" ] deps += [ "//ui/gfx/x" ] } # Dealing with power_save_blocker_{x11,ozone}.cc is a little complicated # given the interaction between os_chromeos and the feature flags for X11 and # ozone, so do it all in one spot. if (is_chromeos || !use_ozone) { sources -= [ "power_save_blocker_ozone.cc" ] } if (is_chromeos || !use_x11) { sources -= [ "power_save_blocker_x11.cc" ] } # Dealing with *wifi_data_provider_*.cc is also a bit complicated given # android, chromeos, linux and use_dbus. if (is_android) { sources -= [ "geolocation/wifi_data_provider_common.cc" ] } if (is_chromeos || (is_linux && !use_dbus)) { sources -= [ "geolocation/wifi_data_provider_linux.cc" ] } if (is_linux && use_dbus) { sources -= [ "geolocation/empty_wifi_data_provider.cc" ] } if (use_pango) { configs += [ "//build/config/linux:pangocairo" ] } if (is_android) { sources += rebase_path(content_browser_gypi_values.android_browser_sources, ".", "//content") sources -= [ "browser_ipc_logging.cc", "device_sensors/data_fetcher_shared_memory_default.cc", "geolocation/network_location_provider.cc", "geolocation/network_location_provider.h", "geolocation/network_location_request.cc", "geolocation/network_location_request.h", "power_usage_monitor_impl.cc", "power_usage_monitor_impl.h", "tracing/tracing_ui.cc", "tracing/tracing_ui.h", # Android skips most, but not all, of the speech code. "speech/audio_buffer.cc", "speech/audio_buffer.h", "speech/audio_encoder.cc", "speech/audio_encoder.h", "speech/chunked_byte_buffer.cc", "speech/chunked_byte_buffer.h", "speech/endpointer/endpointer.cc", "speech/endpointer/endpointer.h", "speech/endpointer/energy_endpointer.cc", "speech/endpointer/energy_endpointer.h", "speech/endpointer/energy_endpointer_params.cc", "speech/endpointer/energy_endpointer_params.h", "speech/google_one_shot_remote_engine.cc", "speech/google_one_shot_remote_engine.h", "speech/google_streaming_remote_engine.cc", "speech/google_streaming_remote_engine.h", "speech/speech_recognition_engine.cc", "speech/speech_recognition_engine.h", "speech/speech_recognizer_impl.cc", "speech/speech_recognizer_impl.h", ] if (!use_aura) { sources += rebase_path( content_browser_gypi_values.android_non_aura_browser_sources, ".", "//content") sources += rebase_path( content_browser_gypi_values.android_in_process_browser_sources, ".", "//content") sources -= [ "renderer_host/begin_frame_observer_proxy.cc" ] deps += [ "//ui/android" ] } deps -= [ "//device/battery" ] deps += [ "//content/public/android:jni", "//media", "//mojo/android:libsystem_java", ] defines += [ "APPCACHE_USE_SIMPLE_CACHE" ] libs += [ "jnigraphics" ] } if (is_mac) { sources -= [ "device_sensors/data_fetcher_shared_memory_default.cc", "geolocation/empty_wifi_data_provider.cc", "geolocation/empty_wifi_data_provider.h", ] deps += [ "//sandbox/mac:sandbox", "//third_party/mozilla", "//third_party/sudden_motion_sensor", "//ui/accelerated_widget_mac", ] libs += [ "bsm", "QTKit.framework", ] } if (is_chromeos) { sources -= [ "device_sensors/data_fetcher_shared_memory_default.cc" ] deps += [ "//chromeos", "//chromeos:power_manager_proto", ] } if (use_aura) { deps += [ "//components/bitmap_uploader", "//ui/aura", "//ui/aura_extra", "//ui/strings", "//ui/views/mus:for_component", "//ui/wm", ] sources += [ "compositor/software_output_device_mus.cc", "compositor/software_output_device_mus.h", "frame_host/render_widget_host_view_mus.cc", "frame_host/render_widget_host_view_mus.h", "web_contents/web_contents_view_mus.cc", "web_contents/web_contents_view_mus.h", ] defines += [ "MOJO_RUNNER_CLIENT" ] } else { # Not aura. sources -= [ "media/capture/cursor_renderer_aura.cc", "media/capture/cursor_renderer_aura.h", "renderer_host/compositor_resize_lock_aura.cc", "renderer_host/compositor_resize_lock_aura.h", "renderer_host/input/synthetic_gesture_target_aura.cc", "renderer_host/input/synthetic_gesture_target_aura.h", "renderer_host/input/touch_selection_controller_client_aura.cc", "renderer_host/input/touch_selection_controller_client_aura.h", "renderer_host/native_web_keyboard_event_aura.cc", "renderer_host/render_widget_host_view_aura.cc", "renderer_host/render_widget_host_view_aura.h", "renderer_host/ui_events_helper.cc", "renderer_host/ui_events_helper.h", "renderer_host/web_input_event_aura.cc", "renderer_host/web_input_event_aura.h", "web_contents/aura/gesture_nav_simple.cc", "web_contents/aura/gesture_nav_simple.h", "web_contents/aura/overscroll_navigation_overlay.cc", "web_contents/aura/overscroll_navigation_overlay.h", "web_contents/aura/overscroll_window_animation.cc", "web_contents/aura/overscroll_window_animation.h", "web_contents/aura/overscroll_window_delegate.cc", "web_contents/aura/overscroll_window_delegate.h", "web_contents/aura/shadow_layer_delegate.cc", "web_contents/aura/shadow_layer_delegate.h", "web_contents/web_contents_view_aura.cc", "web_contents/web_contents_view_aura.h", ] } if (use_aura || is_mac) { sources += rebase_path(content_browser_gypi_values.compositor_browser_sources, ".", "//content") if (!use_x11) { sources -= [ "compositor/software_output_device_x11.cc", "compositor/software_output_device_x11.h", ] } if (!use_ozone) { sources -= [ "compositor/browser_compositor_overlay_candidate_validator_ozone.cc", "compositor/browser_compositor_overlay_candidate_validator_ozone.h", "compositor/software_output_device_ozone.cc", "compositor/software_output_device_ozone.h", ] } deps += [ "//ui/compositor" ] } if (!is_ios) { sources += [ "compositor/surface_utils.cc", "compositor/surface_utils.h", ] } if (enable_web_speech) { deps += [ "//third_party/flac" ] } if (is_linux && use_dbus) { deps += [ "//dbus" ] } if (enable_browser_cdms) { sources += [ "media/cdm/browser_cdm_manager.cc", "media/cdm/browser_cdm_manager.h", "media/media_web_contents_observer.cc", "media/media_web_contents_observer.h", ] } if (is_linux) { deps += [ "//third_party/boringssl" ] } if (enable_mojo_media != "none") { configs += [ "//media/mojo/services:enable_mojo_media_config" ] } if (enable_mojo_media == "browser") { deps += [ "//media/mojo/services:application" ] } if (enable_webvr) { sources += [ "vr/vr_device.cc", "vr/vr_device.h", "vr/vr_device_manager.cc", "vr/vr_device_manager.h", "vr/vr_device_provider.h", ] } if (enable_webvr && is_android) { sources += [ "vr/android/cardboard/cardboard_vr_device.cc", "vr/android/cardboard/cardboard_vr_device.h", "vr/android/cardboard/cardboard_vr_device_provider.cc", "vr/android/cardboard/cardboard_vr_device_provider.h", ] } }