chrome/browser/extensions: Remove use of MessageLoopProxy and deprecated MessageLoop...
[chromium-blink-merge.git] / content / browser / BUILD.gn
blob3cdfc88ee04608650ba9de1f6d453d3eddbc49f7
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       "//mojo/application/public/interfaces",
118       "//storage/browser",
119       "//storage/common",
120       "//third_party/WebKit/public:image_resources",
121       "//third_party/WebKit/public:resources",
122       "//third_party/angle:commit_id",
123       "//third_party/icu",
124       "//third_party/leveldatabase",
125       "//third_party/libyuv",
126       "//third_party/mojo/src/mojo/public/cpp/bindings",
127       "//third_party/mojo/src/mojo/public/js",
128       "//ui/events/blink",
129       "//ui/resources",
130       "//ui/surface",
131       "//ui/touch_selection",
132     ]
133   }
135   configs += [
136     "//content:content_implementation",
137     "//third_party/WebKit/public:debug_devtools",
138   ]
140   if (toolkit_views) {
141     deps += [ "//ui/events" ]
142   }
144   if (is_win) {
145     sources += [
146       "power_profiler/power_data_provider_ia_win.cc",
147       "power_profiler/power_data_provider_ia_win.h",
148     ]
149     deps += [ "//third_party/power_gadget" ]
150   } else {
151     sources += [
152       "file_descriptor_info_impl.cc",
153       "file_descriptor_info_impl.h",
154       "power_profiler/power_data_provider_dummy.cc",
155     ]
156     sources -= [ "renderer_host/web_input_event_aurawin.cc" ]
157   }
159   if (!is_win && !is_mac && !is_android && (!is_linux || !use_udev)) {
160     sources += [ "gamepad/gamepad_platform_data_fetcher.cc" ]
161   }
163   if (enable_basic_printing || enable_print_preview) {
164     deps += [ "//printing" ]
165   }
167   # TODO(GYP)
168   #   ['OS!="ios" and chrome_multiple_dll!=1', {
169   #     'dependencies': [
170   #       '../third_party/WebKit/public/blink.gyp:blink',
171   #     ],
172   #   }],
173   if (!is_mac && !is_ios) {
174     deps += [ "//sandbox" ]
175   }
176   if (!is_android && !is_ios) {
177     deps += [ "//content/browser/tracing:resources" ]
178   }
180   if (enable_webrtc) {
181     sources += rebase_path(content_browser_gypi_values.webrtc_browser_sources,
182                            ".",
183                            "//content")
184     deps += [ "//jingle:jingle_glue" ]
185     if (is_linux) {
186       deps += [ "//third_party/libjingle:libjingle_webrtc" ]
187     }
188     if (is_linux || is_mac || is_win) {
189       sources += [
190         "media/capture/desktop_capture_device.cc",
191         "media/capture/desktop_capture_device.h",
192         "media/capture/desktop_capture_device_uma_types.cc",
193         "media/capture/desktop_capture_device_uma_types.h",
194       ]
195       if (use_aura) {
196         sources += [
197           "media/capture/aura_window_capture_machine.cc",
198           "media/capture/aura_window_capture_machine.h",
199           "media/capture/desktop_capture_device_aura.cc",
200           "media/capture/desktop_capture_device_aura.h",
201         ]
202       }
203       defines += [ "ENABLE_SCREEN_CAPTURE=1" ]
204       deps += [ "//third_party/webrtc/modules/desktop_capture" ]
205     }
206   }
208   if (is_win) {
209     sources -= [
210       "device_sensors/data_fetcher_shared_memory_default.cc",
211       "geolocation/empty_wifi_data_provider.cc",
212     ]
213     defines += [
214       # This prevents the inclusion of atlhost.h which paired
215       # with the windows 8 sdk it does the wrong thing.
216       "__ATLHOST_H__",
217     ]
218     deps += [
219       "//third_party/iaccessible2",
220       "//third_party/isimpledom",
221     ]
222     libs += [
223       "comctl32.lib",
224       "dinput8.lib",
225       "dwmapi.lib",
226       "dxguid.lib",
227       "oleacc.lib",
228       "sensorsapi.lib",
229       "portabledeviceguids.lib",
230     ]
232     # TODI(GYP)
233     #       'msvs_settings': {
234     #         'VCLinkerTool': {
235     #           'DelayLoadDLLs': [
236     #             'dinput8.dll',
237     #             'user32.dll',
238     #             'dwmapi.dll',
239     #           ],
240   }
242   if (is_linux) {
243     deps += [ "//sandbox/linux:libc_urandom_override" ]
244   }
246   if (use_udev) {
247     deps += [ "//device/udev_linux" ]
248   } else {
249     # Remove udev-specific sources.
250     sources -= [
251       "device_monitor_udev.cc",
252       "device_monitor_udev.h",
253     ]
254     if (is_linux) {
255       # Already filtered out on non-Linux.
256       sources -= [
257         "gamepad/gamepad_platform_data_fetcher_linux.cc",
258         "udev_linux.cc",
259         "udev_linux.h",
260       ]
261     }
262   }
264   if (enable_plugins) {
265     sources += rebase_path(content_browser_gypi_values.plugin_browser_sources,
266                            ".",
267                            "//content")
268     deps += [
269       "//ppapi/host",
270       "//ppapi/proxy:ipc",
271       "//ppapi/shared_impl",
272     ]
273     if (!use_ozone || use_pango) {
274       sources -= [ "renderer_host/pepper/pepper_truetype_font_list_ozone.cc" ]
275     }
276     if (!use_pango) {
277       sources -= [ "renderer_host/pepper/pepper_truetype_font_list_pango.cc" ]
278     }
279   }
281   if (is_linux && use_aura) {
282     configs += [ "//build/config/linux:fontconfig" ]
283   }
285   if (use_x11) {
286     configs += [ "//build/config/linux:x11" ]
287     deps += [ "//ui/gfx/x" ]
288   }
290   # Dealing with power_save_blocker_{x11,ozone}.cc is a little complicated
291   # given the interaction between os_chromeos and the feature flags for X11 and
292   # ozone, so do it all in one spot.
293   if (is_chromeos || !use_ozone) {
294     sources -= [ "power_save_blocker_ozone.cc" ]
295   }
296   if (is_chromeos || !use_x11) {
297     sources -= [ "power_save_blocker_x11.cc" ]
298   }
300   # Dealing with *wifi_data_provider_*.cc is also a bit complicated given
301   # android, chromeos, linux and use_dbus.
302   if (is_android) {
303     sources -= [ "geolocation/wifi_data_provider_common.cc" ]
304   }
305   if (is_chromeos || (is_linux && !use_dbus)) {
306     sources -= [ "geolocation/wifi_data_provider_linux.cc" ]
307   }
308   if (is_linux && use_dbus) {
309     sources -= [ "geolocation/empty_wifi_data_provider.cc" ]
310   }
312   if (use_pango) {
313     configs += [ "//build/config/linux:pangocairo" ]
314   }
316   if (is_android) {
317     sources += rebase_path(content_browser_gypi_values.android_browser_sources,
318                            ".",
319                            "//content")
320     sources -= [
321       "browser_ipc_logging.cc",
322       "device_sensors/data_fetcher_shared_memory_default.cc",
323       "geolocation/network_location_provider.cc",
324       "geolocation/network_location_provider.h",
325       "geolocation/network_location_request.cc",
326       "geolocation/network_location_request.h",
327       "renderer_host/begin_frame_observer_proxy.cc",
328       "tracing/tracing_ui.cc",
329       "tracing/tracing_ui.h",
331       # Android skips most, but not all, of the speech code.
332       "speech/audio_buffer.cc",
333       "speech/audio_buffer.h",
334       "speech/audio_encoder.cc",
335       "speech/audio_encoder.h",
336       "speech/chunked_byte_buffer.cc",
337       "speech/chunked_byte_buffer.h",
338       "speech/endpointer/endpointer.cc",
339       "speech/endpointer/endpointer.h",
340       "speech/endpointer/energy_endpointer.cc",
341       "speech/endpointer/energy_endpointer.h",
342       "speech/endpointer/energy_endpointer_params.cc",
343       "speech/endpointer/energy_endpointer_params.h",
344       "speech/google_one_shot_remote_engine.cc",
345       "speech/google_one_shot_remote_engine.h",
346       "speech/google_streaming_remote_engine.cc",
347       "speech/google_streaming_remote_engine.h",
348       "speech/speech_recognition_engine.cc",
349       "speech/speech_recognition_engine.h",
350       "speech/speech_recognizer_impl.cc",
351       "speech/speech_recognizer_impl.h",
352     ]
353     deps += [
354       "//content/public/android:jni",
355       "//media",
356       "//mojo/android:libsystem_java",
357       "//ui/android",
358     ]
359     libs += [ "jnigraphics" ]
360   }
362   if (is_mac) {
363     sources -= [
364       "device_sensors/data_fetcher_shared_memory_default.cc",
365       "geolocation/empty_wifi_data_provider.cc",
366       "geolocation/empty_wifi_data_provider.h",
367     ]
368     deps += [
369       "//sandbox/mac:sandbox",
370       "//third_party/mozilla",
371       "//third_party/sudden_motion_sensor",
372       "//ui/accelerated_widget_mac",
373     ]
374     libs += [
375       "bsm",
376       "QTKit.framework",
377     ]
378   }
380   if (is_chromeos) {
381     sources -= [ "device_sensors/data_fetcher_shared_memory_default.cc" ]
382     deps += [
383       "//chromeos",
384       "//chromeos:power_manager_proto",
385     ]
386   }
388   if (use_aura) {
389     deps += [
390       "//ui/aura",
391       "//ui/aura_extra",
392       "//ui/strings",
393       "//ui/wm",
394     ]
395   } else {  # Not aura.
396     sources -= [
397       "renderer_host/compositor_resize_lock_aura.cc",
398       "renderer_host/compositor_resize_lock_aura.h",
399       "renderer_host/input/synthetic_gesture_target_aura.cc",
400       "renderer_host/input/synthetic_gesture_target_aura.h",
401       "renderer_host/native_web_keyboard_event_aura.cc",
402       "renderer_host/render_widget_host_view_aura.cc",
403       "renderer_host/render_widget_host_view_aura.h",
404       "renderer_host/ui_events_helper.cc",
405       "renderer_host/ui_events_helper.h",
406       "renderer_host/web_input_event_aura.cc",
407       "renderer_host/web_input_event_aura.h",
408       "web_contents/aura/gesture_nav_simple.cc",
409       "web_contents/aura/gesture_nav_simple.h",
410       "web_contents/aura/overscroll_navigation_overlay.cc",
411       "web_contents/aura/overscroll_navigation_overlay.h",
412       "web_contents/aura/overscroll_window_animation.cc",
413       "web_contents/aura/overscroll_window_animation.h",
414       "web_contents/aura/overscroll_window_delegate.cc",
415       "web_contents/aura/overscroll_window_delegate.h",
416       "web_contents/aura/shadow_layer_delegate.cc",
417       "web_contents/aura/shadow_layer_delegate.h",
418       "web_contents/touch_editable_impl_aura.cc",
419       "web_contents/touch_editable_impl_aura.h",
420       "web_contents/web_contents_view_aura.cc",
421       "web_contents/web_contents_view_aura.h",
422     ]
423   }
425   if (use_aura || is_mac) {
426     sources +=
427         rebase_path(content_browser_gypi_values.compositor_browser_sources,
428                     ".",
429                     "//content")
430     if (!use_x11) {
431       sources -= [
432         "compositor/software_output_device_x11.cc",
433         "compositor/software_output_device_x11.h",
434       ]
435     }
437     if (!use_ozone) {
438       sources -= [
439         "compositor/browser_compositor_overlay_candidate_validator_ozone.cc",
440         "compositor/browser_compositor_overlay_candidate_validator_ozone.h",
441         "compositor/software_output_device_ozone.cc",
442         "compositor/software_output_device_ozone.h",
443       ]
444     }
445     deps += [ "//ui/compositor" ]
446   }
448   if (!is_ios) {
449     sources += [
450       "compositor/surface_utils.cc",
451       "compositor/surface_utils.h",
452     ]
453   }
455   if (enable_web_speech) {
456     deps += [
457       "//third_party/flac",
458       "//third_party/speex",
459     ]
460   }
462   if (is_linux && use_dbus) {
463     deps += [ "//dbus" ]
464   }
466   if (enable_browser_cdms) {
467     sources += [
468       "media/cdm/browser_cdm_manager.cc",
469       "media/cdm/browser_cdm_manager.h",
470       "media/media_web_contents_observer.cc",
471       "media/media_web_contents_observer.h",
472     ]
473   }
475   if (is_linux && use_openssl) {
476     deps += [ "//third_party/boringssl" ]
477   }
479   if (enable_media_mojo_renderer) {
480     deps += [ "//media/mojo/services:renderer_service" ]
481   }