Revert of Split ui/base/ime into a new component (patchset #4 id:60001 of https:...
[chromium-blink-merge.git] / content / browser / BUILD.gn
blob8bebd15d2b4b8fb5c119ba6857652b2a21e3f6de
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     "//content:resources",
25     "//content/browser/service_worker:service_worker_proto",
26     "//content/browser/speech/proto",
27     "//content/public/common:common_sources",
28     "//crypto",
29     "//device/battery",
30     "//device/vibration",
31     "//google_apis",
32     "//net",
33     "//skia",
34     "//sql",
35     "//third_party/npapi",
36     "//third_party/re2",
37     "//third_party/WebKit/public:blink_headers",
38     "//third_party/zlib",
39     "//third_party/zlib:zip",
40     "//ui/accessibility",
41     "//ui/accessibility:ax_gen",
42     "//ui/base",
43     "//ui/events",
44     "//ui/events:gesture_detection",
45     "//ui/gfx",
46     "//ui/gfx/geometry",
47     "//ui/gl",
48     "//ui/native_theme",
49     "//ui/resources",
50     "//ui/snapshot",
51   ]
53   if (is_ios) {
54     # iOS doesn't get the normal file list and only takes these whitelisted
55     # files.
56     sources = [
57       "browser_context.cc",
58       "browser_main_loop.cc",
59       "browser_main_runner.cc",
60       "browser_process_sub_thread.cc",
61       "browser_thread_impl.cc",
62       "browser_url_handler_impl.cc",
63       "cert_store_impl.cc",
64       "download/download_create_info.cc",
65       "notification_service_impl.cc",
66       "signed_certificate_timestamp_store_impl.cc",
67       "user_metrics.cc",
68       "web_contents/navigation_entry_impl.cc",
69     ]
70   } else {
71     # Normal non-iOS sources get everything.
72     sources = rebase_path(content_browser_gypi_values.private_browser_sources,
73                           ".",
74                           "//content")
76     # TODO(GYP) these generated files are listed as sources in content_browser.
77     # This is a bit suspicious. The GN grit template will make a source set
78     # containing the generated code so it should be sufficient to just depend
79     # on the grit rule. But maybe some of these will need to be added?
80     #
81     # Need this annoying rebase_path call to match what happened with the
82     # sources.
83     sources -= rebase_path(
84             [
85               "$root_gen_dir/blink/grit/devtools_resources.h",
86               "$root_gen_dir/blink/grit/devtools_resources_map.cc",
87               "$root_gen_dir/blink/grit/devtools_resources_map.h",
88               "$root_gen_dir/content/browser/tracing/grit/tracing_resources.h",
89               "$root_gen_dir/ui/resources/grit/webui_resources_map.cc",
90               "$root_gen_dir/content/browser/devtools/protocol/devtools_protocol_dispatcher.cc",
91               "$root_gen_dir/content/browser/devtools/protocol/devtools_protocol_dispatcher.h",
92             ],
93             ".")
95     # Non-iOS deps.
96     deps += [
97       "//cc",
98       "//cc/surfaces",
99       "//content/app/resources",
100       "//content/app/strings",
101       "//content/browser/devtools:resources",
102       "//content/common:mojo_bindings",
103       "//content/public/common:mojo_bindings",
104       "//device/bluetooth",
105       "//net:http_server",
106       "//storage/browser",
107       "//storage/common",
108       "//third_party/WebKit/public:resources",
109       "//third_party/angle:commit_id",
110       "//third_party/icu",
111       "//third_party/leveldatabase",
112       "//third_party/libyuv",
113       "//third_party/mojo/src/mojo/public/cpp/bindings",
114       "//third_party/mojo/src/mojo/public/interfaces/application",
115       "//third_party/mojo/src/mojo/public/js",
116       "//ui/resources",
117       "//ui/surface",
118       "//ui/touch_selection",
119     ]
120   }
122   configs += [ "//content:content_implementation" ]
124   if (toolkit_views) {
125     deps += [ "//ui/events" ]
126   }
128   if (is_win) {
129     sources += [
130       "power_profiler/power_data_provider_ia_win.cc",
131       "power_profiler/power_data_provider_ia_win.h",
132     ]
133     deps += [ "//third_party/power_gadget" ]
134   } else {
135     sources += [
136       "power_profiler/power_data_provider_dummy.cc",
137       "file_descriptor_info_impl.cc",
138       "file_descriptor_info_impl.h",
139     ]
140     sources -= [ "renderer_host/web_input_event_aurawin.cc" ]
141   }
143   if (!is_win && !is_mac && !is_android && (!is_linux || !use_udev)) {
144     sources += [ "gamepad/gamepad_platform_data_fetcher.cc" ]
145   }
147   if (enable_basic_printing || enable_print_preview) {
148     deps += [ "//printing" ]
149   }
151   # TODO(GYP)
152   #   ['OS!="ios" and chrome_multiple_dll!=1', {
153   #     'dependencies': [
154   #       '../third_party/WebKit/public/blink.gyp:blink',
155   #     ],
156   #   }],
157   if (!is_mac && !is_ios) {
158     deps += [ "//sandbox" ]
159   }
160   if (!is_android && !is_ios) {
161     deps += [ "//content/browser/tracing:resources" ]
162   }
164   if (enable_webrtc) {
165     sources += rebase_path(content_browser_gypi_values.webrtc_browser_sources,
166                            ".",
167                            "//content")
168     deps += [ "//jingle:jingle_glue" ]
169     if (is_linux) {
170       deps += [ "//third_party/libjingle:libjingle_webrtc" ]
171     }
172     if (is_linux || is_mac || is_win) {
173       sources += [
174         "media/capture/desktop_capture_device.cc",
175         "media/capture/desktop_capture_device.h",
176         "media/capture/desktop_capture_device_uma_types.cc",
177         "media/capture/desktop_capture_device_uma_types.h",
178       ]
179       if (use_aura) {
180         sources += [
181           "media/capture/desktop_capture_device_aura.cc",
182           "media/capture/desktop_capture_device_aura.h",
183         ]
184       }
185       defines += [ "ENABLE_SCREEN_CAPTURE=1" ]
186       deps += [ "//third_party/webrtc/modules/desktop_capture" ]
187     }
188   }
190   if (is_win) {
191     sources -= [
192       "device_sensors/data_fetcher_shared_memory_default.cc",
193       "geolocation/empty_wifi_data_provider.cc",
194     ]
195     defines += [
196       # This prevents the inclusion of atlhost.h which paired
197       # with the windows 8 sdk it does the wrong thing.
198       "__ATLHOST_H__",
199     ]
200     deps += [
201       "//third_party/iaccessible2",
202       "//third_party/isimpledom",
203     ]
204     libs += [
205       "comctl32.lib",
206       "dinput8.lib",
207       "dwmapi.lib",
208       "dxguid.lib",
209       "sensorsapi.lib",
210       "portabledeviceguids.lib",
211     ]
213     # TODI(GYP)
214     #       'msvs_settings': {
215     #         'VCLinkerTool': {
216     #           'DelayLoadDLLs': [
217     #             'dinput8.dll',
218     #             'user32.dll',
219     #             'dwmapi.dll',
220     #           ],
221   }
223   if (is_linux) {
224     deps += [ "//sandbox/linux:libc_urandom_override" ]
225   }
227   if (use_udev) {
228     deps += [ "//device/udev_linux" ]
229   } else {
230     # Remove udev-specific sources.
231     sources -= [
232       "device_monitor_udev.cc",
233       "device_monitor_udev.h",
234     ]
235     if (is_linux) {
236       # Already filtered out on non-Linux.
237       sources -= [
238         "gamepad/gamepad_platform_data_fetcher_linux.cc",
239         "udev_linux.cc",
240         "udev_linux.h",
241       ]
242     }
243   }
245   if (enable_plugins) {
246     sources += rebase_path(content_browser_gypi_values.plugin_browser_sources,
247                            ".",
248                            "//content")
249     deps += [
250       "//ppapi:ppapi_ipc",
251       "//ppapi:ppapi_shared",
252     ]
253     if (!use_ozone || use_pango) {
254       sources -= [ "renderer_host/pepper/pepper_truetype_font_list_ozone.cc" ]
255     }
256     if (!use_pango) {
257       sources -= [ "renderer_host/pepper/pepper_truetype_font_list_pango.cc" ]
258     }
259   }
261   if (is_linux && use_aura) {
262     configs += [ "//build/config/linux:fontconfig" ]
263   }
265   if (use_x11) {
266     configs += [ "//build/config/linux:x11" ]
267     deps += [ "//ui/gfx/x" ]
268   }
270   # Dealing with power_save_blocker_{x11,ozone}.cc is a little complicated
271   # given the interaction between os_chromeos and the feature flags for X11 and
272   # ozone, so do it all in one spot.
273   if (is_chromeos || !use_ozone) {
274     sources -= [ "power_save_blocker_ozone.cc" ]
275   }
276   if (is_chromeos || !use_x11) {
277     sources -= [ "power_save_blocker_x11.cc" ]
278   }
280   # Dealing with *wifi_data_provider_*.cc is also a bit complicated given
281   # android, chromeos, linux and use_dbus.
282   if (is_android) {
283     sources -= [ "geolocation/wifi_data_provider_common.cc" ]
284   }
285   if (is_chromeos || (is_linux && !use_dbus)) {
286     sources -= [ "geolocation/wifi_data_provider_linux.cc" ]
287   }
288   if (is_linux && use_dbus) {
289     sources -= [ "geolocation/empty_wifi_data_provider.cc" ]
290   }
292   if (use_pango) {
293     configs += [ "//build/config/linux:pangocairo" ]
294   }
296   if (is_android) {
297     sources += rebase_path(content_browser_gypi_values.android_browser_sources,
298                            ".",
299                            "//content")
300     sources -= [
301       "browser_ipc_logging.cc",
302       "device_sensors/data_fetcher_shared_memory_default.cc",
303       "font_list_async.cc",
304       "geolocation/network_location_provider.cc",
305       "geolocation/network_location_provider.h",
306       "geolocation/network_location_request.cc",
307       "geolocation/network_location_request.h",
308       "tracing/tracing_ui.cc",
309       "tracing/tracing_ui.h",
311       # Android skips most, but not all, of the speech code.
312       "speech/audio_buffer.cc",
313       "speech/audio_buffer.h",
314       "speech/audio_encoder.cc",
315       "speech/audio_encoder.h",
316       "speech/chunked_byte_buffer.cc",
317       "speech/chunked_byte_buffer.h",
318       "speech/endpointer/endpointer.cc",
319       "speech/endpointer/endpointer.h",
320       "speech/endpointer/energy_endpointer.cc",
321       "speech/endpointer/energy_endpointer.h",
322       "speech/endpointer/energy_endpointer_params.cc",
323       "speech/endpointer/energy_endpointer_params.h",
324       "speech/google_one_shot_remote_engine.cc",
325       "speech/google_one_shot_remote_engine.h",
326       "speech/google_streaming_remote_engine.cc",
327       "speech/google_streaming_remote_engine.h",
328       "speech/speech_recognition_engine.cc",
329       "speech/speech_recognition_engine.h",
330       "speech/speech_recognizer_impl.cc",
331       "speech/speech_recognizer_impl.h",
332     ]
333     deps += [
334       "//content/public/android:jni",
335       "//media",
336       "//mojo/android:libsystem_java",
337       "//ui/android",
338     ]
339     libs += [ "jnigraphics" ]
340   }
342   if (is_mac) {
343     sources -= [
344       "device_sensors/data_fetcher_shared_memory_default.cc",
345       "geolocation/empty_wifi_data_provider.cc",
346       "geolocation/empty_wifi_data_provider.h",
347     ]
348     deps += [ "//ui/accelerated_widget_mac" ]
349     libs += [ "bsm" ]
350   }
352   if (is_chromeos) {
353     sources -= [ "device_sensors/data_fetcher_shared_memory_default.cc" ]
354     deps += [
355       "//chromeos",
356       "//chromeos:power_manager_proto",
357     ]
358   }
360   if (use_aura) {
361     deps += [
362       "//ui/aura",
363       "//ui/strings",
364       "//ui/wm",
365     ]
366   } else {  # Not aura.
367     sources -= [
368       "renderer_host/input/synthetic_gesture_target_aura.cc",
369       "renderer_host/input/synthetic_gesture_target_aura.h",
370       "renderer_host/native_web_keyboard_event_aura.cc",
371       "renderer_host/render_widget_host_view_aura.cc",
372       "renderer_host/render_widget_host_view_aura.h",
373       "renderer_host/ui_events_helper.cc",
374       "renderer_host/ui_events_helper.h",
375       "renderer_host/web_input_event_aura.cc",
376       "renderer_host/web_input_event_aura.h",
377       "web_contents/aura/gesture_nav_simple.cc",
378       "web_contents/aura/gesture_nav_simple.h",
379       "web_contents/aura/image_window_delegate.cc",
380       "web_contents/aura/image_window_delegate.h",
381       "web_contents/aura/overscroll_navigation_overlay.cc",
382       "web_contents/aura/overscroll_navigation_overlay.h",
383       "web_contents/aura/shadow_layer_delegate.cc",
384       "web_contents/aura/shadow_layer_delegate.h",
385       "web_contents/aura/window_slider.cc",
386       "web_contents/aura/window_slider.h",
387       "web_contents/touch_editable_impl_aura.cc",
388       "web_contents/touch_editable_impl_aura.h",
389       "web_contents/web_contents_view_aura.cc",
390       "web_contents/web_contents_view_aura.h",
391     ]
392   }
394   if (use_aura || is_mac) {
395     sources +=
396         rebase_path(content_browser_gypi_values.compositor_browser_sources,
397                     ".",
398                     "//content")
399     if (!use_x11) {
400       sources -= [
401         "compositor/software_output_device_x11.cc",
402         "compositor/software_output_device_x11.h",
403       ]
404     }
406     if (!use_ozone) {
407       sources -= [
408         "compositor/overlay_candidate_validator_ozone.cc",
409         "compositor/overlay_candidate_validator_ozone.h",
410         "compositor/software_output_device_ozone.cc",
411         "compositor/software_output_device_ozone.h",
412       ]
413     }
414     deps += [ "//ui/compositor" ]
415   }
417   if (enable_web_speech) {
418     deps += [
419       "//third_party/flac",
420       "//third_party/speex",
421     ]
422   }
424   if (is_linux && use_dbus) {
425     deps += [ "//dbus" ]
426   }
428   if (enable_browser_cdms) {
429     sources += [
430       "media/cdm/browser_cdm_manager.cc",
431       "media/cdm/browser_cdm_manager.h",
432       "media/media_web_contents_observer.cc",
433       "media/media_web_contents_observer.h",
434     ]
435   }
437   if (is_linux && use_openssl) {
438     deps += [ "//third_party/boringssl" ]
439   }
441   if (enable_media_mojo_renderer) {
442     deps += [ "//media/mojo/services:renderer_service" ]
443   }