Add a FrameHostMsg_BeginNavigation IPC
[chromium-blink-merge.git] / content / browser / BUILD.gn
blobfe3c729626b4fb2126b573d86b51fc1858c67660
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     "//content:resources",
27     "//content/browser/service_worker:database_proto",
28     "//content/browser/speech/proto",
29     "//crypto",
30     "//google_apis",
31     "//net",
32     "//skia",
33     "//sql",
34     "//third_party/re2",
35     "//third_party/WebKit/public:blink_headers",
36     "//third_party/zlib",
37     "//third_party/zlib:zip",
38     "//ui/accessibility",
39     "//ui/accessibility:ax_gen",
40     "//ui/base",
41     "//ui/events",
42     "//ui/events:gesture_detection",
43     "//ui/gfx",
44     "//ui/gfx/geometry",
45     "//ui/resources",
46     "//ui/snapshot",
47   ]
49   if (is_ios) {
50     # iOS doesn't get the normal file list and only takes these whitelisted
51     # files.
52     sources = [
53       "browser_context.cc",
54       "browser_main_loop.cc",
55       "browser_main_runner.cc",
56       "browser_process_sub_thread.cc",
57       "browser_thread_impl.cc",
58       "browser_url_handler_impl.cc",
59       "cert_store_impl.cc",
60       "download/download_create_info.cc",
61       "notification_service_impl.cc",
62       "signed_certificate_timestamp_store_impl.cc",
63       "user_metrics.cc",
64       "web_contents/navigation_entry_impl.cc",
65     ]
66   } else {
67     # Normal non-iOS sources get everything.
68     sources = rebase_path(content_browser_gypi_values.private_browser_sources,
69                           ".", "//content")
71     # TODO(GYP) these generated files are listed as sources in content_browser.
72     # This is a bit suspicious. The GN grit template will make a source set
73     # containing the generated code so it should be sufficient to just depend
74     # on the grit rule. But maybe some of these will need to be added?
75     #
76     # Need this annoying rebase_path call to match what happened with the
77     # sources.
78     sources -= rebase_path([
79       "$root_gen_dir/webkit/grit/devtools_resources.h",
80       "$root_gen_dir/webkit/grit/devtools_resources_map.cc",
81       "$root_gen_dir/webkit/grit/devtools_resources_map.h",
82       "$root_gen_dir/content/browser/tracing/grit/tracing_resources.h",
83       "$root_gen_dir/ui/resources/grit/webui_resources_map.cc",
84       "$root_gen_dir/content/browser/devtools/devtools_protocol_constants.cc",
85       "$root_gen_dir/content/browser/devtools/devtools_protocol_constants.h",
86     ], ".")
88     # Non-iOS deps.
89     deps += [
90       "//content/browser/devtools:resources",
91       "//content/common:mojo_bindings",
92       "//cc",
93       "//cc:cc_surfaces",
94       "//mojo/public/cpp/bindings",
95       "//mojo/public/interfaces/service_provider",
96       "//mojo/public/js/bindings",
97       "//net:http_server",
98       "//third_party/icu",
99       "//third_party/leveldatabase",
100       "//third_party/libyuv",
101       "//ui/resources",
102       "//ui/surface",
103       "//webkit:resources",
104       "//webkit:strings",
105       "//webkit/browser:storage",
106       "//webkit/common",
107       "//webkit/common:storage",
108       "//third_party/angle:commit_id",
109     ]
110   }
112   configs += [
113     "//content:content_implementation",
114     "//content:libjingle_stub_config",  # TODO(GYP) remove when libjingle is ready.
115     "//content:webrtc_stub_config",  # TODO(GYP) remove when webrtc is ready.
116   ]
118   if (toolkit_views) {
119     deps += [ "//ui/events" ]
120   }
122   if (is_win) {
123     sources += [
124       "power_profiler/power_data_provider_ia_win.cc",
125       "power_profiler/power_data_provider_ia_win.h",
126     ]
127     deps += [ "//third_party/power_gadget" ]
128   } else {
129     sources += [ "power_profiler/power_data_provider_dummy.cc" ]
130     sources -= [ "renderer_host/web_input_event_aurawin.cc" ]
131   }
133   if (!is_win && !is_mac && (!is_linux || !use_udev)) {
134     sources += [ "gamepad/gamepad_platform_data_fetcher.cc" ]
135   }
137   if (enable_printing != 0) {
138     deps += [ "//printing" ]
139   }
141 # TODO(GYP)
142 #   ['OS!="ios" and chrome_multiple_dll!=1', {
143 #     'dependencies': [
144 #       '../third_party/WebKit/public/blink.gyp:blink',
145 #     ],
146 #   }],
147   if (!is_mac && !is_ios) {
148     deps += [ "//sandbox" ]
149   }
150   if (!is_android && !is_ios) {
151     deps += [ "//content/browser/tracing:resources" ]
152   }
154   if (enable_webrtc) {
155     sources += rebase_path(content_browser_gypi_values.webrtc_browser_sources,
156                            ".", "//content")
157     # TODO(GYP)
158     #deps += [ "//jingle:glue" ]
159     if (is_linux) {
160       # TODO(GYP)
161       #deps += [ "//third_party/libjingle:libjingle_webrtc" ]
162     }
163     if (is_linux || is_mac || is_win) {
164       sources += [
165         "media/capture/desktop_capture_device.cc",
166         "media/capture/desktop_capture_device.h",
167         "media/capture/desktop_capture_device_uma_types.cc",
168         "media/capture/desktop_capture_device_uma_types.h",
169       ]
170       if (use_aura) {
171         sources += [
172           "media/capture/desktop_capture_device_aura.cc",
173           "media/capture/desktop_capture_device_aura.h",
174         ]
175       }
176       defines += [ "ENABLE_SCREEN_CAPTURE=1" ]
177       # TODO(GYP)
178       #deps += [ "//third_party/webrtc/modules:desktop_capture" ]
179     }
180   }
182   if (is_win) {
183     sources -= [
184       "device_sensors/data_fetcher_shared_memory_default.cc",
185       "geolocation/empty_wifi_data_provider.cc",
186     ]
187     defines += [
188       # This prevents the inclusion of atlhost.h which paired
189       # with the windows 8 sdk it does the wrong thing.
190       "__ATLHOST_H__",
191     ]
192     deps += [
193       "//third_party/iaccessible2",
194       "//third_party/isimpledom",
195     ]
196     libs += [
197       "comctl32.lib",
198       "dinput8.lib",
199       "dwmapi.lib",
200       "dxguid.lib",
201       "sensorsapi.lib",
202       "portabledeviceguids.lib",
203     ]
204     # TODI(GYP)
205 #       'msvs_settings': {
206 #         'VCLinkerTool': {
207 #           'DelayLoadDLLs': [
208 #             'dinput8.dll',
209 #             'user32.dll',
210 #             'dwmapi.dll',
211 #           ],
212   }
214   if (is_linux) {
215     deps += [ "//sandbox/linux:libc_urandom_override" ]
216   }
218   if (use_udev) {
219     configs += [ "//build/config/linux:udev" ]
220   } else {
221     # Remove udev-specific sources.
222     sources -= [
223       "device_monitor_udev.cc",
224       "device_monitor_udev.h",
225     ]
226     if (is_linux) {
227       # Already filtered out on non-Linux.
228       sources -= [
229         "gamepad/gamepad_platform_data_fetcher_linux.cc",
230         "udev_linux.cc",
231         "udev_linux.h",
232       ]
233     }
234   }
236   if (enable_plugins) {
237     sources += rebase_path(content_browser_gypi_values.plugin_browser_sources,
238                            ".", "//content")
239     deps += [
240       "//ppapi:ppapi_ipc",
241       "//ppapi:ppapi_shared",
242     ]
243     if (!use_ozone || use_pango) {
244       sources -= [ "renderer_host/pepper/pepper_truetype_font_list_ozone.cc" ]
245     }
246     if (!use_pango) {
247       sources -= [ "renderer_host/pepper/pepper_truetype_font_list_pango.cc" ]
248     }
249   }
251   if (is_linux && use_aura) {
252     configs += [ "//build/config/linux:fontconfig" ]
253   }
255   if (use_x11) {
256     configs += [ "//build/config/linux:x11" ]
257   } else {
258     sources -= [
259       "power_save_blocker_x11.cc",
260       "renderer_host/web_input_event_aurax11.cc",
261     ]
262   }
264   if (use_pango) {
265     configs += [ "//build/config/linux:pangocairo" ]
266   }
268   if (is_android) {
269     sources += rebase_path(content_browser_gypi_values.android_browser_sources,
270                            ".", "//content")
271     sources -= [
272       "battery_status/battery_status_manager_default.cc",
273       "browser_ipc_logging.cc",
274       "device_sensors/data_fetcher_shared_memory_default.cc",
275       "font_list_async.cc",
276       "geolocation/device_data_provider.cc",
277       "geolocation/empty_device_data_provider.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",  TODO(GYP)
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_ozone.cc",
330       "power_save_blocker_x11.cc",
331     ]
332     deps += [ "//chromeos:power_manager_proto" ]
333   }
335   if (use_aura) {
336     deps += [
337       "//ui/aura",
338       "//ui/strings",
339     ]
340   } else {  # Not aura.
341     sources -= [
342       "renderer_host/input/synthetic_gesture_target_aura.cc",
343       "renderer_host/input/synthetic_gesture_target_aura.h",
344       "renderer_host/native_web_keyboard_event_aura.cc",
345       "renderer_host/render_widget_host_view_aura.cc",
346       "renderer_host/render_widget_host_view_aura.h",
347       "renderer_host/ui_events_helper.cc",
348       "renderer_host/ui_events_helper.h",
349       "renderer_host/web_input_event_aura.cc",
350       "renderer_host/web_input_event_aura.h",
351       "web_contents/aura/gesture_nav_simple.cc",
352       "web_contents/aura/gesture_nav_simple.h",
353       "web_contents/aura/image_window_delegate.cc",
354       "web_contents/aura/image_window_delegate.h",
355       "web_contents/aura/overscroll_navigation_overlay.cc",
356       "web_contents/aura/overscroll_navigation_overlay.h",
357       "web_contents/aura/shadow_layer_delegate.cc",
358       "web_contents/aura/shadow_layer_delegate.h",
359       "web_contents/aura/window_slider.cc",
360       "web_contents/aura/window_slider.h",
361       "web_contents/touch_editable_impl_aura.cc",
362       "web_contents/touch_editable_impl_aura.h",
363       "web_contents/web_contents_view_aura.cc",
364       "web_contents/web_contents_view_aura.h",
365     ]
366   }
368   if (use_aura || is_mac) {
369     sources += rebase_path(
370       content_browser_gypi_values.compositor_browser_sources,
371       ".", "//content")
372     if (!use_x11) {
373       sources -= [
374         "compositor/software_output_device_x11.cc",
375         "compositor/software_output_device_x11.h",
376       ]
377     }
378     deps += [ "//ui/compositor" ]
379   }
381   if (enable_web_speech) {
382     deps += [
383       "//third_party/flac",
384       "//third_party/speex",
385     ]
386   }
388   if (is_linux) {
389     if (use_dbus) {
390       sources -= [
391         "geolocation/empty_wifi_data_provider.cc",
392       ]
393       deps += [ "//dbus" ]
394     } else {
395       # This will already have gotten removed for all non-Linux cases.
396        sources -= [ "geolocation/wifi_data_provider_linux.cc" ]
397     }
398   }