Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / components / html_viewer / BUILD.gn
blob58747dccd5d6e25c2b5b168cb5a2fd8672f1c128
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/module_args/v8.gni")
6 import("//mojo/public/mojo_application.gni")
7 import("//testing/test.gni")
8 import("//tools/grit/grit_rule.gni")
9 import("//tools/grit/repack.gni")
11 if (is_android) {
12   import("//build/config/android/internal_rules.gni")
13   import("//mojo/generate_mojo_shell_assets_list.gni")
16 grit("html_viewer_resources_grit") {
17   source = "html_viewer_resources.grd"
18   outputs = [
19     "grit/html_viewer_resources.h",
20     "html_viewer_resources.pak",
21   ]
24 copy("copy_html_viewer_resources") {
25   sources = [
26     "$target_gen_dir/html_viewer_resources.pak",
27   ]
28   outputs = [
29     "$root_out_dir/html_viewer_resources.pak",
30   ]
32   public_deps = [
33     ":html_viewer_resources_grit",
34   ]
37 repack("pak") {
38   sources = [
39     "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
40     "$root_gen_dir/blink/public/resources/blink_resources.pak",
41     "$root_gen_dir/components/html_viewer/html_viewer_resources.pak",
42     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
43     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
44     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
45   ]
46   output = "$root_out_dir/html_viewer.pak"
47   deps = [
48     ":copy_html_viewer_resources",
49     "//third_party/WebKit/public:image_resources",
50     "//third_party/WebKit/public:resources",
51     "//ui/resources",
52     "//ui/strings",
53   ]
56 source_set("lib") {
57   sources = [
58     "ax_provider_impl.cc",
59     "ax_provider_impl.h",
60     "blink_basic_type_converters.cc",
61     "blink_basic_type_converters.h",
62     "blink_input_events_type_converters.cc",
63     "blink_input_events_type_converters.h",
64     "blink_platform_impl.cc",
65     "blink_platform_impl.h",
66     "blink_resource_constants.h",
67     "blink_text_input_type_converters.cc",
68     "blink_text_input_type_converters.h",
69     "blink_url_request_type_converters.cc",
70     "blink_url_request_type_converters.h",
71     "content_handler_impl.cc",
72     "content_handler_impl.h",
73     "devtools_agent_impl.cc",
74     "devtools_agent_impl.h",
75     "discardable_memory_allocator.cc",
76     "discardable_memory_allocator.h",
77     "document_resource_waiter.cc",
78     "document_resource_waiter.h",
79     "geolocation_client_impl.cc",
80     "geolocation_client_impl.h",
81     "global_state.cc",
82     "global_state.h",
83     "html_document_application_delegate.cc",
84     "html_document_application_delegate.h",
85     "html_document_oopif.cc",
86     "html_document_oopif.h",
87     "html_factory.h",
88     "html_frame.cc",
89     "html_frame.h",
90     "html_frame_delegate.h",
91     "html_frame_properties.cc",
92     "html_frame_properties.h",
93     "html_frame_tree_manager.cc",
94     "html_frame_tree_manager.h",
95     "html_viewer.cc",
96     "html_viewer.h",
97     "html_viewer_switches.cc",
98     "html_viewer_switches.h",
99     "html_widget.cc",
100     "html_widget.h",
101     "media_factory.cc",
102     "media_factory.h",
103     "mock_web_blob_registry_impl.cc",
104     "mock_web_blob_registry_impl.h",
105     "replicated_frame_state.cc",
106     "replicated_frame_state.h",
107     "stats_collection_controller.cc",
108     "stats_collection_controller.h",
109     "test_html_viewer_impl.cc",
110     "test_html_viewer_impl.h",
111     "touch_handler.cc",
112     "touch_handler.h",
113     "web_clipboard_impl.cc",
114     "web_clipboard_impl.h",
115     "web_cookie_jar_impl.cc",
116     "web_cookie_jar_impl.h",
117     "web_layer_impl.cc",
118     "web_layer_impl.h",
119     "web_layer_tree_view_impl.cc",
120     "web_layer_tree_view_impl.h",
121     "web_mime_registry_impl.cc",
122     "web_mime_registry_impl.h",
123     "web_notification_manager_impl.cc",
124     "web_notification_manager_impl.h",
125     "web_socket_handle_impl.cc",
126     "web_socket_handle_impl.h",
127     "web_storage_namespace_impl.cc",
128     "web_storage_namespace_impl.h",
129     "web_theme_engine_impl.cc",
130     "web_theme_engine_impl.h",
131     "web_url_loader_impl.cc",
132     "web_url_loader_impl.h",
133   ]
135   include_dirs = [ "third_party/WebKit" ]
137   deps = [
138     "//base",
139     "//base:i18n",
140     "//base/third_party/dynamic_annotations",
141     "//cc",
142     "//cc/blink",
143     "//cc/surfaces",
144     "//components/clipboard/public/interfaces",
145     "//components/devtools_service/public/interfaces",
146     "//components/html_viewer/public/interfaces",
147     "//components/message_port",
148     "//components/mime_util",
149     "//components/resource_provider/public/cpp",
150     "//components/resource_provider/public/interfaces",
151     "//components/scheduler:scheduler",
152     "//components/startup_metric_utils",
153     "//components/view_manager/gles2:lib",
154     "//components/view_manager/public/interfaces",
155     "//components/webcrypto",
156     "//gin",
157     "//mandoline/tab/public/interfaces",
158     "//media",
159     "//media/blink",
160     "//media/mojo",
161     "//mojo/application/public/cpp",
162     "//mojo/application/public/interfaces",
163     "//mojo/cc",
164     "//mojo/common",
165     "//mojo/converters/surfaces",
166     "//mojo/message_pump",
167     "//mojo/platform_handle",
168     "//mojo/services/network/public/cpp",
169     "//mojo/services/network/public/interfaces",
170     "//mojo/services/tracing/public/cpp",
171     "//mojo/services/tracing/public/interfaces",
172     "//net",
173     "//skia",
174     "//third_party/mojo_services/src/accessibility/public/interfaces",
175     "//third_party/WebKit/public:image_resources",
176     "//third_party/WebKit/public:resources",
177     "//ui/base:base",
178     "//ui/mojo/events:interfaces",
179     "//ui/events",
180     "//ui/events:gesture_detection",
181     "//ui/events/blink",
182     "//ui/events/gestures/blink",
183     "//ui/gfx",
184     "//ui/gfx/geometry",
185     "//ui/mojo/geometry:interfaces_cpp_sources",
186     "//ui/mojo/ime:interfaces_cpp_sources",
187     "//ui/mojo/init",
188     "//ui/native_theme",
189     "//url",
190   ]
192   public_deps = [
193     "//components/view_manager/public/cpp",
194     "//third_party/WebKit/public:blink",
195     "//third_party/mojo/src/mojo/public/cpp/bindings",
196   ]
198   if (is_win) {
199     sources += [ "html_viewer_version.rc" ]
200   }
202   if (is_linux && !is_android) {
203     deps += [ "//components/font_service/public/cpp" ]
204   }
206   data_deps = [
207     "//components/clipboard",
208     "//components/view_manager",
209     "//mojo/services/network:network",
210     "//mojo/services/tracing",
211   ]
214 mojo_native_application("html_viewer") {
215   sources = [
216     "html_viewer_main.cc",
217   ]
218   deps = [
219     ":lib",
220     ":pak",
221     "//mojo/application/public/cpp:sources",
222     "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
223   ]
224   resources = [ "$root_out_dir/html_viewer.pak" ]
226   if (v8_use_external_startup_data) {
227     resources += [
228       "$root_build_dir/natives_blob.bin",
229       "$root_build_dir/snapshot_blob.bin",
230     ]
231     deps += [ "//gin" ]
232   }
235 mojo_native_application("layout_test_html_viewer") {
236   testonly = true
237   sources = [
238     "layout_test_content_handler_impl.cc",
239     "layout_test_content_handler_impl.h",
240     "layout_test_html_viewer.cc",
241     "layout_test_html_viewer.h",
242     "layout_test_html_viewer_main.cc",
243     "web_test_delegate_impl.cc",
244     "web_test_delegate_impl.h",
245   ]
246   deps = [
247     ":lib",
248     ":pak",
249     "//cc",
250     "//components/test_runner",
251     "//mojo/application/public/cpp:sources",
252     "//third_party/WebKit/public:blink",
253     "//third_party/WebKit/public:test_support",
254     "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
255     "//ui/base",
256     "//url",
257   ]
258   resources = [ "$root_out_dir/html_viewer.pak" ]
260   if (v8_use_external_startup_data) {
261     resources += [
262       "$root_build_dir/natives_blob.bin",
263       "$root_build_dir/snapshot_blob.bin",
264     ]
265     deps += [ "//gin" ]
266   }
269 if (is_android) {
270   html_viewer_unittests_assets = "$root_build_dir/html_viewer_unittests_assets"
272   copy_ex("copy_unittest_assets") {
273     clear_dir = true
274     deps = [
275       ":pak",
276       "//gin",
277       "//third_party/icu:icudata",
278     ]
279     dest = html_viewer_unittests_assets
280     sources = [
281       "$root_build_dir/html_viewer.pak",
282       "$root_build_dir/icudtl.dat",
283       "$root_build_dir/natives_blob.bin",
284       "$root_build_dir/snapshot_blob.bin",
285     ]
286   }
288   generate_mojo_shell_assets_list("build_unittest_assets") {
289     deps = [
290       ":copy_unittest_assets",
291     ]
292     dir = html_viewer_unittests_assets
293   }
296 test("html_viewer_unittests") {
297   sources = [
298     "ax_provider_impl_unittest.cc",
299     "discardable_memory_allocator_unittest.cc",
300     "run_all_unittests.cc",
301   ]
302   deps = [
303     ":lib",
304     ":pak",
305     "//base/test:test_support",
306     "//components/scheduler",
307     "//gin",
308     "//testing/gtest:gtest",
309     "//third_party/mojo/src/mojo/edk/system",
310     "//ui/base",
311     "//ui/mojo/init",
312   ]
314   if (is_android) {
315     deps += [ ":build_unittest_assets" ]
316     apk_asset_location = html_viewer_unittests_assets
317   }
320 mojo_native_application("apptests") {
321   output_name = "html_viewer_apptests"
322   testonly = true
324   sources = [
325     "ax_provider_apptest.cc",
326     "html_frame_apptest.cc",
327   ]
329   deps = [
330     "//base",
331     "//components/html_viewer/public/interfaces",
332     "//components/scheduler",
333     "//components/view_manager/public/cpp",
334     "//components/view_manager/public/cpp/tests:test_support",
335     "//mandoline/tab:lib",
336     "//mandoline/tab:test_support",
337     "//mandoline/tab/public/interfaces",
338     "//mojo/application/public/cpp:sources",
339     "//mojo/application/public/cpp:test_support",
340     "//net:test_support",
341     "//testing/gtest",
342     "//third_party/mojo_services/src/accessibility/public/interfaces",
343     "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
344   ]
346   data_deps = [
347     ":html_viewer",
348     "//components/view_manager",
349   ]
351   if (is_linux && !is_android) {
352     data_deps += [ "//components/font_service" ]
353   }