Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / browser / BUILD.gn
blob5dc3078aff2e4b60a4ee76d038b08cbc73726f48
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")
9 config("storage_config") {
10   if (is_android) {
11     defines = [ "APPCACHE_USE_SIMPLE_CACHE" ]
12   }
15 source_set("browser") {
16   # Only targets in the content tree can depend directly on this target.
17   visibility = [ "//content/*" ]
19   defines = []
20   libs = []
21   ldflags = []
23   # Shared deps. See also non-iOS deps below.
24   deps = [
25     "//base",
26     "//base:base_static",
27     "//content:resources",
28     "//content/browser/service_worker:proto",
29     "//content/browser/speech/proto",
30     "//crypto",
31     "//google_apis",
32     "//net",
33     "//skia",
34     "//sql",
35     "//third_party/re2",
36     "//third_party/WebKit/public:blink_headers",
37     "//third_party/zlib",
38     "//third_party/zlib:zip",
39     "//ui/accessibility",
40     "//ui/accessibility:ax_gen",
41     "//ui/base",
42     "//ui/events",
43     "//ui/events:gesture_detection",
44     "//ui/gfx",
45     "//ui/gfx/geometry",
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     ], ".")
89     # Non-iOS deps.
90     deps += [
91       "//cc",
92       "//cc/surfaces",
93       "//content/app/resources",
94       "//content/app/strings",
95       "//content/browser/devtools:resources",
96       "//content/common:mojo_bindings",
97       "//mojo/public/cpp/bindings",
98       "//mojo/public/interfaces/application",
99       "//mojo/public/js/bindings",
100       "//net:http_server",
101       "//third_party/WebKit/public:resources",
102       "//third_party/angle:commit_id",
103       "//third_party/icu",
104       "//third_party/leveldatabase",
105       "//third_party/libyuv",
106       "//ui/resources",
107       "//ui/surface",
108       "//webkit/browser:storage",
109       "//webkit/common",
110       "//webkit/common:storage",
111     ]
112   }
114   configs += [
115     "//content:content_implementation",
116     "//content:libjingle_stub_config",  # TODO(GYP) remove when libjingle is ready.
117     "//content:webrtc_stub_config",  # TODO(GYP) remove when webrtc is ready.
118   ]
120   if (toolkit_views) {
121     deps += [ "//ui/events" ]
122   }
124   if (is_win) {
125     sources += [
126       "power_profiler/power_data_provider_ia_win.cc",
127       "power_profiler/power_data_provider_ia_win.h",
128     ]
129     deps += [ "//third_party/power_gadget" ]
130   } else {
131     sources += [ "power_profiler/power_data_provider_dummy.cc" ]
132     sources -= [ "renderer_host/web_input_event_aurawin.cc" ]
133   }
135   if (!is_win && !is_mac && (!is_linux || !use_udev)) {
136     sources += [ "gamepad/gamepad_platform_data_fetcher.cc" ]
137   }
139   if (printing_mode != 0) {
140     deps += [ "//printing" ]
141   }
143 # TODO(GYP)
144 #   ['OS!="ios" and chrome_multiple_dll!=1', {
145 #     'dependencies': [
146 #       '../third_party/WebKit/public/blink.gyp:blink',
147 #     ],
148 #   }],
149   if (!is_mac && !is_ios) {
150     deps += [ "//sandbox" ]
151   }
152   if (!is_android && !is_ios) {
153     deps += [ "//content/browser/tracing:resources" ]
154   }
156   if (enable_webrtc) {
157     sources += rebase_path(content_browser_gypi_values.webrtc_browser_sources,
158                            ".", "//content")
159     # TODO(GYP)
160     #deps += [ "//jingle:glue" ]
161     if (is_linux) {
162       # TODO(GYP)
163       #deps += [ "//third_party/libjingle:libjingle_webrtc" ]
164     }
165     if (is_linux || is_mac || is_win) {
166       sources += [
167         "media/capture/desktop_capture_device.cc",
168         "media/capture/desktop_capture_device.h",
169         "media/capture/desktop_capture_device_uma_types.cc",
170         "media/capture/desktop_capture_device_uma_types.h",
171       ]
172       if (use_aura) {
173         sources += [
174           "media/capture/desktop_capture_device_aura.cc",
175           "media/capture/desktop_capture_device_aura.h",
176         ]
177       }
178       defines += [ "ENABLE_SCREEN_CAPTURE=1" ]
179       # TODO(GYP)
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   } else {
260     sources -= [
261       "power_save_blocker_x11.cc",
262       "renderer_host/web_input_event_aurax11.cc",
263     ]
264   }
266   if (use_pango) {
267     configs += [ "//build/config/linux:pangocairo" ]
268   }
270   if (is_android) {
271     sources += rebase_path(content_browser_gypi_values.android_browser_sources,
272                            ".", "//content")
273     sources -= [
274       "battery_status/battery_status_manager_default.cc",
275       "browser_ipc_logging.cc",
276       "device_sensors/data_fetcher_shared_memory_default.cc",
277       "font_list_async.cc",
278       "geolocation/network_location_provider.cc",
279       "geolocation/network_location_provider.h",
280       "geolocation/network_location_request.cc",
281       "geolocation/network_location_request.h",
282       "geolocation/wifi_data_provider_common.cc",
283       "renderer_host/native_web_keyboard_event.cc",
284       "tracing/tracing_ui.cc",
285       "tracing/tracing_ui.h",
287       # Android skips most, but not all, of the speech code.
288       "speech/audio_buffer.cc",
289       "speech/audio_buffer.h",
290       "speech/audio_encoder.cc",
291       "speech/audio_encoder.h",
292       "speech/chunked_byte_buffer.cc",
293       "speech/chunked_byte_buffer.h",
294       "speech/endpointer/endpointer.cc",
295       "speech/endpointer/endpointer.h",
296       "speech/endpointer/energy_endpointer.cc",
297       "speech/endpointer/energy_endpointer.h",
298       "speech/endpointer/energy_endpointer_params.cc",
299       "speech/endpointer/energy_endpointer_params.h",
300       "speech/google_one_shot_remote_engine.cc",
301       "speech/google_one_shot_remote_engine.h",
302       "speech/google_streaming_remote_engine.cc",
303       "speech/google_streaming_remote_engine.h",
304       "speech/speech_recognition_engine.cc",
305       "speech/speech_recognition_engine.h",
306       "speech/speech_recognizer_impl.cc",
307       "speech/speech_recognizer_impl.h",
308     ]
309     deps += [
310       #"//content:jni_headers",  TODO(GYP)
311       "//media",
312     ]
313     libs += [ "jnigraphics" ]
314   }
316   if (is_mac) {
317     sources -= [
318       "device_sensors/data_fetcher_shared_memory_default.cc",
319       "geolocation/empty_wifi_data_provider.cc",
320       "geolocation/empty_wifi_data_provider.h",
321     ]
322     libs += [ "bsm" ]
323   }
325   if (is_chromeos) {
326     sources -= [
327       "battery_status/battery_status_manager_default.cc",
328       "geolocation/wifi_data_provider_linux.cc",
329       "power_save_blocker_x11.cc",
330     ]
331     deps += [ "//chromeos:power_manager_proto" ]
332   }
334   if (!use_ozone || is_chromeos) {
335     sources -= [
336       "power_save_blocker_ozone.cc",
337     ]
338   }
340   if (use_aura) {
341     deps += [
342       "//ui/aura",
343       "//ui/strings",
344     ]
345   } else {  # Not aura.
346     sources -= [
347       "renderer_host/input/synthetic_gesture_target_aura.cc",
348       "renderer_host/input/synthetic_gesture_target_aura.h",
349       "renderer_host/native_web_keyboard_event_aura.cc",
350       "renderer_host/render_widget_host_view_aura.cc",
351       "renderer_host/render_widget_host_view_aura.h",
352       "renderer_host/ui_events_helper.cc",
353       "renderer_host/ui_events_helper.h",
354       "renderer_host/web_input_event_aura.cc",
355       "renderer_host/web_input_event_aura.h",
356       "web_contents/aura/gesture_nav_simple.cc",
357       "web_contents/aura/gesture_nav_simple.h",
358       "web_contents/aura/image_window_delegate.cc",
359       "web_contents/aura/image_window_delegate.h",
360       "web_contents/aura/overscroll_navigation_overlay.cc",
361       "web_contents/aura/overscroll_navigation_overlay.h",
362       "web_contents/aura/shadow_layer_delegate.cc",
363       "web_contents/aura/shadow_layer_delegate.h",
364       "web_contents/aura/window_slider.cc",
365       "web_contents/aura/window_slider.h",
366       "web_contents/touch_editable_impl_aura.cc",
367       "web_contents/touch_editable_impl_aura.h",
368       "web_contents/web_contents_view_aura.cc",
369       "web_contents/web_contents_view_aura.h",
370     ]
371   }
373   if (use_aura || is_mac) {
374     sources += rebase_path(
375       content_browser_gypi_values.compositor_browser_sources,
376       ".", "//content")
377     if (!use_x11) {
378       sources -= [
379         "compositor/software_output_device_x11.cc",
380         "compositor/software_output_device_x11.h",
381       ]
382     }
384     if (!use_ozone) {
385       sources -= [
386         "compositor/overlay_candidate_validator_ozone.cc",
387         "compositor/overlay_candidate_validator_ozone.h",
388         "compositor/software_output_device_ozone.cc",
389         "compositor/software_output_device_ozone.h",
390       ]
391     }
392     deps += [ "//ui/compositor" ]
393   }
395   if (enable_web_speech) {
396     deps += [
397       "//third_party/flac",
398       "//third_party/speex",
399     ]
400   }
402   if (is_linux) {
403     if (use_dbus) {
404       sources -= [
405         "battery_status/battery_status_manager_default.cc",
406         "geolocation/empty_wifi_data_provider.cc",
407       ]
408       deps += [ "//dbus" ]
409     } else {
410       # This will already have gotten removed for all non-Linux cases.
411        sources -= [
412          "battery_status/battery_status_manager_linux.cc",
413          "geolocation/wifi_data_provider_linux.cc",
414        ]
415     }
416   }