Clean up extension confirmation prompts and make them consistent between Views and...
[chromium-blink-merge.git] / components / html_viewer / BUILD.gn
bloba6b31350619b01a716ed8bb43f4ef4ae86a6194f
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/mojo_application_package.gni")
7 import("//mojo/public/mojo_application.gni")
8 import("//testing/test.gni")
9 import("//tools/grit/grit_rule.gni")
10 import("//tools/grit/repack.gni")
12 # Repack this here.
13 repack("unified_blink_resources") {
14   sources = [
15     "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
16     "$root_gen_dir/blink/public/resources/blink_resources.pak",
17   ]
18   output = "$target_gen_dir/unified_blink_resources.pak"
19   deps = [
20     "//third_party/WebKit/public:image_resources",
21     "//third_party/WebKit/public:resources",
22   ]
25 action("generate_blink_resource_map") {
26   script = "//components/html_viewer/generate_blink_resource_map.py"
27   args = [
28     "--pak-file",
29     rebase_path("$target_gen_dir/unified_blink_resources.pak"),
30     "--header",
31     rebase_path("$target_gen_dir/blink_resource_map.h"),
32     "--cpp",
33     rebase_path("$target_gen_dir/blink_resource_map.cc"),
34   ]
35   outputs = [
36     "$target_gen_dir/blink_resource_map.cc",
37     "$target_gen_dir/blink_resource_map.h",
38   ]
39   deps = [
40     ":unified_blink_resources",
41   ]
42   public_deps = [
43     "//third_party/WebKit/public:image_resources",
44     "//third_party/WebKit/public:resources",
45   ]
48 grit("html_viewer_resources_grit") {
49   source = "html_viewer_resources.grd"
50   outputs = [
51     "grit/html_viewer_resources.h",
52     "html_viewer_resources.pak",
53     "html_viewer_resources.rc",
54   ]
56 source_set("lib") {
57   sources = [
58     "$target_gen_dir/blink_resource_map.cc",
59     "$target_gen_dir/blink_resource_map.h",
60     "ax_provider_impl.cc",
61     "ax_provider_impl.h",
62     "blink_basic_type_converters.cc",
63     "blink_basic_type_converters.h",
64     "blink_input_events_type_converters.cc",
65     "blink_input_events_type_converters.h",
66     "blink_platform_impl.cc",
67     "blink_platform_impl.h",
68     "blink_resource_constants.h",
69     "blink_url_request_type_converters.cc",
70     "blink_url_request_type_converters.h",
71     "devtools_agent_impl.cc",
72     "devtools_agent_impl.h",
73     "discardable_memory_allocator.cc",
74     "discardable_memory_allocator.h",
75     "frame_tree_manager.cc",
76     "frame_tree_manager.h",
77     "html_document.cc",
78     "html_document.h",
79     "media_factory.cc",
80     "media_factory.h",
81     "mock_web_blob_registry_impl.cc",
82     "mock_web_blob_registry_impl.h",
83     "setup.cc",
84     "setup.h",
85     "touch_handler.cc",
86     "touch_handler.h",
87     "web_clipboard_impl.cc",
88     "web_clipboard_impl.h",
89     "web_cookie_jar_impl.cc",
90     "web_cookie_jar_impl.h",
91     "web_layer_tree_view_impl.cc",
92     "web_layer_tree_view_impl.h",
93     "web_message_port_channel_impl.cc",
94     "web_message_port_channel_impl.h",
95     "web_mime_registry_impl.cc",
96     "web_mime_registry_impl.h",
97     "web_notification_manager_impl.cc",
98     "web_notification_manager_impl.h",
99     "web_socket_handle_impl.cc",
100     "web_socket_handle_impl.h",
101     "web_storage_namespace_impl.cc",
102     "web_storage_namespace_impl.h",
103     "web_theme_engine_impl.cc",
104     "web_theme_engine_impl.h",
105     "web_url_loader_impl.cc",
106     "web_url_loader_impl.h",
107   ]
109   include_dirs = [ "third_party/WebKit" ]
111   deps = [
112     "//base",
113     "//base/third_party/dynamic_annotations",
114     "//cc",
115     "//cc/blink",
116     "//cc/surfaces",
117     "//components/clipboard/public/interfaces",
118     "//components/devtools_service/public/cpp",
119     "//components/devtools_service/public/interfaces",
120     "//components/mime_util",
121     "//components/resource_provider/public/cpp",
122     "//components/resource_provider/public/interfaces",
123     "//components/scheduler:scheduler",
124     "//components/view_manager/public/interfaces",
125     "//components/webcrypto",
126     "//gin",
127     "//mandoline/services/navigation/public/interfaces",
128     "//mandoline/tab/public/interfaces",
129     "//media",
130     "//media/blink",
131     "//media/mojo",
132     "//mojo/application/public/cpp",
133     "//mojo/cc",
134     "//mojo/converters/surfaces",
135     "//mojo/services/network/public/cpp",
136     "//mojo/services/network/public/interfaces",
137     "//net",
138     "//skia",
139     "//third_party/mojo_services/src/accessibility/public/interfaces",
140     "//ui/mojo/events:interfaces",
141     "//ui/events",
142     "//ui/events:gesture_detection",
143     "//ui/events/blink",
144     "//ui/events/gestures/blink",
145     "//ui/gfx",
146     "//ui/gfx/geometry",
147     "//ui/native_theme",
149     # TODO(sky): we shouldn't be using ui_test_pak.
150     "//ui/resources:ui_test_pak",
151     "//url",
152   ]
154   public_deps = [
155     "//components/view_manager/public/cpp",
156     "//third_party/WebKit/public:blink",
157     "//third_party/mojo/src/mojo/public/cpp/bindings",
158     ":generate_blink_resource_map",
159   ]
161   if (is_win) {
162     sources += [ "html_viewer_version.rc" ]
163   }
165   data_deps = [
166     "//components/clipboard",
167     "//components/view_manager",
168   ]
171 mojo_application_package("html_viewer") {
172   sources = [
173     "html_viewer.cc",
174     "ui_setup.h",
175     "ui_setup_android.cc",
176     "ui_setup_android.h",
177   ]
178   deps = [
179     ":html_viewer_resources_grit",
180     ":lib",
181     "//mojo/common",
182     "//mojo/platform_handle",
183     "//third_party/icu:icudata",
184     "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
185     "//ui/resources:ui_test_pak",
186   ]
187   data_deps = [ "//mojo/services/network:network" ]
188   resources = [
189     "$root_out_dir/icudtl.dat",
190     "$root_out_dir/ui_test.pak",
191     "$target_gen_dir/html_viewer_resources.pak",
192   ]
194   if (v8_use_external_startup_data) {
195     resources += [
196       "$root_build_dir/natives_blob.bin",
197       "$root_build_dir/snapshot_blob.bin",
198     ]
199     deps += [ "//gin" ]
200   }
203 test("tests") {
204   output_name = "html_viewer_unittests"
205   sources = [
206     "ax_provider_impl_unittest.cc",
207     "discardable_memory_allocator_unittest.cc",
208     "run_all_unittests.cc",
209   ]
210   deps = [
211     ":lib",
212     "//base/test:test_support",
213     "//third_party/mojo/src/mojo/edk/system",
214   ]
217 mojo_native_application("apptests") {
218   output_name = "html_viewer_apptests"
219   testonly = true
221   sources = [
222     "ax_provider_apptest.cc",
223   ]
225   deps = [
226     "//base",
227     "//mojo/application/public/cpp:test_support",
228     "//net:test_support",
229     "//testing/gtest",
230     "//third_party/mojo_services/src/accessibility/public/interfaces",
231     "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
232   ]
234   data_deps = [ ":html_viewer" ]