Ensure the scroll slop area is at least as large as it is by default on Windows.
[chromium-blink-merge.git] / ash / BUILD.gn
blobdefed0d316f2bd3a7fb0f2a4a2df8e70a4080a98
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   deps = [
20     "//ash/resources",
21     "//ash/strings",
22     "//base",
23     "//base:i18n",
24     "//base/third_party/dynamic_annotations",
25     "//cc",
26     "//components/user_manager",
27     "//content/public/browser",
28     "//media",
29     "//net",
30     "//skia",
31     "//third_party/icu",
32     "//ui/accessibility",
33     "//ui/app_list",
34     "//ui/aura",
35     "//ui/base",
36     "//ui/compositor",
37     "//ui/events",
38     "//ui/events:events_base",
39     "//ui/gfx",
40     "//ui/gfx/geometry",
41     "//ui/keyboard",
42     "//ui/message_center",
43     "//ui/resources",
44     "//ui/strings",
45     "//ui/views",
46     "//ui/views/controls/webview",
47     "//ui/web_dialogs",
48     "//ui/wm",
49     "//url",
50   ]
52   forward_dependent_configs_from = [
53     "//ash/resources",
54     "//ash/strings",
55   ]
57   if (is_win) {
58     sources -= [
59       "sticky_keys/sticky_keys_controller.cc",
60       "sticky_keys/sticky_keys_controller.h",
61     ]
62     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
63     cflags = [ "/wd4267" ]
64   }
66   if (use_x11) {
67     configs += [
68       "//build/config/linux:xfixes",
69     ]
70   } else {
71     sources -= [
72       "accelerators/key_hold_detector.cc",
73       "accelerators/key_hold_detector.h",
74       "accelerators/magnifier_key_scroller.cc",
75       "accelerators/magnifier_key_scroller.h",
76       "accelerators/spoken_feedback_toggler.cc",
77       "accelerators/spoken_feedback_toggler.h",
78     ]
79   }
81   if (is_chromeos) {
82     deps += [
83       "//device/bluetooth",
84       "//ui/display",
85       "//ui/display/util",
86       #'../chromeos/chromeos.gyp:chromeos',  TODO(GYP)
87       # Ash #includes power_supply_properties.pb.h directly.
88       #'../chromeos/chromeos.gyp:power_manager_proto',  TODO(GYP)
89       #'../ui/chromeos/ui_chromeos.gyp:ui_chromeos_resources',  TODO(GYP)
90       #'../ui/chromeos/ui_chromeos.gyp:ui_chromeos_strings',  TODO(GYP)
91       #'../ui/chromeos/ui_chromeos.gyp:ui_chromeos',  TODO(GYP)
92     ]
93   } else {
94     sources -= [
95       "display/display_configurator_animation.cc",
96       "display/display_configurator_animation.h",
97       "display/resolution_notification_controller.cc",
98       "display/resolution_notification_controller.h",
99       "system/tray/media_security/media_capture_observer.h",
100       "system/tray/media_security/multi_profile_media_tray_item.cc",
101       "system/tray/media_security/multi_profile_media_tray_item.h",
102     ]
103   }
105   if (!use_x11 || !is_chromeos) {
106     sources -= [
107       "touch/touch_transformer_controller.cc",
108       "touch/touch_transformer_controller.h",
109     ]
110   }
112   if (!use_ozone) {
113     sources -= [
114       "display/mouse_cursor_event_filter_ozone.cc",
115     ]
116   }
118   if (!use_ozone) {
119     sources -= [
120       "host/ash_window_tree_host_ozone.cc",
121     ]
122   }
125 component("ash_with_content") {
126   sources = [
127     "content_support/ash_with_content_export.h",
128     "content_support/gpu_support_impl.cc",
129     "content_support/gpu_support_impl.h",
130     "screensaver/screensaver_view.cc",
131     "screensaver/screensaver_view.h",
132     "keyboard_overlay/keyboard_overlay_delegate.cc",
133     "keyboard_overlay/keyboard_overlay_delegate.h",
134     "keyboard_overlay/keyboard_overlay_view.cc",
135     "keyboard_overlay/keyboard_overlay_view.h",
136   ]
138   defines = [ "ASH_WITH_CONTENT_IMPLEMENTATION" ]
140   deps = [
141     ":ash",
142     "//base",
143     "//base/third_party/dynamic_annotations",
144     "//content/public/browser",
145     "//ipc",
146     "//skia",
147     "//ui/aura",
148     "//ui/base",
149     "//ui/compositor",
150     "//ui/events",
151     "//ui/gfx",
152     "//ui/gfx/geometry",
153     "//ui/resources",
154     "//ui/strings",
155     "//ui/views",
156     "//ui/views/controls/webview",
157     "//ui/web_dialogs",
158     "//url",
159   ]
161   forward_dependent_configs_from = [
162     ":ash",
163   ]
166 static_library("test_support") {
167   sources = gypi_values.ash_test_support_sources
169   deps = [
170     ":ash",
171     "//ash/resources",
172     "//skia",
173     "//testing/gtest",
174     "//ui/accessibility",
175     "//ui/app_list",
176     "//ui/views",
177   ]
179   if (is_win) {
180     sources += [
181       "test/test_metro_viewer_process_host.cc",
182       "test/test_metro_viewer_process_host.h",
183     ]
184     deps += [
185       "//ipc",
186       #'../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages',  TODO(GYP)
187       #'../win8/win8.gyp:metro_viewer',  TODO(GYP)
188       #'../win8/win8.gyp:test_support_win8',  TODO(GYP)
189       #'../win8/win8_tests.gyp:test_registrar',  TODO(GYP)
190     ]
191   }
194 static_library("ash_shell_lib") {
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     "//skia",
209     "//third_party/icu",
210     "//ui/app_list",
211     "//ui/aura",
212     "//ui/base",
213     "//ui/compositor",
214     "//ui/events",
215     "//ui/gfx",
216     "//ui/gfx/geometry",
217     "//ui/keyboard",
218     "//ui/message_center",
219     "//ui/resources",
220     "//ui/views",
221     "//ui/views:test_support",
222     #'../ui/views/examples/examples.gyp:views_examples_lib',  TODO(GYP)
223     #'../ui/views/examples/examples.gyp:views_examples_with_content_lib',  TODO(GYP)
224   ]
227 if (false) {  # TODO(GYP) enable ash shell and unit tests when they link.
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/accessibility",
248     "//ui/aura",
249     "//ui/aura:test_support",
250     "//ui/base",
251     "//ui/base:test_support",
252     "//ui/compositor",
253     "//ui/compositor:test_support",
254     "//ui/events",
255     "//ui/events:test_support",
256     "//ui/events:gesture_detection",
257     "//ui/gfx",
258     "//ui/gfx/geometry",
259     "//ui/keyboard",
260     "//ui/message_center",
261     "//ui/message_center:test_support",
262     "//ui/resources",
263     "//ui/views",
264     "//ui/views:test_support",
265     "//ui/views/controls/webview:test_support",
266     "//ui/web_dialogs",
267     "//ui/wm",
268     "//url",
269   ]
271   if (!is_chromeos) {
272     sources -= [
273       # TODO(zork): fix this test to build on Windows. See: crosbug.com/26906
274       "focus_cycler_unittest.cc",
275       # All tests for multiple displays: not supported on Windows Ash.
276       "accelerators/nested_dispatcher_controller_unittest.cc",
277       "wm/drag_window_resizer_unittest.cc",
278       # Can't resize on Windows Ash. http://crbug.com/165962
279       "ash_root_window_transformer_unittest.cc",
280       "magnifier/magnification_controller_unittest.cc",
281       "wm/workspace/workspace_window_resizer_unittest.cc",
282       "sticky_keys/sticky_keys_overlay_unittest.cc",
283       "sticky_keys/sticky_keys_unittest.cc",
284       "system/tray/media_security/multi_profile_media_tray_item_unittest.cc",
285       "autoclick/autoclick_unittest.cc",
286     ]
287     sources += [
288       #'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc',  TODO(GYP)
289     ]
290   }
292   if (is_win) {
293     cflags = [ "/wd4267" ]
294   }
296   if (!use_x11) {
297     sources -= [
298       "accelerators/magnifier_key_scroller_unittest.cc",
299       "accelerators/spoken_feedback_toggler_unittest.cc",
300       "touch/touch_transformer_controller_unittest.cc",
301     ]
302   }
303   if (is_chromeos) {
304     sources += [ "first_run/first_run_helper_unittest.cc" ]
305     deps += [
306       "//device/bluetooth",
307       "//ui/display",
308       "//ui/display:test_util",
309       "//ui/display/types",
310       #'../chromeos/chromeos.gyp:chromeos_test_support_without_gmock',  TODO(GYP)
311       #'../chromeos/chromeos.gyp:power_manager_proto',  TODO(GYP)
312     ]
313   } else {
314     sources -= [
315       "display/resolution_notification_controller_unittest.cc",
316       "touch/touch_transformer_controller_unittest.cc",
317     ]
318   }
320   # TODO(GYP) is this necessary?
321   #['OS=="linux" and component=="shared_library" and use_allocator!="none"', {
322   # ldflags = "-rdynamic"
324   if (use_ozone) {
325     sources -= [
326       "sticky_keys/sticky_keys_unittest.cc",  # crbug.com/354035
327     ]
328   }
331 executable("ash_shell") {
332   sources = [
333     "shell/shell_main.cc",
334   ]
336   deps = [
337     ":ash_shell_lib",
338     "//components/user_manager",
339   ]
341   if (is_win) {
342     configs -= [ "//build/config/win:console" ]
343     configs += [ "//build/config/win:windowed" ]
344     deps += [
345       "//sandbox",
346     ]
347   }
349   if (is_chromeos) {
350     deps += [
351       "../device/bluetooth/bluetooth.gyp:device_bluetooth",
352     ]
353   }
356 test("ash_shell_unittests") {
357   sources = [
358     "shell/window_watcher_unittest.cc",
359     "test/ash_unittests.cc",
360   ]
362   deps = [
363     "//base/test:test_support",
364     "//components/user_manager",
365     "//content/test:test_support",
366     "//skia",
367     "//testing/gtest",
368     "//ui/aaccessibility",
369   ]
371   if (is_chromeos) {
372     deps += [ "//ui/display" ]
373   }
376 }  # if false