Revert of The |RendererFrameManager| will adapt its cache size to the current memory...
[chromium-blink-merge.git] / ash / BUILD.gn
blob7642e9a5cc52dc3c477f241dbaed194de579dacb
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     "screensaver/screensaver_view.cc",
123     "screensaver/screensaver_view.h",
124     "keyboard_overlay/keyboard_overlay_delegate.cc",
125     "keyboard_overlay/keyboard_overlay_delegate.h",
126     "keyboard_overlay/keyboard_overlay_view.cc",
127     "keyboard_overlay/keyboard_overlay_view.h",
128   ]
130   defines = [ "ASH_WITH_CONTENT_IMPLEMENTATION" ]
132   public_deps = [
133     ":ash",
134   ]
135   deps = [
136     "//base",
137     "//base/third_party/dynamic_annotations",
138     "//content/public/browser",
139     "//ipc",
140     "//skia",
141     "//ui/aura",
142     "//ui/base",
143     "//ui/compositor",
144     "//ui/events",
145     "//ui/gfx",
146     "//ui/gfx/geometry",
147     "//ui/resources",
148     "//ui/strings",
149     "//ui/views",
150     "//ui/views/controls/webview",
151     "//ui/web_dialogs",
152     "//url",
153   ]
156 static_library("test_support") {
157   testonly = true
158   sources = gypi_values.ash_test_support_sources
160   public_deps = [
161     ":ash",
162   ]
163   deps = [
164     "//ash/resources",
165     "//content/test:test_support",
166     "//skia",
167     "//testing/gtest",
168     "//ui/accessibility",
169     "//ui/app_list",
170     "//ui/app_list:test_support",
171     "//ui/events:events_base",
172     "//ui/events/devices",
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",
206     #"//chrome:packed_resources",  TODO(GYP)
207     "//content",
208     "//content/shell:content_shell_lib",
209     "//net",
210     "//skia",
211     "//third_party/icu",
212     "//ui/app_list",
213     "//ui/aura",
214     "//ui/base",
215     "//ui/compositor",
216     "//ui/events",
217     "//ui/events:events_base",
218     "//ui/gfx",
219     "//ui/gfx/geometry",
220     "//ui/keyboard",
221     "//ui/message_center",
222     "//ui/resources",
223     "//ui/views",
224     "//ui/views:test_support",
225     "//ui/views/examples:views_examples_lib",
226     "//ui/views/examples:views_examples_with_content_lib",
227   ]
230 test("ash_unittests") {
231   sources = gypi_values.ash_unittests_sources
233   deps = [
234     ":ash",
235     ":ash_with_content",
236     ":test_support",
237     "//ash/resources",
238     "//ash/strings",
239     "//base",
240     "//base/allocator",
241     "//base/test:test_support",
242     "//components/user_manager",
243     "//content/public/browser",
244     "//content/test:test_support",
245     "//skia",
246     "//testing/gtest",
247     "//third_party/icu",
248     "//ui/accelerometer",
249     "//ui/accessibility",
250     "//ui/aura",
251     "//ui/aura:test_support",
252     "//ui/base",
253     "//ui/base:test_support",
254     "//ui/compositor",
255     "//ui/compositor:test_support",
256     "//ui/events",
257     "//ui/events/devices",
258     "//ui/events:test_support",
259     "//ui/events:gesture_detection",
260     "//ui/gfx",
261     "//ui/gfx/geometry",
262     "//ui/keyboard",
263     "//ui/message_center",
264     "//ui/message_center:test_support",
265     "//ui/resources",
266     "//ui/views",
267     "//ui/views:test_support",
268     "//ui/views/controls/webview:test_support",
269     "//ui/web_dialogs:test_support",
270     "//ui/wm",
271     "//url",
272   ]
274   if (!is_chromeos) {
275     sources -= [
276       # TODO(zork): fix this test to build on Windows. See: crosbug.com/26906
277       "focus_cycler_unittest.cc",
279       # All tests for multiple displays: not supported on Windows Ash.
280       "wm/drag_window_resizer_unittest.cc",
282       # Can't resize on Windows Ash. http://crbug.com/165962
283       "magnifier/magnification_controller_unittest.cc",
284       "wm/workspace/workspace_window_resizer_unittest.cc",
285       "sticky_keys/sticky_keys_overlay_unittest.cc",
286       "system/tray/media_security/multi_profile_media_tray_item_unittest.cc",
287       "autoclick/autoclick_unittest.cc",
288       "virtual_keyboard_controller_unittest.cc",
289     ]
290     sources += [
291       #'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc',  TODO(GYP)
292     ]
293   }
295   if (is_win) {
296     cflags = [ "/wd4267" ]
297   }
299   if (!use_x11) {
300     sources -= [ "host/ash_window_tree_host_x11_unittest.cc" ]
301   }
302   if (is_chromeos) {
303     sources += [ "first_run/first_run_helper_unittest.cc" ]
304     deps += [
305       "//device/bluetooth",
306       "//ui/display",
307       "//ui/display:test_util",
308       "//ui/display/types",
309       "//chromeos:power_manager_proto",
310       "//chromeos:test_support_without_gmock",
311     ]
312   } else {
313     sources -= [
314       "accelerators/magnifier_key_scroller_unittest.cc",
315       "accelerators/spoken_feedback_toggler_unittest.cc",
316       "display/resolution_notification_controller_unittest.cc",
317       "touch/touchscreen_util_unittest.cc",
318     ]
319   }
321   if (!use_x11 || !is_chromeos) {
322     sources -= [ "touch/touch_transformer_controller_unittest.cc" ]
323   }
325   # TODO(GYP) is this necessary?
326   #['OS=="linux" and component=="shared_library" and use_allocator!="none"', {
327   # ldflags = "-rdynamic"
329   if (!is_chromeos || use_ozone) {
330     sources -= [ "sticky_keys/sticky_keys_unittest.cc" ]  # crbug.com/354035
331   }
334 executable("ash_shell") {
335   testonly = true
336   sources = [
337     "shell/shell_main.cc",
338   ]
340   deps = [
341     ":ash_shell_lib",
342     "//components/user_manager",
343   ]
345   if (is_win) {
346     configs -= [ "//build/config/win:console" ]
347     configs += [ "//build/config/win:windowed" ]
348     deps += [ "//sandbox" ]
349   }
351   if (is_chromeos) {
352     deps += [ "//device/bluetooth" ]
353   }
356 test("ash_shell_unittests") {
357   sources = [
358     "shell/window_watcher_unittest.cc",
359     "test/ash_unittests.cc",
360   ]
362   deps = [
363     ":ash_shell_lib",
364     ":test_support",
365     "//base/test:test_support",
366     "//components/user_manager",
367     "//content/test:test_support",
368     "//skia",
369     "//testing/gtest",
370     "//ui/accessibility",
371   ]
373   if (is_chromeos) {
374     deps += [ "//ui/display" ]
375   }