Supervised user import: Listen for profile creation/deletion
[chromium-blink-merge.git] / chrome / renderer / BUILD.gn
blob2fe4a66cc44399616174e562b7f943e57173394c
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("//tools/grit/grit_rule.gni")
8 gypi_values = exec_script("//build/gypi_to_gn.py",
9                           [ rebase_path("../chrome_renderer.gypi") ],
10                           "scope",
11                           [ "../chrome_renderer.gypi" ])
13 # GYP version: chrome/chrome_resources.gyp:chrome_resources
14 # (generate_renderer_resources action)
15 grit("resources") {
16   source = "resources/renderer_resources.grd"
17   output_dir = "$root_gen_dir/chrome"
18   output_name = "renderer_resources"
19   outputs = [
20     "grit/renderer_resources.h",
21     "renderer_resources_100_percent.pak",
22     "renderer_resources_200_percent.pak",
23     "renderer_resources_300_percent.pak",
24   ]
27 static_library("renderer") {
28   sources = rebase_path(gypi_values.chrome_renderer_sources, ".", "..")
30   defines = []
32   deps = [
33     "//base/allocator",
34     "//chrome/common",
35     "//chrome/common/net",
36     "//chrome:resources",
37     "//chrome:strings",
38     "//components/autofill/content/renderer",
39     "//components/content_settings/content/common",
40     "//components/cdm/renderer",
41     "//components/data_reduction_proxy/content/common",
42     "//components/network_hints/renderer",
43     "//components/error_page/renderer",
44     "//components/password_manager/content/renderer",
45     "//components/plugins/renderer",
46     "//components/printing/renderer:printing_renderer",
47     "//components/startup_metric_utils",
48     "//components/translate/content/renderer",
49     "//components/translate/core/common",
50     "//components/translate/core/language_detection",
51     "//components/visitedlink/renderer",
52     "//components/web_cache/renderer",
53     "//content/app/resources",
54     "//content/app/strings",
55     "//content/public/renderer",
56     "//net",
57     "//skia",
58     "//storage/common",
59     "//third_party/WebKit/public:blink",
60     "//third_party/WebKit/public:image_resources",
61     "//third_party/WebKit/public:resources",
62     "//third_party/icu",
63     "//third_party/npapi",
64     "//third_party/re2",
65     "//third_party/widevine/cdm:version_h",
66     "//ui/surface",
67     "//v8:v8",
68   ]
70   if (enable_nacl) {
71     deps += [
72       "//components/nacl",
73       "//components/nacl:nacl_renderer",
74     ]
75   }
77   if (enable_plugins) {
78     sources +=
79         rebase_path(gypi_values.chrome_renderer_plugin_sources, ".", "..")
80     deps += [
81       "//components/pdf/renderer",
82       "//ppapi/host",
83       "//ppapi/proxy",
84       "//ppapi/proxy:ipc",
85       "//ppapi/shared_impl",
86     ]
87   }
89   if (safe_browsing_mode != 0) {
90     sources += rebase_path(gypi_values.chrome_renderer_basic_safe_browsing_sources,
91                            ".",
92                            "..")
93     if (safe_browsing_mode == 1) {
94       sources +=
95           rebase_path(gypi_values.chrome_renderer_safe_browsing_sources,
96                       ".",
97                       "..")
98       deps += [
99         "//chrome/common/safe_browsing:proto",
100         "//third_party/smhasher:murmurhash3",
101       ]
102     }
103   }
105   if (enable_extensions) {
106     sources +=
107         rebase_path(gypi_values.chrome_renderer_extensions_sources, ".", "..")
108     deps += [
109       # TODO(hclam): See crbug.com/298380 for details.
110       # We should isolate the APIs needed by the renderer.
111       "//chrome/common/extensions/api",
112       "//extensions:extensions_resources",
113       "//extensions/renderer",
114       "//media/cast:net",
115       "//media/cast:receiver",
116       "//media/cast:sender",
117       "//media/cast/logging/proto",
118     ]
119     if (!enable_webrtc) {
120       sources -= [
121         "media/cast_receiver_session.cc",
122         "media/cast_receiver_session.h",
123         "media/cast_rtp_stream.cc",
124         "media/cast_rtp_stream.h",
125       ]
126     }
127   }
128   if (enable_webrtc) {
129     sources +=
130         rebase_path(gypi_values.chrome_renderer_webrtc_sources, ".", "..")
131   }
132   if (enable_extensions && enable_webrtc) {
133     sources +=
134         rebase_path(gypi_values.chrome_renderer_webrtc_extensions_sources,
135                     ".",
136                     "..")
137   }
138   if (enable_spellcheck) {
139     sources +=
140         rebase_path(gypi_values.chrome_renderer_spellchecker_sources, ".", "..")
141     deps += [ "//third_party/hunspell" ]
142   }
144   if (enable_basic_printing || enable_print_preview) {
145     deps += [ "//printing" ]
146     sources +=
147         rebase_path(gypi_values.chrome_renderer_printing_sources, ".", "..")
148     if (enable_print_preview) {
149       sources += rebase_path(gypi_values.chrome_renderer_full_printing_sources,
150                              ".",
151                              "..")
152     }
153   }
155   if (is_mac) {
156     deps += [ "//third_party/mach_override" ]
157   }
158   if (is_win) {
159     deps += [
160       "//chrome_elf",
161       "//third_party/wtl",
162     ]
163   }
164   if (!is_android) {
165     sources +=
166         rebase_path(gypi_values.chrome_renderer_non_android_sources, ".", "..")
167   }
170 # In GYP this is part of test_support_common.
171 source_set("test_support") {
172   testonly = true
173   visibility = [ "//chrome/test:test_support" ]
175   sources = [
176     "chrome_mock_render_thread.cc",
177     "chrome_mock_render_thread.h",
178     "safe_browsing/mock_feature_extractor_clock.cc",
179     "safe_browsing/mock_feature_extractor_clock.h",
180     "safe_browsing/test_utils.cc",
181     "safe_browsing/test_utils.h",
182   ]
184   deps = [
185     ":renderer",
186     "//content/test:test_support",
187     "//testing/gmock",
188     "//testing/gtest",
189   ]
191   if (enable_print_preview) {
192     deps += [ "//chrome/service" ]
193   }
195   if (enable_webrtc) {
196     sources += [
197       "media/mock_webrtc_logging_message_filter.cc",
198       "media/mock_webrtc_logging_message_filter.h",
199     ]
200   }