Componentize ShortcutsBackend
[chromium-blink-merge.git] / chrome / renderer / BUILD.gn
blobf742adab8aa8acbd47ca1d37e65952057f97e211
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:mojo_bindings",
36     "//chrome/common/net",
37     "//chrome:resources",
38     "//chrome:strings",
39     "//components/autofill/content/renderer",
40     "//components/content_settings/content/common",
41     "//components/cdm/renderer",
42     "//components/data_reduction_proxy/content/common",
43     "//components/data_reduction_proxy/core/common",
44     "//components/error_page/renderer",
45     "//components/guest_view/renderer",
46     "//components/network_hints/renderer",
47     "//components/password_manager/content/renderer",
48     "//components/plugins/renderer",
49     "//components/printing/renderer:printing_renderer",
50     "//components/startup_metric_utils",
51     "//components/translate/content/renderer",
52     "//components/translate/core/common",
53     "//components/translate/core/language_detection",
54     "//components/visitedlink/renderer",
55     "//components/web_cache/renderer",
56     "//content/app/resources",
57     "//content/app/strings",
58     "//content/public/renderer",
59     "//net",
60     "//skia",
61     "//storage/common",
62     "//third_party/WebKit/public:blink",
63     "//third_party/WebKit/public:image_resources",
64     "//third_party/WebKit/public:resources",
65     "//third_party/icu",
66     "//third_party/re2",
67     "//third_party/widevine/cdm:version_h",
68     "//ui/surface",
69     "//v8:v8",
70   ]
72   if (enable_nacl) {
73     deps += [
74       "//components/nacl",
75       "//components/nacl:nacl_renderer",
76     ]
77   }
79   if (enable_plugins) {
80     sources +=
81         rebase_path(gypi_values.chrome_renderer_plugin_sources, ".", "..")
82     deps += [
83       "//components/pdf/renderer",
84       "//ppapi/host",
85       "//ppapi/proxy",
86       "//ppapi/proxy:ipc",
87       "//ppapi/shared_impl",
88     ]
89   }
91   if (safe_browsing_mode != 0) {
92     sources +=
93         rebase_path(gypi_values.chrome_renderer_basic_safe_browsing_sources,
94                     ".",
95                     "..")
96     if (safe_browsing_mode == 1) {
97       sources += rebase_path(gypi_values.chrome_renderer_safe_browsing_sources,
98                              ".",
99                              "..")
100       deps += [
101         "//chrome/common/safe_browsing:proto",
102         "//third_party/smhasher:murmurhash3",
103       ]
104     }
105   }
107   if (enable_extensions) {
108     sources +=
109         rebase_path(gypi_values.chrome_renderer_extensions_sources, ".", "..")
110     deps += [
111       # TODO(hclam): See crbug.com/298380 for details.
112       # We should isolate the APIs needed by the renderer.
113       "//chrome/common/extensions/api",
114       "//extensions:extensions_resources",
115       "//extensions/renderer",
116       "//media/cast:net",
117       "//media/cast:receiver",
118       "//media/cast:sender",
119       "//media/cast/logging/proto",
120     ]
121     if (!enable_webrtc) {
122       sources -= [
123         "media/cast_receiver_session.cc",
124         "media/cast_receiver_session.h",
125         "media/cast_rtp_stream.cc",
126         "media/cast_rtp_stream.h",
127       ]
128     }
129   }
130   if (enable_webrtc) {
131     sources +=
132         rebase_path(gypi_values.chrome_renderer_webrtc_sources, ".", "..")
133   }
134   if (enable_extensions && enable_webrtc) {
135     sources +=
136         rebase_path(gypi_values.chrome_renderer_webrtc_extensions_sources,
137                     ".",
138                     "..")
139   }
140   if (enable_spellcheck) {
141     sources +=
142         rebase_path(gypi_values.chrome_renderer_spellchecker_sources, ".", "..")
143     deps += [ "//third_party/hunspell" ]
144   }
146   if (enable_basic_printing || enable_print_preview) {
147     deps += [ "//printing" ]
148     sources +=
149         rebase_path(gypi_values.chrome_renderer_printing_sources, ".", "..")
150     if (enable_print_preview) {
151       sources += rebase_path(gypi_values.chrome_renderer_full_printing_sources,
152                              ".",
153                              "..")
154     }
155   }
157   if (is_mac) {
158     deps += [ "//third_party/mach_override" ]
159   }
160   if (is_win) {
161     deps += [
162       "//chrome_elf",
163       "//third_party/wtl",
164     ]
165   }
166   if (!is_android) {
167     sources +=
168         rebase_path(gypi_values.chrome_renderer_non_android_sources, ".", "..")
169   }
172 # In GYP this is part of test_support_common.
173 source_set("test_support") {
174   testonly = true
175   visibility = [ "//chrome/test:test_support" ]
177   sources = [
178     "chrome_mock_render_thread.cc",
179     "chrome_mock_render_thread.h",
180     "safe_browsing/mock_feature_extractor_clock.cc",
181     "safe_browsing/mock_feature_extractor_clock.h",
182     "safe_browsing/test_utils.cc",
183     "safe_browsing/test_utils.h",
184   ]
186   deps = [
187     ":renderer",
188     "//content/test:test_support",
189     "//testing/gmock",
190     "//testing/gtest",
191   ]
193   if (enable_print_preview) {
194     deps += [ "//chrome/service" ]
195   }
197   if (enable_webrtc) {
198     sources += [
199       "media/mock_webrtc_logging_message_filter.cc",
200       "media/mock_webrtc_logging_message_filter.h",
201     ]
202   }