Stop early exit watcher in BrowserChildProcessHostImpl::OnChildDisconnected
[chromium-blink-merge.git] / ash / BUILD.gn
blobf7d0bebd2c017b0e6b1dc7ea1f5b022fb8dab615
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("//build/config/ui.gni")
8 gypi_values = exec_script(
9     "//build/gypi_to_gn.py",
10     [ rebase_path("ash.gyp") ],
11     "scope",
12     [ "ash.gyp" ])
14 component("ash") {
15   sources = gypi_values.ash_sources
17   defines = [ "ASH_IMPLEMENTATION" ]
19   public_deps = [
20     "//ash/resources",
21     "//ash/strings",
22   ]
23   deps = [
24     "//base",
25     "//base:i18n",
26     "//base/third_party/dynamic_annotations",
27     "//cc",
28     "//components/user_manager",
29     "//content/public/browser",
30     "//media",
31     "//net",
32     "//skia",
33     "//third_party/icu",
34     "//ui/accelerometer",
35     "//ui/accessibility",
36     "//ui/app_list",
37     "//ui/aura",
38     "//ui/base",
39     "//ui/compositor",
40     "//ui/events",
41     "//ui/events:events_base",
42     "//ui/gfx",
43     "//ui/gfx/geometry",
44     "//ui/keyboard",
45     "//ui/message_center",
46     "//ui/resources",
47     "//ui/strings",
48     "//ui/views",
49     "//ui/views/controls/webview",
50     "//ui/web_dialogs",
51     "//ui/wm",
52     "//url",
53   ]
55   if (is_win) {
56     sources -= [
57       "sticky_keys/sticky_keys_controller.cc",
58       "sticky_keys/sticky_keys_controller.h",
59     ]
60     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
61     cflags = [ "/wd4267" ]
62   }
64   if (use_x11) {
65     configs += [
66       "//build/config/linux:xfixes",
67     ]
68   } else {
69     sources -= [
70       "accelerators/key_hold_detector.cc",
71       "accelerators/key_hold_detector.h",
72       "accelerators/magnifier_key_scroller.cc",
73       "accelerators/magnifier_key_scroller.h",
74       "accelerators/spoken_feedback_toggler.cc",
75       "accelerators/spoken_feedback_toggler.h",
76     ]
77   }
79   if (is_chromeos) {
80     deps += [
81       "//device/bluetooth",
82       "//ui/display",
83       "//ui/display/util",
84       "//chromeos",
85       "//chromeos:power_manager_proto",
86       "//ui/chromeos/resources",
87       "//ui/chromeos/strings",
88       "//ui/chromeos:ui_chromeos",
89     ]
90   } else {
91     sources -= [
92       "display/display_configurator_animation.cc",
93       "display/display_configurator_animation.h",
94       "display/resolution_notification_controller.cc",
95       "display/resolution_notification_controller.h",
96       "system/tray/media_security/media_capture_observer.h",
97       "system/tray/media_security/multi_profile_media_tray_item.cc",
98       "system/tray/media_security/multi_profile_media_tray_item.h",
99     ]
100   }
102   if (!use_x11 || !is_chromeos) {
103     sources -= [
104       "touch/touch_transformer_controller.cc",
105       "touch/touch_transformer_controller.h",
106       "touch/touchscreen_util.cc",
107       "touch/touchscreen_util.h",
108     ]
109   }
111   if (!use_ozone) {
112     sources -= [
113       "host/ash_window_tree_host_ozone.cc",
114     ]
115   }
118 component("ash_with_content") {
119   sources = [
120     "content_support/ash_with_content_export.h",
121     "content_support/gpu_support_impl.cc",
122     "content_support/gpu_support_impl.h",
123     "screensaver/screensaver_view.cc",
124     "screensaver/screensaver_view.h",
125     "keyboard_overlay/keyboard_overlay_delegate.cc",
126     "keyboard_overlay/keyboard_overlay_delegate.h",
127     "keyboard_overlay/keyboard_overlay_view.cc",
128     "keyboard_overlay/keyboard_overlay_view.h",
129   ]
131   defines = [ "ASH_WITH_CONTENT_IMPLEMENTATION" ]
133   public_deps = [
134     ":ash",
135   ]
136   deps = [
137     "//base",
138     "//base/third_party/dynamic_annotations",
139     "//content/public/browser",
140     "//ipc",
141     "//skia",
142     "//ui/aura",
143     "//ui/base",
144     "//ui/compositor",
145     "//ui/events",
146     "//ui/gfx",
147     "//ui/gfx/geometry",
148     "//ui/resources",
149     "//ui/strings",
150     "//ui/views",
151     "//ui/views/controls/webview",
152     "//ui/web_dialogs",
153     "//url",
154   ]
157 static_library("test_support") {
158   testonly = true
159   sources = gypi_values.ash_test_support_sources
161   public_deps = [
162     ":ash",
163   ]
164   deps = [
165     "//ash/resources",
166     "//content/test:test_support",
167     "//skia",
168     "//testing/gtest",
169     "//ui/accessibility",
170     "//ui/app_list",
171     "//ui/app_list:test_support",
172     "//ui/events:events_base",
173     "//ui/gl",
174     "//ui/views",
175     "//ui/views:test_support",
176   ]
178   if (is_win) {
179     sources += [
180       "test/test_metro_viewer_process_host.cc",
181       "test/test_metro_viewer_process_host.h",
182     ]
183     deps += [
184       "//ipc",
185       #'../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages',  TODO(GYP)
186       #'../win8/win8.gyp:metro_viewer',  TODO(GYP)
187       #'../win8/win8.gyp:test_support_win8',  TODO(GYP)
188       #'../win8/win8_tests.gyp:test_registrar',  TODO(GYP)
189     ]
190   }
193 static_library("ash_shell_lib") {
194   testonly = true
195   sources = gypi_values.ash_shell_lib_sources
197   deps = [
198     ":ash",
199     ":ash_with_content",
200     ":test_support",
201     "//ash/resources",
202     "//ash/strings",
203     "//base",
204     "//base:i18n",
205     #"//chrome:packed_resources",  TODO(GYP)
206     "//content",
207     "//content/shell:content_shell_lib",
208     "//net",
209     "//skia",
210     "//third_party/icu",
211     "//ui/app_list",
212     "//ui/aura",
213     "//ui/base",
214     "//ui/compositor",
215     "//ui/events",
216     "//ui/events:events_base",
217     "//ui/gfx",
218     "//ui/gfx/geometry",
219     "//ui/keyboard",
220     "//ui/message_center",
221     "//ui/resources",
222     "//ui/views",
223     "//ui/views:test_support",
224     "//ui/views/examples:views_examples_lib",
225     "//ui/views/examples:views_examples_with_content_lib",
226   ]
229 test("ash_unittests") {
230   sources = gypi_values.ash_unittests_sources
232   deps = [
233     ":ash",
234     ":ash_with_content",
235     ":test_support",
236     "//ash/resources",
237     "//ash/strings",
238     "//base",
239     "//base/allocator",
240     "//base/test:test_support",
241     "//components/user_manager",
242     "//content/public/browser",
243     "//content/test:test_support",
244     "//skia",
245     "//testing/gtest",
246     "//third_party/icu",
247     "//ui/accelerometer",
248     "//ui/accessibility",
249     "//ui/aura",
250     "//ui/aura:test_support",
251     "//ui/base",
252     "//ui/base:test_support",
253     "//ui/compositor",
254     "//ui/compositor:test_support",
255     "//ui/events",
256     "//ui/events:test_support",
257     "//ui/events:gesture_detection",
258     "//ui/gfx",
259     "//ui/gfx/geometry",
260     "//ui/keyboard",
261     "//ui/message_center",
262     "//ui/message_center:test_support",
263     "//ui/resources",
264     "//ui/views",
265     "//ui/views:test_support",
266     "//ui/views/controls/webview:test_support",
267     "//ui/web_dialogs:test_support",
268     "//ui/wm",
269     "//url",
270   ]
272   if (!is_chromeos) {
273     sources -= [
274       # TODO(zork): fix this test to build on Windows. See: crosbug.com/26906
275       "focus_cycler_unittest.cc",
276       # All tests for multiple displays: not supported on Windows Ash.
277       "wm/drag_window_resizer_unittest.cc",
278       # Can't resize on Windows Ash. http://crbug.com/165962
279       "magnifier/magnification_controller_unittest.cc",
280       "wm/workspace/workspace_window_resizer_unittest.cc",
281       "sticky_keys/sticky_keys_overlay_unittest.cc",
282       "system/tray/media_security/multi_profile_media_tray_item_unittest.cc",
283       "autoclick/autoclick_unittest.cc",
284     ]
285     sources += [
286       #'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc',  TODO(GYP)
287     ]
288   }
290   if (is_win) {
291     cflags = [ "/wd4267" ]
292   }
294   if (!use_x11) {
295     sources -= [
296       "accelerators/magnifier_key_scroller_unittest.cc",
297       "accelerators/spoken_feedback_toggler_unittest.cc",
298     ]
299   }
300   if (is_chromeos) {
301     sources += [ "first_run/first_run_helper_unittest.cc" ]
302     deps += [
303       "//device/bluetooth",
304       "//ui/display",
305       "//ui/display:test_util",
306       "//ui/display/types",
307       "//chromeos:power_manager_proto",
308       "//chromeos:test_support_without_gmock",
309     ]
310   } else {
311     sources -= [
312       "display/resolution_notification_controller_unittest.cc",
313       "touch/touchscreen_util_unittest.cc",
314     ]
315   }
317   if (!use_x11 || !is_chromeos) {
318     sources -= [ "touch/touch_transformer_controller_unittest.cc", ]
319   }
321   # TODO(GYP) is this necessary?
322   #['OS=="linux" and component=="shared_library" and use_allocator!="none"', {
323   # ldflags = "-rdynamic"
325   if (!is_chromeos || use_ozone) {
326     sources -= [
327       "sticky_keys/sticky_keys_unittest.cc",  # crbug.com/354035
328     ]
329   }
332 executable("ash_shell") {
333   testonly = true
334   sources = [
335     "shell/shell_main.cc",
336   ]
338   deps = [
339     ":ash_shell_lib",
340     "//components/user_manager",
341   ]
343   if (is_win) {
344     configs -= [ "//build/config/win:console" ]
345     configs += [ "//build/config/win:windowed" ]
346     deps += [
347       "//sandbox",
348     ]
349   }
351   if (is_chromeos) {
352     deps += [
353       "//device/bluetooth",
354     ]
355   }
358 test("ash_shell_unittests") {
359   sources = [
360     "shell/window_watcher_unittest.cc",
361     "test/ash_unittests.cc",
362   ]
364   deps = [
365     ":ash_shell_lib",
366     ":test_support",
367     "//base/test:test_support",
368     "//components/user_manager",
369     "//content/test:test_support",
370     "//skia",
371     "//testing/gtest",
372     "//ui/accessibility",
373   ]
375   if (is_chromeos) {
376     deps += [ "//ui/display" ]
377   }