Add a qcms_profile_get_description() api
[chromium-blink-merge.git] / ash / BUILD.gn
blobb55fdc933190be5bc1732191584586710cafd4cf
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 (is_chromeos) {
78     deps += [
79       "//device/bluetooth",
80       "//ui/display",
81       "//ui/display/util",
82       "//chromeos",
83       "//chromeos:power_manager_proto",
84       "//ui/chromeos/resources",
85       "//ui/chromeos/strings",
86       "//ui/chromeos:ui_chromeos",
87     ]
88   } else {
89     sources -= [
90       "accelerators/key_hold_detector.cc",
91       "accelerators/key_hold_detector.h",
92       "accelerators/magnifier_key_scroller.cc",
93       "accelerators/magnifier_key_scroller.h",
94       "accelerators/spoken_feedback_toggler.cc",
95       "accelerators/spoken_feedback_toggler.h",
96       "display/display_configurator_animation.cc",
97       "display/display_configurator_animation.h",
98       "display/resolution_notification_controller.cc",
99       "display/resolution_notification_controller.h",
100       "system/tray/media_security/media_capture_observer.h",
101       "system/tray/media_security/multi_profile_media_tray_item.cc",
102       "system/tray/media_security/multi_profile_media_tray_item.h",
103       "touch/touch_transformer_controller.cc",
104       "touch/touch_transformer_controller.h",
105       "touch/touchscreen_util.cc",
106       "touch/touchscreen_util.h",
107       "virtual_keyboard_controller.cc",
108       "virtual_keyboard_controller.h",
109     ]
110   }
112   if (!use_ozone) {
113     sources -= [ "host/ash_window_tree_host_ozone.cc" ]
114   }
117 component("ash_with_content") {
118   sources = [
119     "content_support/ash_with_content_export.h",
120     "content_support/gpu_support_impl.cc",
121     "content_support/gpu_support_impl.h",
122     "keyboard_overlay/keyboard_overlay_delegate.cc",
123     "keyboard_overlay/keyboard_overlay_delegate.h",
124     "keyboard_overlay/keyboard_overlay_view.cc",
125     "keyboard_overlay/keyboard_overlay_view.h",
126   ]
128   defines = [ "ASH_WITH_CONTENT_IMPLEMENTATION" ]
130   public_deps = [
131     ":ash",
132   ]
133   deps = [
134     "//base",
135     "//base/third_party/dynamic_annotations",
136     "//content/public/browser",
137     "//ipc",
138     "//skia",
139     "//ui/aura",
140     "//ui/base",
141     "//ui/compositor",
142     "//ui/events",
143     "//ui/gfx",
144     "//ui/gfx/geometry",
145     "//ui/resources",
146     "//ui/strings",
147     "//ui/views",
148     "//ui/views/controls/webview",
149     "//ui/web_dialogs",
150     "//url",
151   ]
154 static_library("test_support") {
155   testonly = true
156   sources = gypi_values.ash_test_support_sources
158   public_deps = [
159     ":ash",
160   ]
161   deps = [
162     "//ash/resources",
163     "//content/test:test_support",
164     "//skia",
165     "//testing/gtest",
166     "//ui/accessibility",
167     "//ui/app_list",
168     "//ui/app_list:test_support",
169     "//ui/events:events_base",
170     "//ui/events/devices",
171     "//ui/gl",
172     "//ui/views",
173     "//ui/views:test_support",
174   ]
176   if (is_win) {
177     sources += [
178       "test/test_metro_viewer_process_host.cc",
179       "test/test_metro_viewer_process_host.h",
180     ]
181     deps += [
182       "//ipc",
183       #'../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages',  TODO(GYP)
184       #'../win8/win8.gyp:metro_viewer',  TODO(GYP)
185       #'../win8/win8.gyp:test_support_win8',  TODO(GYP)
186       #'../win8/win8_tests.gyp:test_registrar',  TODO(GYP)
187     ]
188   }
191 static_library("ash_shell_lib") {
192   testonly = true
193   sources = gypi_values.ash_shell_lib_sources
195   deps = [
196     ":ash",
197     ":ash_with_content",
198     ":test_support",
199     "//ash/resources",
200     "//ash/strings",
201     "//base",
202     "//base:i18n",
204     #"//chrome:packed_resources",  TODO(GYP)
205     "//content",
206     "//content/shell:content_shell_lib",
207     "//net",
208     "//skia",
209     "//third_party/icu",
210     "//ui/app_list",
211     "//ui/aura",
212     "//ui/base",
213     "//ui/compositor",
214     "//ui/events",
215     "//ui/events:events_base",
216     "//ui/gfx",
217     "//ui/gfx/geometry",
218     "//ui/keyboard",
219     "//ui/message_center",
220     "//ui/resources",
221     "//ui/views",
222     "//ui/views:test_support",
223     "//ui/views/examples:views_examples_lib",
224     "//ui/views/examples:views_examples_with_content_lib",
225   ]
228 test("ash_unittests") {
229   sources = gypi_values.ash_unittests_sources
231   deps = [
232     ":ash",
233     ":ash_with_content",
234     ":test_support",
235     "//ash/resources",
236     "//ash/strings",
237     "//base",
238     "//base/allocator",
239     "//base/test:test_support",
240     "//components/user_manager",
241     "//content/public/browser",
242     "//content/test:test_support",
243     "//skia",
244     "//testing/gtest",
245     "//third_party/icu",
246     "//ui/accelerometer",
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/devices",
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",
277       # All tests for multiple displays: not supported on Windows Ash.
278       "wm/drag_window_resizer_unittest.cc",
280       # Accelerometer is only available on Chrome OS.
281       "wm/maximize_mode/maximize_mode_controller_unittest.cc",
283       # Can't resize on Windows Ash. http://crbug.com/165962
284       "magnifier/magnification_controller_unittest.cc",
285       "wm/workspace/workspace_window_resizer_unittest.cc",
286       "sticky_keys/sticky_keys_overlay_unittest.cc",
287       "system/tray/media_security/multi_profile_media_tray_item_unittest.cc",
288       "autoclick/autoclick_unittest.cc",
289       "virtual_keyboard_controller_unittest.cc",
290     ]
291     sources += [
292       #'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc',  TODO(GYP)
293     ]
294   }
296   if (is_win) {
297     cflags = [ "/wd4267" ]
298   }
300   if (!use_x11) {
301     sources -= [ "host/ash_window_tree_host_x11_unittest.cc" ]
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:power_manager_proto",
311       "//chromeos:test_support_without_gmock",
312     ]
313   } else {
314     sources -= [
315       "accelerators/magnifier_key_scroller_unittest.cc",
316       "accelerators/spoken_feedback_toggler_unittest.cc",
317       "display/resolution_notification_controller_unittest.cc",
318       "touch/touchscreen_util_unittest.cc",
319     ]
320   }
322   if (!use_x11 || !is_chromeos) {
323     sources -= [ "touch/touch_transformer_controller_unittest.cc" ]
324   }
326   # TODO(GYP) is this necessary?
327   #['OS=="linux" and component=="shared_library" and use_allocator!="none"', {
328   # ldflags = "-rdynamic"
330   if (!is_chromeos || use_ozone) {
331     sources -= [ "sticky_keys/sticky_keys_unittest.cc" ]  # crbug.com/354035
332   }
335 executable("ash_shell") {
336   testonly = true
337   sources = [
338     "shell/shell_main.cc",
339   ]
341   deps = [
342     ":ash_shell_lib",
343     "//components/user_manager",
344   ]
346   if (is_win) {
347     configs -= [ "//build/config/win:console" ]
348     configs += [ "//build/config/win:windowed" ]
349     deps += [ "//sandbox" ]
350   }
352   if (is_chromeos) {
353     deps += [ "//device/bluetooth" ]
354   }
357 test("ash_shell_unittests") {
358   sources = [
359     "shell/window_watcher_unittest.cc",
360     "test/ash_unittests.cc",
361   ]
363   deps = [
364     ":ash_shell_lib",
365     ":test_support",
366     "//base/test:test_support",
367     "//components/user_manager",
368     "//content/test:test_support",
369     "//skia",
370     "//testing/gtest",
371     "//ui/accessibility",
372   ]
374   if (is_chromeos) {
375     deps += [ "//ui/display" ]
376   }