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