Don't add an aura tooltip to bubble close buttons on Windows.
[chromium-blink-merge.git] / ash / BUILD.gn
blob0eae612c1ea4156694321cf1f48b899117e22e9b
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")
7 import("//testing/test.gni")
9 gypi_values = exec_script("//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/device_event_log",
29     "//components/user_manager",
30     "//components/wallpaper",
31     "//content/public/browser",
32     "//media",
33     "//net",
34     "//skia",
35     "//third_party/icu",
36     "//ui/accessibility",
37     "//ui/app_list",
38     "//ui/aura",
39     "//ui/base",
40     "//ui/base/ime",
41     "//ui/compositor",
42     "//ui/events",
43     "//ui/events:events_base",
44     "//ui/events:gesture_detection",
45     "//ui/events/devices",
46     "//ui/gfx",
47     "//ui/gfx/geometry",
48     "//ui/keyboard",
49     "//ui/message_center",
50     "//ui/resources",
51     "//ui/strings",
52     "//ui/views",
53     "//ui/views/controls/webview",
54     "//ui/web_dialogs",
55     "//ui/wm",
56     "//url",
57   ]
59   if (is_win) {
60     sources -= [
61       "sticky_keys/sticky_keys_controller.cc",
62       "sticky_keys/sticky_keys_controller.h",
63     ]
65     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
66     configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
67   }
69   if (use_x11) {
70     configs += [
71       "//build/config/linux:x11",
72       "//build/config/linux:xfixes",
73     ]
74     deps += [
75       "//ui/events/platform",
76       "//ui/gfx/x",
77     ]
78   } else {
79     sources -= [
80       "host/ash_window_tree_host_x11.cc",
81       "host/ash_window_tree_host_x11.h",
82       "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc",
83       "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h",
84     ]
85   }
87   if (use_ozone) {
88     deps += [
89       "//ui/events/ozone:events_ozone",
90       "//ui/ozone",
91     ]
92   }
94   if (is_chromeos) {
95     deps += [
96       "//device/bluetooth",
97       "//ui/display",
98       "//ui/display/util",
99       "//chromeos",
100       "//chromeos:power_manager_proto",
101       "//ui/chromeos/resources",
102       "//ui/chromeos/strings",
103       "//ui/chromeos:ui_chromeos",
104     ]
105   } else {
106     sources -= [
107       "accelerators/key_hold_detector.cc",
108       "accelerators/key_hold_detector.h",
109       "accelerators/magnifier_key_scroller.cc",
110       "accelerators/magnifier_key_scroller.h",
111       "accelerators/spoken_feedback_toggler.cc",
112       "accelerators/spoken_feedback_toggler.h",
113       "display/display_configurator_animation.cc",
114       "display/display_configurator_animation.h",
115       "display/resolution_notification_controller.cc",
116       "display/resolution_notification_controller.h",
117       "system/tray/media_security/media_capture_observer.h",
118       "system/tray/media_security/multi_profile_media_tray_item.cc",
119       "system/tray/media_security/multi_profile_media_tray_item.h",
120       "touch/touch_transformer_controller.cc",
121       "touch/touch_transformer_controller.h",
122       "touch/touchscreen_util.cc",
123       "touch/touchscreen_util.h",
124       "virtual_keyboard_controller.cc",
125       "virtual_keyboard_controller.h",
126     ]
127   }
129   if (!use_ozone) {
130     sources -= [
131       "host/ash_window_tree_host_ozone.cc",
132       "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.cc",
133       "wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_ozone.h",
134     ]
135   }
138 component("ash_with_content") {
139   sources = [
140     "content_support/ash_with_content_export.h",
141     "content_support/gpu_support_impl.cc",
142     "content_support/gpu_support_impl.h",
143     "keyboard_overlay/keyboard_overlay_delegate.cc",
144     "keyboard_overlay/keyboard_overlay_delegate.h",
145     "keyboard_overlay/keyboard_overlay_view.cc",
146     "keyboard_overlay/keyboard_overlay_view.h",
147   ]
149   defines = [ "ASH_WITH_CONTENT_IMPLEMENTATION" ]
151   public_deps = [
152     ":ash",
153   ]
154   deps = [
155     "//base",
156     "//base/third_party/dynamic_annotations",
157     "//content/public/browser",
158     "//ipc",
159     "//skia",
160     "//ui/aura",
161     "//ui/base",
162     "//ui/compositor",
163     "//ui/events",
164     "//ui/gfx",
165     "//ui/gfx/geometry",
166     "//ui/resources",
167     "//ui/strings",
168     "//ui/views",
169     "//ui/views/controls/webview",
170     "//ui/web_dialogs",
171     "//url",
172   ]
175 static_library("test_support") {
176   testonly = true
177   sources = gypi_values.ash_test_support_sources
179   public_deps = [
180     ":ash",
181   ]
182   deps = [
183     "//ash/resources",
184     "//content/test:test_support",
185     "//skia",
186     "//testing/gtest",
187     "//ui/accessibility",
188     "//ui/app_list",
189     "//ui/app_list:test_support",
190     "//ui/events:events_base",
191     "//ui/events/devices",
192     "//ui/gl",
193     "//ui/views",
194     "//ui/views:test_support",
195   ]
197   if (is_win) {
198     sources += [
199       "test/test_metro_viewer_process_host.cc",
200       "test/test_metro_viewer_process_host.h",
201     ]
202     deps += [
203       "//ipc",
204       "//ui/metro_viewer",
205       "//win8:metro_viewer",
206       "//win8:test_support_win8",
207       "//win8:test_registrar",
208     ]
209   }
212 static_library("ash_shell_lib") {
213   testonly = true
214   sources = gypi_values.ash_shell_lib_sources
216   deps = [
217     ":ash",
218     ":ash_with_content",
219     ":test_support",
220     "//ash/resources",
221     "//ash/strings",
222     "//base",
223     "//base:i18n",
225     #"//chrome:packed_resources",  TODO(GYP)
226     "//content",
227     "//content/shell:content_shell_lib",
228     "//net",
229     "//skia",
230     "//third_party/icu",
231     "//ui/app_list",
232     "//ui/aura",
233     "//ui/base",
234     "//ui/base/ime",
235     "//ui/compositor",
236     "//ui/events",
237     "//ui/events:events_base",
238     "//ui/gfx",
239     "//ui/gfx/geometry",
240     "//ui/keyboard",
241     "//ui/message_center",
242     "//ui/resources",
243     "//ui/views",
244     "//ui/views:test_support",
245     "//ui/views/examples:views_examples_lib",
246     "//ui/views/examples:views_examples_with_content_lib",
247   ]
250 test("ash_unittests") {
251   sources = gypi_values.ash_unittests_sources
253   deps = [
254     ":ash",
255     ":ash_with_content",
256     ":test_support",
257     "//ash/resources",
258     "//ash/strings",
259     "//base",
260     "//base/allocator",
261     "//base/test:test_support",
262     "//components/user_manager",
263     "//content/public/browser",
264     "//content/test:test_support",
265     "//skia",
266     "//testing/gtest",
267     "//third_party/icu",
268     "//ui/accessibility",
269     "//ui/aura",
270     "//ui/aura:test_support",
271     "//ui/base",
272     "//ui/base/ime",
273     "//ui/base:test_support",
274     "//ui/compositor",
275     "//ui/compositor:test_support",
276     "//ui/events",
277     "//ui/events/devices",
278     "//ui/events:test_support",
279     "//ui/events:gesture_detection",
280     "//ui/gfx",
281     "//ui/gfx/geometry",
282     "//ui/keyboard",
283     "//ui/message_center",
284     "//ui/message_center:test_support",
285     "//ui/resources",
286     "//ui/views",
287     "//ui/views:test_support",
288     "//ui/views/controls/webview:test_support",
289     "//ui/web_dialogs:test_support",
290     "//ui/wm",
291     "//url",
292   ]
294   if (!is_chromeos) {
295     sources -= [
296       # TODO(zork): fix this test to build on Windows. See: crosbug.com/26906
297       "focus_cycler_unittest.cc",
299       # All tests for multiple displays: not supported on Windows Ash.
300       "wm/drag_window_resizer_unittest.cc",
302       # Accelerometer is only available on Chrome OS.
303       "wm/maximize_mode/maximize_mode_controller_unittest.cc",
305       # Can't resize on Windows Ash. http://crbug.com/165962
306       "autoclick/autoclick_unittest.cc",
307       "magnifier/magnification_controller_unittest.cc",
308       "sticky_keys/sticky_keys_overlay_unittest.cc",
309       "system/tray/media_security/multi_profile_media_tray_item_unittest.cc",
310       "virtual_keyboard_controller_unittest.cc",
311       "wm/workspace/workspace_window_resizer_unittest.cc",
312     ]
313     sources += [
314       #'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc',  TODO(GYP)
315     ]
316   }
318   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
320   if (!use_x11) {
321     sources -= [ "host/ash_window_tree_host_x11_unittest.cc" ]
322   }
323   if (is_chromeos) {
324     sources += [ "first_run/first_run_helper_unittest.cc" ]
325     deps += [
326       "//device/bluetooth",
327       "//ui/display",
328       "//ui/display:test_util",
329       "//ui/display/types",
330       "//chromeos:power_manager_proto",
331       "//chromeos:test_support_without_gmock",
332     ]
333   } else {
334     sources -= [
335       "accelerators/magnifier_key_scroller_unittest.cc",
336       "accelerators/spoken_feedback_toggler_unittest.cc",
337       "display/resolution_notification_controller_unittest.cc",
338       "touch/touchscreen_util_unittest.cc",
339     ]
340   }
342   if (!use_x11 || !is_chromeos) {
343     sources -= [ "touch/touch_transformer_controller_unittest.cc" ]
344   }
346   # TODO(GYP) is this necessary?
347   #['OS=="linux" and component=="shared_library" and use_allocator!="none"', {
348   # ldflags = "-rdynamic"
350   if (!is_chromeos || use_ozone) {
351     sources -= [ "sticky_keys/sticky_keys_unittest.cc" ]  # crbug.com/354035
352   }
355 executable("ash_shell") {
356   testonly = true
357   sources = [
358     "shell/shell_main.cc",
359   ]
361   deps = [
362     ":ash_shell_lib",
363     "//components/user_manager",
364   ]
366   if (is_win) {
367     configs -= [ "//build/config/win:console" ]
368     configs += [ "//build/config/win:windowed" ]
369     deps += [ "//sandbox" ]
370   }
372   if (is_chromeos) {
373     deps += [ "//device/bluetooth" ]
374   }
377 test("ash_shell_unittests") {
378   sources = [
379     "shell/window_watcher_unittest.cc",
380     "test/ash_unittests.cc",
381   ]
383   deps = [
384     ":ash_shell_lib",
385     ":test_support",
386     "//base/test:test_support",
387     "//components/user_manager",
388     "//content/test:test_support",
389     "//skia",
390     "//testing/gtest",
391     "//ui/accessibility",
392   ]
394   if (is_chromeos) {
395     deps += [ "//ui/display" ]
396   }
398 # When adding support for isolates, please have a look at run-time dependencies
399 # in the ash_unittests_run target in ash.gyp.