Revert "Added incident report for variations seed signature mismatch."
[chromium-blink-merge.git] / content / browser / BUILD.gn
blobcab6cb955c95f4dbf8122a70aaeb2751aa75650d
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" ]
15   defines = []
16   libs = []
17   ldflags = []
19   # Shared deps. See also non-iOS deps below.
20   deps = [
21     "//base",
22     "//base:base_static",
23     "//content:resources",
24     "//content/browser/service_worker:proto",
25     "//content/browser/speech/proto",
26     "//content/public/common:common_sources",
27     "//crypto",
28     "//google_apis",
29     "//net",
30     "//skia",
31     "//sql",
32     "//third_party/npapi",
33     "//third_party/re2",
34     "//third_party/WebKit/public:blink_headers",
35     "//third_party/zlib",
36     "//third_party/zlib:zip",
37     "//ui/accessibility",
38     "//ui/accessibility:ax_gen",
39     "//ui/base",
40     "//ui/events",
41     "//ui/events:gesture_detection",
42     "//ui/gfx",
43     "//ui/gfx/geometry",
44     "//ui/gl",
45     "//ui/native_theme",
46     "//ui/resources",
47     "//ui/snapshot",
48   ]
50   if (is_ios) {
51     # iOS doesn't get the normal file list and only takes these whitelisted
52     # files.
53     sources = [
54       "browser_context.cc",
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",
60       "cert_store_impl.cc",
61       "download/download_create_info.cc",
62       "notification_service_impl.cc",
63       "signed_certificate_timestamp_store_impl.cc",
64       "user_metrics.cc",
65       "web_contents/navigation_entry_impl.cc",
66     ]
67   } else {
68     # Normal non-iOS sources get everything.
69     sources = rebase_path(content_browser_gypi_values.private_browser_sources,
70                           ".", "//content")
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?
76     #
77     # Need this annoying rebase_path call to match what happened with the
78     # sources.
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",
89     ], ".")
91     # Non-iOS deps.
92     deps += [
93       "//cc",
94       "//cc/surfaces",
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",
102       "//net:http_server",
103       "//storage/browser",
104       "//storage/common",
105       "//third_party/WebKit/public:resources",
106       "//third_party/angle:commit_id",
107       "//third_party/icu",
108       "//third_party/leveldatabase",
109       "//third_party/libyuv",
110       "//ui/resources",
111       "//ui/surface",
112     ]
113   }
115   configs += [
116     "//content:content_implementation",
117   ]
119   if (toolkit_views) {
120     deps += [ "//ui/events" ]
121   }
123   if (is_win) {
124     sources += [
125       "power_profiler/power_data_provider_ia_win.cc",
126       "power_profiler/power_data_provider_ia_win.h",
127     ]
128     deps += [ "//third_party/power_gadget" ]
129   } else {
130     sources += [
131       "power_profiler/power_data_provider_dummy.cc",
132       "file_descriptor_info_impl.cc",
133       "file_descriptor_info_impl.h",
134     ]
135     sources -= [ "renderer_host/web_input_event_aurawin.cc" ]
136   }
138   if (!is_win && !is_mac && !is_android && (!is_linux || !use_udev)) {
139     sources += [ "gamepad/gamepad_platform_data_fetcher.cc" ]
140   }
142   if (printing_mode != 0) {
143     deps += [ "//printing" ]
144   }
146 # TODO(GYP)
147 #   ['OS!="ios" and chrome_multiple_dll!=1', {
148 #     'dependencies': [
149 #       '../third_party/WebKit/public/blink.gyp:blink',
150 #     ],
151 #   }],
152   if (!is_mac && !is_ios) {
153     deps += [ "//sandbox" ]
154   }
155   if (!is_android && !is_ios) {
156     deps += [ "//content/browser/tracing:resources" ]
157   }
159   if (enable_webrtc) {
160     sources += rebase_path(content_browser_gypi_values.webrtc_browser_sources,
161                            ".", "//content")
162     deps += [ "//jingle:jingle_glue" ]
163     if (is_linux) {
164       deps += [ "//third_party/libjingle:libjingle_webrtc" ]
165     }
166     if (is_linux || is_mac || is_win) {
167       sources += [
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",
172       ]
173       if (use_aura) {
174         sources += [
175           "media/capture/desktop_capture_device_aura.cc",
176           "media/capture/desktop_capture_device_aura.h",
177         ]
178       }
179       defines += [ "ENABLE_SCREEN_CAPTURE=1" ]
180       deps += [ "//third_party/webrtc/modules/desktop_capture" ]
181     }
182   }
184   if (is_win) {
185     sources -= [
186       "device_sensors/data_fetcher_shared_memory_default.cc",
187       "geolocation/empty_wifi_data_provider.cc",
188     ]
189     defines += [
190       # This prevents the inclusion of atlhost.h which paired
191       # with the windows 8 sdk it does the wrong thing.
192       "__ATLHOST_H__",
193     ]
194     deps += [
195       "//third_party/iaccessible2",
196       "//third_party/isimpledom",
197     ]
198     libs += [
199       "comctl32.lib",
200       "dinput8.lib",
201       "dwmapi.lib",
202       "dxguid.lib",
203       "sensorsapi.lib",
204       "portabledeviceguids.lib",
205     ]
206     # TODI(GYP)
207 #       'msvs_settings': {
208 #         'VCLinkerTool': {
209 #           'DelayLoadDLLs': [
210 #             'dinput8.dll',
211 #             'user32.dll',
212 #             'dwmapi.dll',
213 #           ],
214   }
216   if (is_linux) {
217     deps += [ "//sandbox/linux:libc_urandom_override" ]
218   }
220   if (use_udev) {
221     configs += [ "//build/config/linux:udev" ]
222   } else {
223     # Remove udev-specific sources.
224     sources -= [
225       "device_monitor_udev.cc",
226       "device_monitor_udev.h",
227     ]
228     if (is_linux) {
229       # Already filtered out on non-Linux.
230       sources -= [
231         "gamepad/gamepad_platform_data_fetcher_linux.cc",
232         "udev_linux.cc",
233         "udev_linux.h",
234       ]
235     }
236   }
238   if (enable_plugins) {
239     sources += rebase_path(content_browser_gypi_values.plugin_browser_sources,
240                            ".", "//content")
241     deps += [
242       "//ppapi:ppapi_ipc",
243       "//ppapi:ppapi_shared",
244     ]
245     if (!use_ozone || use_pango) {
246       sources -= [ "renderer_host/pepper/pepper_truetype_font_list_ozone.cc" ]
247     }
248     if (!use_pango) {
249       sources -= [ "renderer_host/pepper/pepper_truetype_font_list_pango.cc" ]
250     }
251   }
253   if (is_linux && use_aura) {
254     configs += [ "//build/config/linux:fontconfig" ]
255   }
257   if (use_x11) {
258     configs += [ "//build/config/linux:x11" ]
259   }
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", ]
266   }
267   if (is_chromeos || !use_x11) {
268     sources -= [ "power_save_blocker_x11.cc", ]
269   }
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" ]
275   }
276   if (is_chromeos || (is_linux && !use_dbus)) {
277     # This will already have gotten removed for all non-Linux cases.
278     sources -= [
279       "battery_status/battery_status_manager_linux.cc",
280       "geolocation/wifi_data_provider_linux.cc"
281     ]
282   }
284   if (is_android) {
285     sources -= [ "geolocation/wifi_data_provider_common.cc" ]
286   }
287   if (is_linux && use_dbus) {
288     sources -= [ "geolocation/empty_wifi_data_provider.cc" ]
289   }
291   if (use_pango) {
292     configs += [ "//build/config/linux:pangocairo" ]
293   }
295   if (is_android) {
296     sources += rebase_path(content_browser_gypi_values.android_browser_sources,
297                            ".", "//content")
298     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",
331     ]
332     deps += [
333       "//content/public/android:jni",
334       "//media",
335       "//mojo/android:libsystem_java",
336     ]
337     libs += [ "jnigraphics" ]
338   }
340   if (is_mac) {
341     sources -= [
342       "device_sensors/data_fetcher_shared_memory_default.cc",
343       "geolocation/empty_wifi_data_provider.cc",
344       "geolocation/empty_wifi_data_provider.h",
345     ]
346     libs += [ "bsm" ]
347   }
349   if (is_chromeos) {
350     deps += [ "//chromeos:power_manager_proto" ]
351   }
353   if (use_aura) {
354     deps += [
355       "//ui/aura",
356       "//ui/strings",
357       "//ui/wm",
358     ]
359   } else {  # Not aura.
360     sources -= [
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",
384     ]
385   }
387   if (use_aura || is_mac) {
388     sources += rebase_path(
389       content_browser_gypi_values.compositor_browser_sources,
390       ".", "//content")
391     if (!use_x11) {
392       sources -= [
393         "compositor/software_output_device_x11.cc",
394         "compositor/software_output_device_x11.h",
395       ]
396     }
398     if (!use_ozone) {
399       sources -= [
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",
404       ]
405     }
406     deps += [ "//ui/compositor" ]
407   }
409   if (enable_web_speech) {
410     deps += [
411       "//third_party/flac",
412       "//third_party/speex",
413     ]
414   }
416   if (is_linux && use_dbus) {
417       deps += [ "//dbus" ]
418   }
420   if (enable_browser_cdms) {
421     sources += [
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",
426     ]
427   }