DevTools: cut host and port from webSocketDebuggerUrl in addition to ws:// prefix
[chromium-blink-merge.git] / content / browser / BUILD.gn
blob474f5624af785fef408e77d5e29f954c1ac286fa
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/crypto.gni")
6 import("//build/config/features.gni")
7 import("//build/config/ui.gni")
8 import("//content/browser/browser.gni")
9 import("//media/media_options.gni")
11 source_set("browser") {
12   # Only the public target should depend on this. All other targets (even
13   # internal content ones) should depend on the public one.
14   visibility = [ "//content/public/browser:browser_sources" ]
16   defines = []
17   libs = []
18   ldflags = []
20   # Shared deps. See also non-iOS deps below.
21   deps = [
22     "//base",
23     "//base:base_static",
24     "//components/mime_util",
25     "//content:resources",
26     "//content/browser/background_sync:background_sync_proto",
27     "//content/browser/cache_storage:cache_storage_proto",
28     "//content/browser/notifications:notification_proto",
29     "//content/browser/service_worker:service_worker_proto",
30     "//content/browser/speech/proto",
31     "//content/public/common:common_sources",
32     "//content/public/common:mojo_bindings",
33     "//crypto",
34     "//device/battery",
35     "//device/vibration",
36     "//google_apis",
37     "//mojo/application/public/cpp:cpp_for_chromium",
38     "//mojo/application/public/interfaces",
39     "//mojo/common",
40     "//mojo/shell",
41     "//net",
42     "//net:extras",
43     "//skia",
44     "//sql",
45     "//third_party/mojo/src/mojo/public/cpp/bindings",
46     "//third_party/npapi",
47     "//third_party/re2",
48     "//third_party/WebKit/public:blink_headers",
49     "//third_party/zlib",
50     "//third_party/zlib:zip",
51     "//ui/accessibility",
52     "//ui/accessibility:ax_gen",
53     "//ui/base",
54     "//ui/base/ime",
55     "//ui/events",
56     "//ui/events:gesture_detection",
57     "//ui/gfx",
58     "//ui/gfx/geometry",
59     "//ui/gl",
60     "//ui/native_theme",
61     "//ui/resources",
62     "//ui/snapshot",
63   ]
65   if (is_ios) {
66     # iOS doesn't get the normal file list and only takes these whitelisted
67     # files.
68     sources = [
69       "browser_context.cc",
70       "browser_main_loop.cc",
71       "browser_main_runner.cc",
72       "browser_process_sub_thread.cc",
73       "browser_thread_impl.cc",
74       "browser_url_handler_impl.cc",
75       "cert_store_impl.cc",
76       "download/download_create_info.cc",
77       "notification_service_impl.cc",
78       "signed_certificate_timestamp_store_impl.cc",
79       "user_metrics.cc",
80       "web_contents/navigation_entry_impl.cc",
81     ]
82   } else {
83     # Normal non-iOS sources get everything.
84     sources = rebase_path(content_browser_gypi_values.private_browser_sources,
85                           ".",
86                           "//content")
88     # TODO(GYP) these generated files are listed as sources in content_browser.
89     # This is a bit suspicious. The GN grit template will make a source set
90     # containing the generated code so it should be sufficient to just depend
91     # on the grit rule. But maybe some of these will need to be added?
92     #
93     # Need this annoying rebase_path call to match what happened with the
94     # sources.
95     sources -= rebase_path(
96             [
97               "$root_gen_dir/blink/grit/devtools_resources.h",
98               "$root_gen_dir/blink/grit/devtools_resources_map.cc",
99               "$root_gen_dir/blink/grit/devtools_resources_map.h",
100               "$root_gen_dir/content/browser/tracing/grit/tracing_resources.h",
101               "$root_gen_dir/ui/resources/grit/webui_resources_map.cc",
102             ],
103             ".")
105     # Non-iOS deps.
106     deps += [
107       "//cc",
108       "//cc/surfaces",
109       "//components/scheduler:common",
110       "//content/app/resources",
111       "//content/app/strings",
112       "//content/browser/devtools:gen_devtools_protocol_handler",
113       "//content/browser/devtools:resources",
114       "//content/common:mojo_bindings",
115       "//content/public/common:mojo_bindings",
116       "//device/bluetooth",
117       "//gin",
118       "//mojo/application/public/interfaces",
119       "//storage/browser",
120       "//storage/common",
121       "//third_party/WebKit/public:image_resources",
122       "//third_party/WebKit/public:resources",
123       "//third_party/angle:commit_id",
124       "//third_party/icu",
125       "//third_party/leveldatabase",
126       "//third_party/libyuv",
127       "//third_party/mojo/src/mojo/public/cpp/bindings",
128       "//third_party/mojo/src/mojo/public/js",
129       "//ui/events/blink",
130       "//ui/resources",
131       "//ui/surface",
132       "//ui/touch_selection",
133     ]
134   }
136   configs += [
137     "//content:content_implementation",
138     "//third_party/WebKit/public:debug_devtools",
139   ]
141   if (toolkit_views) {
142     deps += [ "//ui/events" ]
143   }
145   if (is_win) {
146     sources += [
147       "power_profiler/power_data_provider_ia_win.cc",
148       "power_profiler/power_data_provider_ia_win.h",
149     ]
150     deps += [ "//third_party/power_gadget" ]
151   } else {
152     sources += [
153       "file_descriptor_info_impl.cc",
154       "file_descriptor_info_impl.h",
155       "power_profiler/power_data_provider_dummy.cc",
156     ]
157     sources -= [ "renderer_host/web_input_event_aurawin.cc" ]
158   }
160   if (!is_win && !is_mac && !is_android && (!is_linux || !use_udev)) {
161     sources += [ "gamepad/gamepad_platform_data_fetcher.cc" ]
162   }
164   if (enable_basic_printing || enable_print_preview) {
165     deps += [ "//printing" ]
166   }
168   # TODO(GYP)
169   #   ['OS!="ios" and chrome_multiple_dll!=1', {
170   #     'dependencies': [
171   #       '../third_party/WebKit/public/blink.gyp:blink',
172   #     ],
173   #   }],
174   if (!is_mac && !is_ios) {
175     deps += [ "//sandbox" ]
176   }
177   if (!is_android && !is_ios) {
178     deps += [ "//content/browser/tracing:resources" ]
179   }
181   if (enable_webrtc) {
182     sources += rebase_path(content_browser_gypi_values.webrtc_browser_sources,
183                            ".",
184                            "//content")
185     deps += [ "//jingle:jingle_glue" ]
186     if (is_linux) {
187       deps += [ "//third_party/libjingle:libjingle_webrtc" ]
188     }
189     if (is_linux || is_mac || is_win) {
190       sources += [
191         "media/capture/desktop_capture_device.cc",
192         "media/capture/desktop_capture_device.h",
193         "media/capture/desktop_capture_device_uma_types.cc",
194         "media/capture/desktop_capture_device_uma_types.h",
195       ]
196       if (use_aura) {
197         sources += [
198           "media/capture/aura_window_capture_machine.cc",
199           "media/capture/aura_window_capture_machine.h",
200           "media/capture/desktop_capture_device_aura.cc",
201           "media/capture/desktop_capture_device_aura.h",
202         ]
203       }
204       defines += [ "ENABLE_SCREEN_CAPTURE=1" ]
205       deps += [ "//third_party/webrtc/modules/desktop_capture" ]
206     }
207   }
209   if (is_win) {
210     sources -= [
211       "device_sensors/data_fetcher_shared_memory_default.cc",
212       "geolocation/empty_wifi_data_provider.cc",
213     ]
214     defines += [
215       # This prevents the inclusion of atlhost.h which paired
216       # with the windows 8 sdk it does the wrong thing.
217       "__ATLHOST_H__",
218     ]
219     deps += [
220       "//third_party/iaccessible2",
221       "//third_party/isimpledom",
222     ]
223     libs += [
224       "comctl32.lib",
225       "dinput8.lib",
226       "dwmapi.lib",
227       "dxguid.lib",
228       "oleacc.lib",
229       "sensorsapi.lib",
230       "portabledeviceguids.lib",
231     ]
233     # TODI(GYP)
234     #       'msvs_settings': {
235     #         'VCLinkerTool': {
236     #           'DelayLoadDLLs': [
237     #             'dinput8.dll',
238     #             'user32.dll',
239     #             'dwmapi.dll',
240     #           ],
241   }
243   if (is_linux) {
244     deps += [ "//sandbox/linux:libc_urandom_override" ]
245   }
247   if (use_udev) {
248     deps += [ "//device/udev_linux" ]
249   } else {
250     # Remove udev-specific sources.
251     sources -= [
252       "device_monitor_udev.cc",
253       "device_monitor_udev.h",
254     ]
255     if (is_linux) {
256       # Already filtered out on non-Linux.
257       sources -= [
258         "gamepad/gamepad_platform_data_fetcher_linux.cc",
259         "udev_linux.cc",
260         "udev_linux.h",
261       ]
262     }
263   }
265   if (enable_plugins) {
266     sources += rebase_path(content_browser_gypi_values.plugin_browser_sources,
267                            ".",
268                            "//content")
269     deps += [
270       "//ppapi/host",
271       "//ppapi/proxy:ipc",
272       "//ppapi/shared_impl",
273     ]
274     if (!use_ozone || use_pango) {
275       sources -= [ "renderer_host/pepper/pepper_truetype_font_list_ozone.cc" ]
276     }
277     if (!use_pango) {
278       sources -= [ "renderer_host/pepper/pepper_truetype_font_list_pango.cc" ]
279     }
280   }
282   if (is_linux && use_aura) {
283     configs += [ "//build/config/linux:fontconfig" ]
284   }
286   if (use_x11) {
287     configs += [ "//build/config/linux:x11" ]
288     deps += [ "//ui/gfx/x" ]
289   }
291   # Dealing with power_save_blocker_{x11,ozone}.cc is a little complicated
292   # given the interaction between os_chromeos and the feature flags for X11 and
293   # ozone, so do it all in one spot.
294   if (is_chromeos || !use_ozone) {
295     sources -= [ "power_save_blocker_ozone.cc" ]
296   }
297   if (is_chromeos || !use_x11) {
298     sources -= [ "power_save_blocker_x11.cc" ]
299   }
301   # Dealing with *wifi_data_provider_*.cc is also a bit complicated given
302   # android, chromeos, linux and use_dbus.
303   if (is_android) {
304     sources -= [ "geolocation/wifi_data_provider_common.cc" ]
305   }
306   if (is_chromeos || (is_linux && !use_dbus)) {
307     sources -= [ "geolocation/wifi_data_provider_linux.cc" ]
308   }
309   if (is_linux && use_dbus) {
310     sources -= [ "geolocation/empty_wifi_data_provider.cc" ]
311   }
313   if (use_pango) {
314     configs += [ "//build/config/linux:pangocairo" ]
315   }
317   if (is_android) {
318     sources += rebase_path(content_browser_gypi_values.android_browser_sources,
319                            ".",
320                            "//content")
321     sources -= [
322       "browser_ipc_logging.cc",
323       "device_sensors/data_fetcher_shared_memory_default.cc",
324       "geolocation/network_location_provider.cc",
325       "geolocation/network_location_provider.h",
326       "geolocation/network_location_request.cc",
327       "geolocation/network_location_request.h",
328       "renderer_host/begin_frame_observer_proxy.cc",
329       "tracing/tracing_ui.cc",
330       "tracing/tracing_ui.h",
332       # Android skips most, but not all, of the speech code.
333       "speech/audio_buffer.cc",
334       "speech/audio_buffer.h",
335       "speech/audio_encoder.cc",
336       "speech/audio_encoder.h",
337       "speech/chunked_byte_buffer.cc",
338       "speech/chunked_byte_buffer.h",
339       "speech/endpointer/endpointer.cc",
340       "speech/endpointer/endpointer.h",
341       "speech/endpointer/energy_endpointer.cc",
342       "speech/endpointer/energy_endpointer.h",
343       "speech/endpointer/energy_endpointer_params.cc",
344       "speech/endpointer/energy_endpointer_params.h",
345       "speech/google_one_shot_remote_engine.cc",
346       "speech/google_one_shot_remote_engine.h",
347       "speech/google_streaming_remote_engine.cc",
348       "speech/google_streaming_remote_engine.h",
349       "speech/speech_recognition_engine.cc",
350       "speech/speech_recognition_engine.h",
351       "speech/speech_recognizer_impl.cc",
352       "speech/speech_recognizer_impl.h",
353     ]
354     deps += [
355       "//content/public/android:jni",
356       "//media",
357       "//mojo/android:libsystem_java",
358       "//ui/android",
359     ]
360     libs += [ "jnigraphics" ]
361   }
363   if (is_mac) {
364     sources -= [
365       "device_sensors/data_fetcher_shared_memory_default.cc",
366       "geolocation/empty_wifi_data_provider.cc",
367       "geolocation/empty_wifi_data_provider.h",
368     ]
369     deps += [
370       "//sandbox/mac:sandbox",
371       "//third_party/mozilla",
372       "//third_party/sudden_motion_sensor",
373       "//ui/accelerated_widget_mac",
374     ]
375     libs += [
376       "bsm",
377       "QTKit.framework",
378     ]
379   }
381   if (is_chromeos) {
382     sources -= [ "device_sensors/data_fetcher_shared_memory_default.cc" ]
383     deps += [
384       "//chromeos",
385       "//chromeos:power_manager_proto",
386     ]
387   }
389   if (use_aura) {
390     deps += [
391       "//ui/aura",
392       "//ui/aura_extra",
393       "//ui/strings",
394       "//ui/wm",
395     ]
396   } else {  # Not aura.
397     sources -= [
398       "renderer_host/compositor_resize_lock_aura.cc",
399       "renderer_host/compositor_resize_lock_aura.h",
400       "renderer_host/input/synthetic_gesture_target_aura.cc",
401       "renderer_host/input/synthetic_gesture_target_aura.h",
402       "renderer_host/native_web_keyboard_event_aura.cc",
403       "renderer_host/render_widget_host_view_aura.cc",
404       "renderer_host/render_widget_host_view_aura.h",
405       "renderer_host/ui_events_helper.cc",
406       "renderer_host/ui_events_helper.h",
407       "renderer_host/web_input_event_aura.cc",
408       "renderer_host/web_input_event_aura.h",
409       "web_contents/aura/gesture_nav_simple.cc",
410       "web_contents/aura/gesture_nav_simple.h",
411       "web_contents/aura/overscroll_navigation_overlay.cc",
412       "web_contents/aura/overscroll_navigation_overlay.h",
413       "web_contents/aura/overscroll_window_animation.cc",
414       "web_contents/aura/overscroll_window_animation.h",
415       "web_contents/aura/overscroll_window_delegate.cc",
416       "web_contents/aura/overscroll_window_delegate.h",
417       "web_contents/aura/shadow_layer_delegate.cc",
418       "web_contents/aura/shadow_layer_delegate.h",
419       "web_contents/touch_editable_impl_aura.cc",
420       "web_contents/touch_editable_impl_aura.h",
421       "web_contents/web_contents_view_aura.cc",
422       "web_contents/web_contents_view_aura.h",
423     ]
424   }
426   if (use_aura || is_mac) {
427     sources +=
428         rebase_path(content_browser_gypi_values.compositor_browser_sources,
429                     ".",
430                     "//content")
431     if (!use_x11) {
432       sources -= [
433         "compositor/software_output_device_x11.cc",
434         "compositor/software_output_device_x11.h",
435       ]
436     }
438     if (!use_ozone) {
439       sources -= [
440         "compositor/browser_compositor_overlay_candidate_validator_ozone.cc",
441         "compositor/browser_compositor_overlay_candidate_validator_ozone.h",
442         "compositor/software_output_device_ozone.cc",
443         "compositor/software_output_device_ozone.h",
444       ]
445     }
446     deps += [ "//ui/compositor" ]
447   }
449   if (!is_ios) {
450     sources += [
451       "compositor/surface_utils.cc",
452       "compositor/surface_utils.h",
453     ]
454   }
456   if (enable_web_speech) {
457     deps += [
458       "//third_party/flac",
459       "//third_party/speex",
460     ]
461   }
463   if (is_linux && use_dbus) {
464     deps += [ "//dbus" ]
465   }
467   if (enable_browser_cdms) {
468     sources += [
469       "media/cdm/browser_cdm_manager.cc",
470       "media/cdm/browser_cdm_manager.h",
471       "media/media_web_contents_observer.cc",
472       "media/media_web_contents_observer.h",
473     ]
474   }
476   if (is_linux && use_openssl) {
477     deps += [ "//third_party/boringssl" ]
478   }
480   if (enable_mojo_media == "browser") {
481     deps += [ "//media/mojo/services:application" ]
482   }
484   if (enable_webvr) {
485     sources += [
486       "vr/vr_device.cc",
487       "vr/vr_device.h",
488       "vr/vr_device_manager.cc",
489       "vr/vr_device_manager.h",
490       "vr/vr_device_provider.h",
491     ]
492   }