1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/config/features.gni")
6 import("//build/config/ui.gni")
7 import("//content/browser/browser.gni")
8 import("//media/media_options.gni")
10 source_set("browser") {
11 # Only the public target should depend on this. All other targets (even
12 # internal content ones) should depend on the public one.
13 visibility = [ "//content/public/browser:browser_sources" ]
19 # Shared deps. See also non-iOS deps below.
23 "//content:resources",
24 "//content/browser/service_worker:proto",
25 "//content/browser/speech/proto",
26 "//content/public/common:common_sources",
32 "//third_party/npapi",
34 "//third_party/WebKit/public:blink_headers",
36 "//third_party/zlib:zip",
38 "//ui/accessibility:ax_gen",
41 "//ui/events:gesture_detection",
51 # iOS doesn't get the normal file list and only takes these whitelisted
55 "browser_main_loop.cc",
56 "browser_main_runner.cc",
57 "browser_process_sub_thread.cc",
58 "browser_thread_impl.cc",
59 "browser_url_handler_impl.cc",
61 "download/download_create_info.cc",
62 "notification_service_impl.cc",
63 "signed_certificate_timestamp_store_impl.cc",
65 "web_contents/navigation_entry_impl.cc",
68 # Normal non-iOS sources get everything.
69 sources = rebase_path(content_browser_gypi_values.private_browser_sources,
72 # TODO(GYP) these generated files are listed as sources in content_browser.
73 # This is a bit suspicious. The GN grit template will make a source set
74 # containing the generated code so it should be sufficient to just depend
75 # on the grit rule. But maybe some of these will need to be added?
77 # Need this annoying rebase_path call to match what happened with the
79 sources -= rebase_path([
80 "$root_gen_dir/webkit/grit/devtools_resources.h",
81 "$root_gen_dir/webkit/grit/devtools_resources_map.cc",
82 "$root_gen_dir/webkit/grit/devtools_resources_map.h",
83 "$root_gen_dir/content/browser/tracing/grit/tracing_resources.h",
84 "$root_gen_dir/ui/resources/grit/webui_resources_map.cc",
85 "$root_gen_dir/content/browser/devtools/devtools_protocol_constants.cc",
86 "$root_gen_dir/content/browser/devtools/devtools_protocol_constants.h",
87 "$root_gen_dir/content/browser/devtools/protocol/devtools_protocol_handler_impl.cc",
88 "$root_gen_dir/content/browser/devtools/protocol/devtools_protocol_handler_impl.h",
95 "//content/app/resources",
96 "//content/app/strings",
97 "//content/browser/devtools:resources",
98 "//content/common:mojo_bindings",
99 "//mojo/public/cpp/bindings",
100 "//mojo/public/interfaces/application",
101 "//mojo/public/js/bindings",
105 "//third_party/WebKit/public:resources",
106 "//third_party/angle:commit_id",
108 "//third_party/leveldatabase",
109 "//third_party/libyuv",
116 "//content:content_implementation",
120 deps += [ "//ui/events" ]
125 "power_profiler/power_data_provider_ia_win.cc",
126 "power_profiler/power_data_provider_ia_win.h",
128 deps += [ "//third_party/power_gadget" ]
131 "power_profiler/power_data_provider_dummy.cc",
132 "file_descriptor_info_impl.cc",
133 "file_descriptor_info_impl.h",
135 sources -= [ "renderer_host/web_input_event_aurawin.cc" ]
138 if (!is_win && !is_mac && !is_android && (!is_linux || !use_udev)) {
139 sources += [ "gamepad/gamepad_platform_data_fetcher.cc" ]
142 if (printing_mode != 0) {
143 deps += [ "//printing" ]
147 # ['OS!="ios" and chrome_multiple_dll!=1', {
149 # '../third_party/WebKit/public/blink.gyp:blink',
152 if (!is_mac && !is_ios) {
153 deps += [ "//sandbox" ]
155 if (!is_android && !is_ios) {
156 deps += [ "//content/browser/tracing:resources" ]
160 sources += rebase_path(content_browser_gypi_values.webrtc_browser_sources,
162 deps += [ "//jingle:jingle_glue" ]
164 deps += [ "//third_party/libjingle:libjingle_webrtc" ]
166 if (is_linux || is_mac || is_win) {
168 "media/capture/desktop_capture_device.cc",
169 "media/capture/desktop_capture_device.h",
170 "media/capture/desktop_capture_device_uma_types.cc",
171 "media/capture/desktop_capture_device_uma_types.h",
175 "media/capture/desktop_capture_device_aura.cc",
176 "media/capture/desktop_capture_device_aura.h",
179 defines += [ "ENABLE_SCREEN_CAPTURE=1" ]
180 deps += [ "//third_party/webrtc/modules/desktop_capture" ]
186 "device_sensors/data_fetcher_shared_memory_default.cc",
187 "geolocation/empty_wifi_data_provider.cc",
190 # This prevents the inclusion of atlhost.h which paired
191 # with the windows 8 sdk it does the wrong thing.
195 "//third_party/iaccessible2",
196 "//third_party/isimpledom",
204 "portabledeviceguids.lib",
217 deps += [ "//sandbox/linux:libc_urandom_override" ]
221 configs += [ "//build/config/linux:udev" ]
223 # Remove udev-specific sources.
225 "device_monitor_udev.cc",
226 "device_monitor_udev.h",
229 # Already filtered out on non-Linux.
231 "gamepad/gamepad_platform_data_fetcher_linux.cc",
238 if (enable_plugins) {
239 sources += rebase_path(content_browser_gypi_values.plugin_browser_sources,
243 "//ppapi:ppapi_shared",
245 if (!use_ozone || use_pango) {
246 sources -= [ "renderer_host/pepper/pepper_truetype_font_list_ozone.cc" ]
249 sources -= [ "renderer_host/pepper/pepper_truetype_font_list_pango.cc" ]
253 if (is_linux && use_aura) {
254 configs += [ "//build/config/linux:fontconfig" ]
258 configs += [ "//build/config/linux:x11" ]
261 # Dealing with power_save_blocker_{x11,ozone}.cc is a little complicated
262 # given the interaction between os_chromeos and the feature flags for X11 and
263 # ozone, so do it all in one spot.
264 if (is_chromeos || !use_ozone) {
265 sources -= [ "power_save_blocker_ozone.cc", ]
267 if (is_chromeos || !use_x11) {
268 sources -= [ "power_save_blocker_x11.cc", ]
271 # Dealing with battery_status_manager_*.cc and *wifi_data_provider_*.cc
272 # is also a bit complicated given android, chromeos, linux and use_dbus.
273 if (is_android || is_chromeos || (is_linux && use_dbus)) {
274 sources -= [ "battery_status/battery_status_manager_default.cc" ]
276 if (is_chromeos || (is_linux && !use_dbus)) {
277 # This will already have gotten removed for all non-Linux cases.
279 "battery_status/battery_status_manager_linux.cc",
280 "geolocation/wifi_data_provider_linux.cc"
285 sources -= [ "geolocation/wifi_data_provider_common.cc" ]
287 if (is_linux && use_dbus) {
288 sources -= [ "geolocation/empty_wifi_data_provider.cc" ]
292 configs += [ "//build/config/linux:pangocairo" ]
296 sources += rebase_path(content_browser_gypi_values.android_browser_sources,
299 "browser_ipc_logging.cc",
300 "device_sensors/data_fetcher_shared_memory_default.cc",
301 "font_list_async.cc",
302 "geolocation/network_location_provider.cc",
303 "geolocation/network_location_provider.h",
304 "geolocation/network_location_request.cc",
305 "geolocation/network_location_request.h",
306 "renderer_host/native_web_keyboard_event.cc",
307 "tracing/tracing_ui.cc",
308 "tracing/tracing_ui.h",
310 # Android skips most, but not all, of the speech code.
311 "speech/audio_buffer.cc",
312 "speech/audio_buffer.h",
313 "speech/audio_encoder.cc",
314 "speech/audio_encoder.h",
315 "speech/chunked_byte_buffer.cc",
316 "speech/chunked_byte_buffer.h",
317 "speech/endpointer/endpointer.cc",
318 "speech/endpointer/endpointer.h",
319 "speech/endpointer/energy_endpointer.cc",
320 "speech/endpointer/energy_endpointer.h",
321 "speech/endpointer/energy_endpointer_params.cc",
322 "speech/endpointer/energy_endpointer_params.h",
323 "speech/google_one_shot_remote_engine.cc",
324 "speech/google_one_shot_remote_engine.h",
325 "speech/google_streaming_remote_engine.cc",
326 "speech/google_streaming_remote_engine.h",
327 "speech/speech_recognition_engine.cc",
328 "speech/speech_recognition_engine.h",
329 "speech/speech_recognizer_impl.cc",
330 "speech/speech_recognizer_impl.h",
333 "//content/public/android:jni",
335 "//mojo/android:libsystem_java",
337 libs += [ "jnigraphics" ]
342 "device_sensors/data_fetcher_shared_memory_default.cc",
343 "geolocation/empty_wifi_data_provider.cc",
344 "geolocation/empty_wifi_data_provider.h",
350 deps += [ "//chromeos:power_manager_proto" ]
361 "renderer_host/input/synthetic_gesture_target_aura.cc",
362 "renderer_host/input/synthetic_gesture_target_aura.h",
363 "renderer_host/native_web_keyboard_event_aura.cc",
364 "renderer_host/render_widget_host_view_aura.cc",
365 "renderer_host/render_widget_host_view_aura.h",
366 "renderer_host/ui_events_helper.cc",
367 "renderer_host/ui_events_helper.h",
368 "renderer_host/web_input_event_aura.cc",
369 "renderer_host/web_input_event_aura.h",
370 "web_contents/aura/gesture_nav_simple.cc",
371 "web_contents/aura/gesture_nav_simple.h",
372 "web_contents/aura/image_window_delegate.cc",
373 "web_contents/aura/image_window_delegate.h",
374 "web_contents/aura/overscroll_navigation_overlay.cc",
375 "web_contents/aura/overscroll_navigation_overlay.h",
376 "web_contents/aura/shadow_layer_delegate.cc",
377 "web_contents/aura/shadow_layer_delegate.h",
378 "web_contents/aura/window_slider.cc",
379 "web_contents/aura/window_slider.h",
380 "web_contents/touch_editable_impl_aura.cc",
381 "web_contents/touch_editable_impl_aura.h",
382 "web_contents/web_contents_view_aura.cc",
383 "web_contents/web_contents_view_aura.h",
387 if (use_aura || is_mac) {
388 sources += rebase_path(
389 content_browser_gypi_values.compositor_browser_sources,
393 "compositor/software_output_device_x11.cc",
394 "compositor/software_output_device_x11.h",
400 "compositor/overlay_candidate_validator_ozone.cc",
401 "compositor/overlay_candidate_validator_ozone.h",
402 "compositor/software_output_device_ozone.cc",
403 "compositor/software_output_device_ozone.h",
406 deps += [ "//ui/compositor" ]
409 if (enable_web_speech) {
411 "//third_party/flac",
412 "//third_party/speex",
416 if (is_linux && use_dbus) {
420 if (enable_browser_cdms) {
422 "media/cdm/browser_cdm_manager.cc",
423 "media/cdm/browser_cdm_manager.h",
424 "media/media_web_contents_observer.cc",
425 "media/media_web_contents_observer.h",