MD Downloads: prevent search text from overlapping with the cancel search (X)
[chromium-blink-merge.git] / ui / aura / BUILD.gn
blob2aa15ec9e600261c9165b0e41a1ad7925fddc0a9
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/ui.gni")
6 import("//testing/test.gni")
8 component("aura") {
9   sources = [
10     "../wm/public/activation_change_observer.cc",
11     "../wm/public/activation_change_observer.h",
12     "../wm/public/activation_client.cc",
13     "../wm/public/activation_client.h",
14     "../wm/public/activation_delegate.cc",
15     "../wm/public/activation_delegate.h",
16     "../wm/public/animation_host.cc",
17     "../wm/public/animation_host.h",
18     "../wm/public/dispatcher_client.cc",
19     "../wm/public/dispatcher_client.h",
20     "../wm/public/drag_drop_client.cc",
21     "../wm/public/drag_drop_client.h",
22     "../wm/public/drag_drop_delegate.cc",
23     "../wm/public/drag_drop_delegate.h",
24     "../wm/public/scoped_drag_drop_disabler.cc",
25     "../wm/public/scoped_drag_drop_disabler.h",
26     "../wm/public/scoped_tooltip_disabler.cc",
27     "../wm/public/scoped_tooltip_disabler.h",
28     "../wm/public/tooltip_client.cc",
29     "../wm/public/tooltip_client.h",
30     "../wm/public/transient_window_client.cc",
31     "../wm/public/transient_window_client.h",
32     "../wm/public/window_move_client.cc",
33     "../wm/public/window_move_client.h",
34     "../wm/public/window_types.h",
35     "client/aura_constants.cc",
36     "client/aura_constants.h",
37     "client/capture_client.cc",
38     "client/capture_client.h",
39     "client/capture_delegate.h",
40     "client/cursor_client.cc",
41     "client/cursor_client.h",
42     "client/cursor_client_observer.cc",
43     "client/cursor_client_observer.h",
44     "client/default_capture_client.cc",
45     "client/default_capture_client.h",
46     "client/event_client.cc",
47     "client/event_client.h",
48     "client/focus_change_observer.cc",
49     "client/focus_change_observer.h",
50     "client/focus_client.cc",
51     "client/focus_client.h",
52     "client/screen_position_client.cc",
53     "client/screen_position_client.h",
54     "client/visibility_client.cc",
55     "client/visibility_client.h",
56     "client/window_stacking_client.cc",
57     "client/window_stacking_client.h",
58     "client/window_tree_client.cc",
59     "client/window_tree_client.h",
60     "env.cc",
61     "env.h",
62     "env_observer.h",
63     "input_state_lookup.cc",
64     "input_state_lookup.h",
65     "input_state_lookup_win.cc",
66     "input_state_lookup_win.h",
67     "layout_manager.cc",
68     "layout_manager.h",
69     "remote_window_tree_host_win.cc",
70     "remote_window_tree_host_win.h",
71     "scoped_window_targeter.cc",
72     "scoped_window_targeter.h",
73     "window.cc",
74     "window.h",
75     "window_delegate.h",
76     "window_event_dispatcher.cc",
77     "window_event_dispatcher.h",
78     "window_observer.cc",
79     "window_observer.h",
80     "window_targeter.cc",
81     "window_targeter.h",
82     "window_tracker.cc",
83     "window_tracker.h",
84     "window_tree_host.cc",
85     "window_tree_host.h",
86     "window_tree_host_mac.h",
87     "window_tree_host_mac.mm",
88     "window_tree_host_observer.h",
89     "window_tree_host_win.cc",
90     "window_tree_host_win.h",
91     "window_tree_host_x11.cc",
92     "window_tree_host_x11.h",
93   ]
95   defines = [ "AURA_IMPLEMENTATION" ]
97   deps = [
98     "//base",
99     "//base:i18n",
100     "//base/third_party/dynamic_annotations",
101     "//skia",
102     "//ui/base",
103     "//ui/base/ime",
104     "//ui/compositor",
105     "//ui/events",
106     "//ui/events:events_base",
107     "//ui/events/platform",
108     "//ui/gfx",
109     "//ui/gfx/geometry",
110   ]
112   if (use_x11) {
113     configs += [
114       "//build/config/linux:x11",
115       "//build/config/linux:xrandr",
116     ]
117     deps += [
118       "//ui/events:events_base",
119       "//ui/events/devices",
120       "//ui/events/platform/x11",
121       "//ui/gfx/x",
122     ]
123   } else {
124     sources -= [
125       "window_tree_host_x11.cc",
126       "window_tree_host_x11.h",
127     ]
128   }
130   if (is_win) {
131     sources -= [ "input_state_lookup.cc" ]
133     deps += [
134       "//ipc",
135       "//ui/metro_viewer",
136       "//ui/platform_window/win",
137     ]
138   }
140   if (use_ozone) {
141     sources += [
142       "window_tree_host_ozone.cc",
143       "window_tree_host_ozone.h",
144     ]
146     deps += [ "//ui/ozone" ]
147   }
150 source_set("test_support") {
151   testonly = true
152   sources = [
153     "test/aura_test_base.cc",
154     "test/aura_test_base.h",
155     "test/aura_test_helper.cc",
156     "test/aura_test_helper.h",
157     "test/aura_test_utils.cc",
158     "test/aura_test_utils.h",
159     "test/env_test_helper.h",
160     "test/event_generator_delegate_aura.cc",
161     "test/event_generator_delegate_aura.h",
162     "test/test_cursor_client.cc",
163     "test/test_cursor_client.h",
164     "test/test_focus_client.cc",
165     "test/test_focus_client.h",
166     "test/test_screen.cc",
167     "test/test_screen.h",
168     "test/test_window_delegate.cc",
169     "test/test_window_delegate.h",
170     "test/test_window_tree_client.cc",
171     "test/test_window_tree_client.h",
172     "test/test_windows.cc",
173     "test/test_windows.h",
174     "test/ui_controls_factory_aura.h",
175     "test/window_event_dispatcher_test_api.cc",
176     "test/window_event_dispatcher_test_api.h",
177     "test/window_test_api.cc",
178     "test/window_test_api.h",
179   ]
181   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
182   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
184   public_deps = [
185     ":aura",
186   ]
187   deps = [
188     "//skia",
189     "//testing/gtest",
190     "//ui/base:test_support",
191     "//ui/base/ime",
192     "//ui/compositor:test_support",
193     "//ui/events",
194     "//ui/events:events_base",
195     "//ui/events:test_support",
196     "//ui/gfx",
197     "//ui/gfx/geometry",
198     "//ui/wm",
199   ]
201   if (is_win) {
202     sources += [ "test/ui_controls_factory_aurawin.cc" ]
203   }
205   if (use_x11) {
206     sources += [
207       "test/ui_controls_factory_aurax11.cc",
208       "test/x11_event_sender.cc",
209       "test/x11_event_sender.h",
210     ]
212     deps += [ "//ui/gfx/x" ]
213   }
215   if (use_ozone) {
216     sources += [ "test/ui_controls_factory_ozone.cc" ]
217   }
220 executable("demo") {
221   output_name = "aura_demo"
222   testonly = true
224   sources = [
225     "demo/demo_main.cc",
226   ]
228   deps = [
229     ":aura",
230     ":test_support",
231     "//base",
232     "//build/config/sanitizers:deps",
233     "//base:i18n",
234     "//skia",
235     "//third_party/icu",
236     "//ui/base",
237     "//ui/compositor",
238     "//ui/compositor:test_support",
239     "//ui/events",
240     "//ui/gfx",
241     "//ui/gfx/geometry",
242     "//ui/gl",
243   ]
245   if (use_x11) {
246     deps += [ "//ui/gfx/x" ]
247   }
250 executable("bench") {
251   output_name = "aura_bench"
252   testonly = true
254   sources = [
255     "bench/bench_main.cc",
256   ]
258   deps = [
259     ":test_support",
260     "//base",
261     "//base:i18n",
262     "//build/config/sanitizers:deps",
263     "//cc",
264     "//gpu/command_buffer/client:gles2_interface",
265     "//skia",
266     "//third_party/icu",
267     "//ui/base",
268     "//ui/compositor",
269     "//ui/compositor:test_support",
270     "//ui/events",
271     "//ui/gfx",
272     "//ui/gfx/geometry",
273     "//ui/gl",
274   ]
276   if (use_x11) {
277     deps += [ "//ui/gfx/x" ]
278   }
281 # TODO(GYP): Delete this after we've converted everything to GN.
282 # The _run targets exist only for compatibility w/ GYP.
283 group("aura_unittests_run") {
284   testonly = true
285   deps = [
286     ":aura_unittests",
287   ]
290 test("aura_unittests") {
291   sources = [
292     "gestures/gesture_recognizer_unittest.cc",
293     "test/run_all_unittests.cc",
294     "window_event_dispatcher_unittest.cc",
295     "window_targeter_unittest.cc",
296     "window_unittest.cc",
297   ]
299   deps = [
300     ":test_support",
301     "//base/allocator",
302     "//base/test:test_support",
303     "//skia",
304     "//testing/gtest",
305     "//ui/base:test_support",
306     "//ui/compositor:test_support",
307     "//ui/events:test_support",
308     "//ui/events:gesture_detection",
309     "//ui/gfx",
310     "//ui/gfx/geometry",
311     "//ui/gl",
312   ]
314   if (is_linux) {
315     deps += [ "//third_party/mesa" ]
316   }
318   data_deps = [ "//third_party/mesa:osmesa" ]