cc: Make sure we don't insert or remove layers during painting
[chromium-blink-merge.git] / chrome / renderer / BUILD.gn
blob794934e5bda9c24351a4a3c712ea396f66491069
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/omnibox/common",
48     "//components/password_manager/content/renderer",
49     "//components/plugins/renderer",
50     "//components/printing/renderer:printing_renderer",
51     "//components/startup_metric_utils",
52     "//components/translate/content/renderer",
53     "//components/translate/core/common",
54     "//components/translate/core/language_detection",
55     "//components/visitedlink/renderer",
56     "//components/web_cache/renderer",
57     "//content/app/resources",
58     "//content/app/strings",
59     "//content/public/renderer",
60     "//net",
61     "//skia",
62     "//storage/common",
63     "//third_party/WebKit/public:blink",
64     "//third_party/WebKit/public:image_resources",
65     "//third_party/WebKit/public:resources",
66     "//third_party/icu",
67     "//third_party/re2",
68     "//third_party/widevine/cdm:version_h",
69     "//ui/surface",
70     "//v8:v8",
71   ]
73   if (enable_nacl) {
74     deps += [
75       "//components/nacl",
76       "//components/nacl:nacl_renderer",
77     ]
78   }
80   if (enable_plugins) {
81     sources +=
82         rebase_path(gypi_values.chrome_renderer_plugin_sources, ".", "..")
83     deps += [
84       "//components/pdf/renderer",
85       "//ppapi/host",
86       "//ppapi/proxy",
87       "//ppapi/proxy:ipc",
88       "//ppapi/shared_impl",
89     ]
90   }
92   if (safe_browsing_mode != 0) {
93     sources +=
94         rebase_path(gypi_values.chrome_renderer_basic_safe_browsing_sources,
95                     ".",
96                     "..")
97     if (safe_browsing_mode == 1) {
98       sources += rebase_path(gypi_values.chrome_renderer_safe_browsing_sources,
99                              ".",
100                              "..")
101       deps += [
102         "//chrome/common/safe_browsing:proto",
103         "//third_party/smhasher:murmurhash3",
104       ]
105     }
106   }
108   if (enable_extensions) {
109     sources +=
110         rebase_path(gypi_values.chrome_renderer_extensions_sources, ".", "..")
111     deps += [
112       # TODO(hclam): See crbug.com/298380 for details.
113       # We should isolate the APIs needed by the renderer.
114       "//chrome/common/extensions/api",
115       "//extensions:extensions_resources",
116       "//extensions/renderer",
117       "//media/cast:net",
118       "//media/cast:receiver",
119       "//media/cast:sender",
120       "//media/cast/logging/proto",
121     ]
122     if (!enable_webrtc) {
123       sources -= [
124         "media/cast_receiver_session.cc",
125         "media/cast_receiver_session.h",
126         "media/cast_rtp_stream.cc",
127         "media/cast_rtp_stream.h",
128       ]
129     }
130   }
131   if (enable_webrtc) {
132     sources +=
133         rebase_path(gypi_values.chrome_renderer_webrtc_sources, ".", "..")
134   }
135   if (enable_extensions && enable_webrtc) {
136     sources +=
137         rebase_path(gypi_values.chrome_renderer_webrtc_extensions_sources,
138                     ".",
139                     "..")
140   }
141   if (enable_spellcheck) {
142     sources +=
143         rebase_path(gypi_values.chrome_renderer_spellchecker_sources, ".", "..")
144     deps += [ "//third_party/hunspell" ]
145   }
147   if (enable_basic_printing || enable_print_preview) {
148     deps += [ "//printing" ]
149     sources +=
150         rebase_path(gypi_values.chrome_renderer_printing_sources, ".", "..")
151     if (enable_print_preview) {
152       sources += rebase_path(gypi_values.chrome_renderer_full_printing_sources,
153                              ".",
154                              "..")
155     }
156   }
158   if (is_mac) {
159     deps += [ "//third_party/mach_override" ]
160   }
161   if (is_win) {
162     deps += [ "//third_party/wtl" ]
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   }