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