Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / content / child / BUILD.gn
blobc567f4eb8f5de50e014f3a283228f6f572ebf481
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/crypto.gni")
6 import("//build/config/features.gni")
7 import("//build/config/ui.gni")
8 import("//content/child/child.gni")
10 source_set("child") {
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/child:child_sources" ]
15   sources = rebase_path(content_child_gypi_values.private_child_sources,
16                         ".",
17                         "//content")
19   public_deps = [
20     "//third_party/mojo/src/mojo/edk/system",
21   ]
23   deps = [
24     "//base",
25     "//components/tracing",
26     "//content/common:mojo_bindings",
27     "//mojo/common",
28     "//mojo/environment:chromium",
29     "//skia",
30     "//third_party/icu",
31     "//third_party/mojo/src/mojo/public/interfaces/application",
32     "//ui/base",
33     "//ui/events/gestures/blink",
34     "//ui/gfx",
35     "//ui/gfx/geometry",
36     "//ui/native_theme",
37     "//url",
38   ]
40   if (!use_default_render_theme) {
41     sources -= [
42       "webthemeengine_impl_default.cc",
43       "webthemeengine_impl_default.h",
44     ]
45   }
47   if (is_android) {
48     deps += [ "//third_party/android_tools:cpu_features" ]
49   }
51   if (enable_plugins) {
52     deps += [ "//ppapi/proxy" ]
53   } else {
54     sources -= [
55       "browser_font_resource_trusted.cc",
56       "npapi/plugin_host.cc",
57       "npapi/plugin_host.h",
58       "npapi/plugin_instance.cc",
59       "npapi/plugin_instance.h",
60       "npapi/plugin_lib.cc",
61       "npapi/plugin_lib.h",
62       "npapi/plugin_stream.cc",
63       "npapi/plugin_stream.h",
64       "npapi/plugin_stream_posix.cc",
65       "npapi/plugin_stream_url.cc",
66       "npapi/plugin_stream_url.h",
67       "npapi/plugin_string_stream.cc",
68       "npapi/plugin_string_stream.h",
69       "npapi/plugin_url_fetcher.cc",
70       "npapi/plugin_url_fetcher.h",
71       "npapi/webplugin.h",
72       "npapi/webplugin_delegate.h",
73       "npapi/webplugin_delegate_impl.cc",
74       "npapi/webplugin_delegate_impl.h",
75       "npapi/webplugin_resource_client.h",
76     ]
78     if (is_mac) {
79       sources -= [
80         "npapi/plugin_instance_mac.mm",
81         "npapi/plugin_web_event_converter_mac.h",
82         "npapi/plugin_web_event_converter_mac.mm",
83         "npapi/webplugin_accelerated_surface_mac.h",
84         "npapi/webplugin_delegate_impl_mac.mm",
85       ]
86     } else if (is_win) {
87       sources -= [
88         "npapi/plugin_stream_win.cc",
89         "npapi/webplugin_delegate_impl_win.cc",
90         "npapi/webplugin_ime_win.cc",
91         "npapi/webplugin_ime_win.h",
92       ]
93     } else if (is_android) {
94       sources -= [ "npapi/webplugin_delegate_impl_android.cc" ]
95     }
96     if (use_aura) {
97       sources -= [ "npapi/webplugin_delegate_impl_aura.cc" ]
98     }
99   }
101   configs += [
102     "//content:content_implementation",
103     "//build/config/compiler:no_size_t_to_int_warning",
104   ]
106   if (is_ios) {
107     # iOS only needs a small portion of content; exclude all the
108     # implementation, and re-include what is used.
109     sources = []
110   } else {
111     deps += [
112       "//content/app/resources",
113       "//content/app/strings",
114       "//crypto:platform",
115       "//storage/common",
116       "//third_party/WebKit/public:blink",
117       "//third_party/WebKit/public:image_resources",
118       "//third_party/WebKit/public:resources",
119       "//third_party/npapi",
120     ]
121   }
123   if (use_aura && is_mac) {
124     # This file is already excluded on non-Mac.
125     sources -= [ "npapi/webplugin_delegate_impl_mac.mm" ]
126   }
128   if (is_win || !use_aura) {
129     sources -= [ "npapi/webplugin_delegate_impl_aura.cc" ]
130   }
132   if (!use_openssl) {
133     sources += rebase_path(content_child_gypi_values.webcrypto_nss_sources,
134                            ".",
135                            "//content")
136   } else {
137     sources += rebase_path(content_child_gypi_values.webcrypto_openssl_sources,
138                            ".",
139                            "//content")
140   }