Allow only one bookmark to be added for multiple fast starring
[chromium-blink-merge.git] / components / html_viewer / BUILD.gn
blob484b96fd47e47573cd8c8141bd55fae1ed64af6f
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     "html_viewer_resources.rc",
22   ]
25 copy("copy_html_viewer_resources") {
26   sources = [
27     "$target_gen_dir/html_viewer_resources.pak",
28   ]
29   outputs = [
30     "$root_out_dir/html_viewer_resources.pak",
31   ]
33   public_deps = [
34     ":html_viewer_resources_grit",
35   ]
38 repack("pak") {
39   sources = [
40     "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
41     "$root_gen_dir/blink/public/resources/blink_resources.pak",
42     "$root_gen_dir/components/html_viewer/html_viewer_resources.pak",
43     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
44     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
45     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
46   ]
47   output = "$root_out_dir/html_viewer.pak"
48   deps = [
49     ":copy_html_viewer_resources",
50     "//third_party/WebKit/public:image_resources",
51     "//third_party/WebKit/public:resources",
52     "//ui/resources",
53     "//ui/strings",
54   ]
57 source_set("lib") {
58   sources = [
59     "ax_provider_impl.cc",
60     "ax_provider_impl.h",
61     "blink_basic_type_converters.cc",
62     "blink_basic_type_converters.h",
63     "blink_input_events_type_converters.cc",
64     "blink_input_events_type_converters.h",
65     "blink_platform_impl.cc",
66     "blink_platform_impl.h",
67     "blink_resource_constants.h",
68     "blink_url_request_type_converters.cc",
69     "blink_url_request_type_converters.h",
70     "content_handler_impl.cc",
71     "content_handler_impl.h",
72     "devtools_agent_impl.cc",
73     "devtools_agent_impl.h",
74     "discardable_memory_allocator.cc",
75     "discardable_memory_allocator.h",
76     "document_resource_waiter.cc",
77     "document_resource_waiter.h",
78     "geolocation_client_impl.cc",
79     "geolocation_client_impl.h",
80     "global_state.cc",
81     "global_state.h",
82     "html_document.cc",
83     "html_document.h",
84     "html_document_application_delegate.cc",
85     "html_document_application_delegate.h",
86     "html_document_oopif.cc",
87     "html_document_oopif.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     "media_factory.cc",
100     "media_factory.h",
101     "mock_web_blob_registry_impl.cc",
102     "mock_web_blob_registry_impl.h",
103     "test_html_viewer_impl.cc",
104     "test_html_viewer_impl.h",
105     "touch_handler.cc",
106     "touch_handler.h",
107     "web_clipboard_impl.cc",
108     "web_clipboard_impl.h",
109     "web_cookie_jar_impl.cc",
110     "web_cookie_jar_impl.h",
111     "web_layer_impl.cc",
112     "web_layer_impl.h",
113     "web_layer_tree_view_impl.cc",
114     "web_layer_tree_view_impl.h",
115     "web_mime_registry_impl.cc",
116     "web_mime_registry_impl.h",
117     "web_notification_manager_impl.cc",
118     "web_notification_manager_impl.h",
119     "web_socket_handle_impl.cc",
120     "web_socket_handle_impl.h",
121     "web_storage_namespace_impl.cc",
122     "web_storage_namespace_impl.h",
123     "web_theme_engine_impl.cc",
124     "web_theme_engine_impl.h",
125     "web_url_loader_impl.cc",
126     "web_url_loader_impl.h",
127   ]
129   include_dirs = [ "third_party/WebKit" ]
131   deps = [
132     "//base",
133     "//base/third_party/dynamic_annotations",
134     "//cc",
135     "//cc/blink",
136     "//cc/surfaces",
137     "//components/clipboard/public/interfaces",
138     "//components/devtools_service/public/cpp",
139     "//components/devtools_service/public/interfaces",
140     "//components/html_viewer/public/interfaces",
141     "//components/message_port",
142     "//components/mime_util",
143     "//components/resource_provider/public/cpp",
144     "//components/resource_provider/public/interfaces",
145     "//components/scheduler:scheduler",
146     "//components/view_manager/gles2:lib",
147     "//components/view_manager/public/interfaces",
148     "//components/webcrypto",
149     "//gin",
150     "//mandoline/services/navigation/public/interfaces",
151     "//mandoline/tab/public/interfaces",
152     "//media",
153     "//media/blink",
154     "//media/mojo",
155     "//mojo/application/public/cpp",
156     "//mojo/cc",
157     "//mojo/common",
158     "//mojo/converters/surfaces",
159     "//mojo/platform_handle",
160     "//mojo/services/network/public/cpp",
161     "//mojo/services/network/public/interfaces",
162     "//net",
163     "//skia",
164     "//third_party/mojo_services/src/accessibility/public/interfaces",
165     "//ui/mojo/events:interfaces",
166     "//ui/events",
167     "//ui/events:gesture_detection",
168     "//ui/events/blink",
169     "//ui/events/gestures/blink",
170     "//ui/gfx",
171     "//ui/gfx/geometry",
172     "//ui/mojo/init",
173     "//ui/native_theme",
174     "//url",
175   ]
177   public_deps = [
178     "//components/view_manager/public/cpp",
179     "//third_party/WebKit/public:blink",
180     "//third_party/mojo/src/mojo/public/cpp/bindings",
181   ]
183   if (is_win) {
184     sources += [ "html_viewer_version.rc" ]
185   }
187   data_deps = [
188     "//components/clipboard",
189     "//components/view_manager",
190     "//mojo/services/network:network",
191   ]
194 mojo_native_application("html_viewer") {
195   sources = [
196     "html_viewer_main.cc",
197   ]
198   deps = [
199     ":lib",
200     ":pak",
201     "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
202   ]
203   resources = [ "$root_out_dir/html_viewer.pak" ]
205   if (v8_use_external_startup_data) {
206     resources += [
207       "$root_build_dir/natives_blob.bin",
208       "$root_build_dir/snapshot_blob.bin",
209     ]
210     deps += [ "//gin" ]
211   }
214 mojo_native_application("layout_test_html_viewer") {
215   testonly = true
216   sources = [
217     "layout_test_content_handler_impl.cc",
218     "layout_test_content_handler_impl.h",
219     "layout_test_html_viewer.cc",
220     "layout_test_html_viewer.h",
221     "layout_test_html_viewer_main.cc",
222     "web_test_delegate_impl.cc",
223     "web_test_delegate_impl.h",
224   ]
225   deps = [
226     ":lib",
227     ":pak",
228     "//components/test_runner",
229     "//third_party/WebKit/public:blink",
230     "//third_party/WebKit/public:test_support",
231     "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
232     "//url",
233   ]
234   resources = [ "$root_out_dir/html_viewer.pak" ]
236   if (v8_use_external_startup_data) {
237     resources += [
238       "$root_build_dir/natives_blob.bin",
239       "$root_build_dir/snapshot_blob.bin",
240     ]
241     deps += [ "//gin" ]
242   }
245 if (is_android) {
246   html_viewer_unittests_assets = "$root_build_dir/html_viewer_unittests_assets"
248   copy_ex("copy_unittest_assets") {
249     clear_dir = true
250     deps = [
251       ":pak",
252       "//gin",
253       "//third_party/icu:icudata",
254     ]
255     dest = html_viewer_unittests_assets
256     sources = [
257       "$root_build_dir/html_viewer.pak",
258       "$root_build_dir/icudtl.dat",
259       "$root_build_dir/natives_blob.bin",
260       "$root_build_dir/snapshot_blob.bin",
261     ]
262   }
264   generate_mojo_shell_assets_list("build_unittest_assets") {
265     deps = [
266       ":copy_unittest_assets",
267     ]
268     dir = html_viewer_unittests_assets
269   }
272 test("html_viewer_unittests") {
273   sources = [
274     "ax_provider_impl_unittest.cc",
275     "discardable_memory_allocator_unittest.cc",
276     "run_all_unittests.cc",
277   ]
278   deps = [
279     ":lib",
280     ":pak",
281     "//base/test:test_support",
282     "//third_party/mojo/src/mojo/edk/system",
283     "//ui/mojo/init",
284   ]
286   if (is_android) {
287     deps += [ ":build_unittest_assets" ]
288     apk_asset_location = html_viewer_unittests_assets
289   }
292 mojo_native_application("apptests") {
293   output_name = "html_viewer_apptests"
294   testonly = true
296   sources = [
297     "ax_provider_apptest.cc",
298     "html_frame_apptest.cc",
299   ]
301   deps = [
302     "//base",
303     "//components/html_viewer/public/interfaces",
304     "//components/view_manager/public/cpp/tests:test_support",
305     "//mandoline/tab",
306     "//mandoline/tab/public/interfaces",
307     "//mojo/application/public/cpp:test_support",
308     "//net:test_support",
309     "//testing/gtest",
310     "//third_party/mojo_services/src/accessibility/public/interfaces",
311     "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
312   ]
314   data_deps = [
315     ":html_viewer",
316     "//components/view_manager",
317   ]