Make USB permissions work in the new permission message system
[chromium-blink-merge.git] / content / renderer / BUILD.gn
blobe05fe0309064e8312461465b998fc85ba5457901
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     "//components/url_formatter",
32     "//components/scheduler:scheduler",
33     "//content:resources",
34     "//content/common:mojo_bindings",
35     "//content/public/child:child_sources",
36     "//content/public/common:common_sources",
37     "//content/public/common:mojo_bindings",
38     "//device/battery:mojo_bindings",
39     "//device/vibration:mojo_bindings",
40     "//gin",
41     "//gpu",
42     "//gpu/command_buffer/client:gles2_interface",
43     "//jingle:jingle_glue",
44     "//media",
45     "//media/blink",
46     "//mojo/application/public/interfaces",
47     "//mojo/environment:chromium",
48     "//mojo/common:url_type_converters",
49     "//mojo/converters/geometry",
50     "//net",
51     "//skia",
52     "//skia/public",
53     "//storage/common",
54     "//third_party/icu",
55     "//third_party/libjingle",
56     "//third_party/mojo/src/mojo/edk/js",
57     "//third_party/mojo/src/mojo/public/cpp/bindings",
58     "//third_party/mojo/src/mojo/public/js",
59     "//third_party/npapi",
60     "//third_party/WebKit/public:blink",
61     "//third_party/widevine/cdm:version_h",
62     "//ui/accessibility",
63     "//ui/base",
64     "//ui/events:events_base",
65     "//ui/events:dom_keycode_converter",
66     "//ui/gl",
67     "//ui/native_theme",
68     "//ui/surface",
69     "//v8",
70   ]
72   if (is_mac) {
73     sources -= [
74       "webscrollbarbehavior_impl_gtkoraura.cc",
75       "webscrollbarbehavior_impl_gtkoraura.h",
76     ]
77     sources += [
78       "external_popup_menu.cc",
79       "external_popup_menu.h",
80     ]
81   }
83   if (is_android) {
84     sources -= [ "media/audio_decoder.cc" ]
85     sources += [
86       "external_popup_menu.cc",
87       "external_popup_menu.h",
88     ]
90     # Add back the Linux file which Android shares.
91     set_sources_assignment_filter([])
92     sources += [ "render_view_linux.cc" ]
94     deps += [
95       "//third_party/android_tools:cpu_features",
96       "//third_party/libphonenumber",
97     ]
98   } else {
99     sources -= [
100       "java/gin_java_bridge_dispatcher.cc",
101       "java/gin_java_bridge_dispatcher.h",
102       "java/gin_java_bridge_object.cc",
103       "java/gin_java_bridge_object.h",
104       "java/gin_java_bridge_value_converter.cc",
105       "java/gin_java_bridge_value_converter.h",
106       "java/gin_java_function_invocation_helper.cc",
107       "java/gin_java_function_invocation_helper.h",
108     ]
109   }
111   # TODO(jrg): remove the OS=="android" section?
112   # http://crbug.com/113172
113   # Understand better how media_stream_ is tied into Chromium.
114   if (!enable_webrtc && is_android) {
115     sources -= [
116       "media/media_stream_audio_level_calculator.cc",
117       "media/media_stream_audio_level_calculator.h",
118       "media/media_stream_center.h",
119       "media/media_stream_constraints_util.cc",
120       "media/media_stream_constraints_util.h",
121       "media/media_stream_dispatcher.h",
122       "media/media_stream_dispatcher_eventhandler.h",
123       "media/media_stream_track.cc",
124       "media/media_stream_track.h",
125     ]
126   }
128   if (enable_webrtc) {
129     sources += rebase_path(
130             content_renderer_gypi_values.private_renderer_webrtc_sources,
131             ".",
132             "//content")
133     deps += [
134       "//crypto",
135       "//third_party/libyuv",
136       "//third_party/webrtc/modules/audio_device",
137       "//third_party/webrtc/modules/audio_processing",
138       "//third_party/libjingle:libjingle_webrtc",
139       "//third_party/libjingle:libpeerconnection",
140       "//third_party/libjingle:libstunprober",
141     ]
142   } else {
143     sources += [
144       "media/webrtc_logging.h",
145       "media/webrtc_logging_noop.cc",
146     ]
147   }
149   if (enable_plugins) {
150     sources += rebase_path(
151             content_renderer_gypi_values.private_renderer_plugin_sources,
152             ".",
153             "//content")
154     deps += [
155       "//ppapi/host",
156       "//ppapi/proxy",
157       "//ppapi/shared_impl",
158       "//third_party/libvpx",
159       "//third_party/libyuv",
160     ]
161   } else {
162     # These files are in the WebRTC list, but also require plugins.
163     if (enable_webrtc) {
164       sources -= [
165         "media/webrtc/video_destination_handler.cc",
166         "media/webrtc/video_destination_handler.h",
167       ]
168     }
169   }
171   if (enable_plugins && enable_webrtc) {
172     sources += rebase_path(
173             content_renderer_gypi_values.private_renderer_plugin_webrtc_sources,
174             ".",
175             "//content")
176   }
178   if (!enable_pepper_cdms) {
179     sources -= [
180       "media/crypto/pepper_cdm_wrapper.h",
181       "media/crypto/pepper_cdm_wrapper_impl.cc",
182       "media/crypto/pepper_cdm_wrapper_impl.h",
183       "media/crypto/ppapi_decryptor.cc",
184       "media/crypto/ppapi_decryptor.h",
185     ]
186   }
188   if (enable_print_preview) {
189     deps += [ "//printing" ]
190   }
192   if (enable_browser_cdms) {
193     sources += [
194       "media/crypto/proxy_media_keys.cc",
195       "media/crypto/proxy_media_keys.h",
196       "media/crypto/renderer_cdm_manager.cc",
197       "media/crypto/renderer_cdm_manager.h",
198     ]
199   }
201   if (enable_mojo_media != "none") {
202     deps += [ "//media/mojo/services:proxy" ]
203   }
205   if (enable_webvr) {
206     sources += [
207       "vr/vr_dispatcher.cc",
208       "vr/vr_dispatcher.h",
209       "vr/vr_type_converters.cc",
210       "vr/vr_type_converters.h",
211     ]
212   }