[Android WebView] Upstream WebViewShell to chromium.
[chromium-blink-merge.git] / content / renderer / BUILD.gn
blob13713fda9a15242d8baaf9a76ac933e4471cb7cb
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/renderer/renderer.gni")
8 import("//media/media_options.gni")
10 source_set("renderer") {
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/renderer:renderer_sources" ]
15   sources = rebase_path(content_renderer_gypi_values.private_renderer_sources,
16                         ".",
17                         "//content")
19   configs += [
20     "//content:content_implementation",
21     "//build/config/compiler:no_size_t_to_int_warning",
22   ]
24   deps = [
25     # TODO(GYP) bug 376846 remove this. This should be inherited from //net but
26     # those don't cross component boundaries.
27     "//crypto:platform",
28     "//base/allocator",
29     "//cc",
30     "//cc/blink",
31     "//content:resources",
32     "//content/common:mojo_bindings",
33     "//content/public/child:child_sources",
34     "//content/public/common:common_sources",
35     "//content/public/common:mojo_bindings",
36     "//device/battery:mojo_bindings",
37     "//device/vibration:mojo_bindings",
38     "//gin",
39     "//gpu",
40     "//gpu/command_buffer/client:gles2_interface",
41     "//jingle:jingle_glue",
42     "//media",
43     "//media/blink",
44     "//mojo/environment:chromium",
45     "//net",
46     "//skia",
47     "//storage/common",
48     "//third_party/icu",
49     "//third_party/libjingle",
50     "//third_party/mojo/src/mojo/edk/js",
51     "//third_party/mojo/src/mojo/public/js",
52     "//third_party/mojo/src/mojo/public/interfaces/application",
53     "//third_party/npapi",
54     "//third_party/WebKit/public:blink",
55     "//third_party/widevine/cdm:version_h",
56     "//ui/accessibility",
57     "//ui/base",
58     "//ui/events:events_base",
59     "//ui/events:dom4_keycode_converter",
60     "//ui/gl",
61     "//ui/native_theme",
62     "//ui/surface",
63     "//v8",
64     "//webkit/common/gpu",
65   ]
67   if (is_mac) {
68     sources -= [
69       "webscrollbarbehavior_impl_gtkoraura.cc",
70       "webscrollbarbehavior_impl_gtkoraura.h",
71     ]
72     sources += [
73       "external_popup_menu.cc",
74       "external_popup_menu.h",
75     ]
76   }
78   if (is_android) {
79     sources -= [ "media/audio_decoder.cc" ]
80     sources += [
81       "external_popup_menu.cc",
82       "external_popup_menu.h",
83     ]
85     # Add back the Linux file which Android shares.
86     set_sources_assignment_filter([])
87     sources += [ "render_view_linux.cc" ]
89     deps += [
90       "//third_party/android_tools:cpu_features",
91       "//third_party/libphonenumber",
92     ]
93   } else {
94     sources -= [
95       "java/gin_java_bridge_dispatcher.cc",
96       "java/gin_java_bridge_dispatcher.h",
97       "java/gin_java_bridge_object.cc",
98       "java/gin_java_bridge_object.h",
99       "java/gin_java_bridge_value_converter.cc",
100       "java/gin_java_bridge_value_converter.h",
101       "java/gin_java_function_invocation_helper.cc",
102       "java/gin_java_function_invocation_helper.h",
103     ]
104   }
106   # TODO(jrg): remove the OS=="android" section?
107   # http://crbug.com/113172
108   # Understand better how media_stream_ is tied into Chromium.
109   if (!enable_webrtc && is_android) {
110     sources -= [
111       "media/media_stream_audio_level_calculator.cc",
112       "media/media_stream_audio_level_calculator.h",
113       "media/media_stream_audio_renderer.cc",
114       "media/media_stream_audio_renderer.h",
115       "media/media_stream_center.h",
116       "media/media_stream_constraints_util.cc",
117       "media/media_stream_constraints_util.h",
118       "media/media_stream_dispatcher.h",
119       "media/media_stream_dispatcher_eventhandler.h",
120       "media/media_stream_track.cc",
121       "media/media_stream_track.h",
122     ]
123   }
125   if (enable_webrtc) {
126     sources += rebase_path(
127             content_renderer_gypi_values.private_renderer_webrtc_sources,
128             ".",
129             "//content")
130     deps += [
131       "//crypto",
132       "//third_party/libyuv",
133       "//third_party/webrtc/modules/audio_device",
134       "//third_party/webrtc/modules/audio_processing",
135       "//third_party/libjingle:libjingle_webrtc",
136       "//third_party/libjingle:libpeerconnection",
137     ]
138   } else {
139     sources += [
140       "media/webrtc_logging.h",
141       "media/webrtc_logging_noop.cc",
142     ]
143   }
145   if (enable_plugins) {
146     sources += rebase_path(
147             content_renderer_gypi_values.private_renderer_plugin_sources,
148             ".",
149             "//content")
150     deps += [
151       "//media/cast:sender",
152       "//ppapi/host",
153       "//ppapi/proxy",
154       "//ppapi/shared_impl",
155       "//third_party/libyuv",
156     ]
157   } else {
158     # These files are in the WebRTC list, but also require plugins.
159     if (enable_webrtc) {
160       sources -= [
161         "media/webrtc/video_destination_handler.cc",
162         "media/webrtc/video_destination_handler.h",
163       ]
164     }
165   }
167   if (enable_plugins && enable_webrtc) {
168     sources += rebase_path(
169             content_renderer_gypi_values.private_renderer_plugin_webrtc_sources,
170             ".",
171             "//content")
172   }
174   if (!enable_pepper_cdms) {
175     sources -= [
176       "media/crypto/pepper_cdm_wrapper.h",
177       "media/crypto/pepper_cdm_wrapper_impl.cc",
178       "media/crypto/pepper_cdm_wrapper_impl.h",
179       "media/crypto/ppapi_decryptor.cc",
180       "media/crypto/ppapi_decryptor.h",
181     ]
182   }
184   if (enable_print_preview) {
185     deps += [ "//printing" ]
186   }
188   if (enable_browser_cdms) {
189     sources += [
190       "media/crypto/proxy_media_keys.cc",
191       "media/crypto/proxy_media_keys.h",
192       "media/crypto/renderer_cdm_manager.cc",
193       "media/crypto/renderer_cdm_manager.h",
194     ]
195   }
197   if (enable_media_mojo_renderer) {
198     sources += [
199       "media/media_renderer_service_provider.cc",
200       "media/media_renderer_service_provider.h",
201     ]
202     deps += [ "//media/mojo/services:renderer_proxy" ]
203   }