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