Drive: Add BatchableRequest subclass.
[chromium-blink-merge.git] / ui / views / BUILD.gn
blob3403531513ad9c62812ba1dc93e235a33efea3c8
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")
7 import("//testing/test.gni")
9 gypi_values = exec_script("//build/gypi_to_gn.py",
10                           [ rebase_path("views.gyp") ],
11                           "scope",
12                           [ "views.gyp" ])
14 component("views") {
15   sources = gypi_values.views_sources
17   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
18   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
20   defines = [ "VIEWS_IMPLEMENTATION" ]
22   deps = [
23     "//base:i18n",
24     "//base/third_party/dynamic_annotations",
25     "//skia",
26     "//third_party/icu",
27     "//ui/accessibility",
28     "//ui/native_theme",
29     "//ui/resources",
30     "//ui/strings",
31     "//url",
32   ]
34   public_deps = [
35     "//base",
36     "//ui/accessibility:ax_gen",
37     "//ui/base",
38     "//ui/base/ime",
39     "//ui/compositor",
40     "//ui/events",
41     "//ui/events:events_base",
42     "//ui/events/platform",
43     "//ui/gfx",
44     "//ui/gfx/geometry",
45   ]
47   if (use_x11 && !is_chromeos) {
48     deps += [ "//ui/display/util" ]
49   }
50   if (is_linux && !is_chromeos) {
51     sources -= [ "window/window_button_order_provider.cc" ]
52     deps += [ "//ui/shell_dialogs" ]
53   } else {
54     sources -= [
55       "linux_ui/linux_ui.cc",
56       "linux_ui/linux_ui.h",
57       "linux_ui/window_button_order_observer.h",
58       "linux_ui/window_button_order_provider.cc",
59     ]
60   }
62   if (is_chromeos) {
63     sources -= [
64       "linux_ui/status_icon_linux.cc",
65       "linux_ui/status_icon_linux.h",
66     ]
67   }
69   if (is_win) {
70     sources += gypi_values.views_win_sources
71     libs = [
72       "imm32.lib",
73       "oleacc.lib",
74     ]
75     ldflags = [ "/DELAYLOAD:user32.dll" ]
76     deps += [
77       "//third_party/iaccessible2",
78       "//third_party/wtl",
79     ]
80   }
82   if (use_ozone) {
83     deps += [ "//ui/ozone" ]
84   }
85   if (use_x11) {
86     configs += [
87       "//build/config/linux:x11",
88       "//build/config/linux:xrandr",
89     ]
90     deps += [
91       "//ui/events/devices",
92       "//ui/events/platform/x11",
93       "//ui/gfx/x",
94     ]
95   }
97   if (use_aura) {
98     sources += gypi_values.views_aura_sources
99     deps += [
100       "//ui/aura",
101       "//ui/wm",
102     ]
103     if (!is_chromeos) {
104       sources += gypi_values.views_desktop_aura_sources
105       if (use_x11) {
106         sources += gypi_values.views_desktop_aura_x11_sources
107         configs += [ "//build/config/linux:atk" ]
108       } else if (is_win) {
109         sources += gypi_values.views_desktop_aura_win_sources
110       } else if (use_ozone) {
111         sources += gypi_values.views_desktop_aura_ozone_sources
112       }
113       if (is_linux) {
114         sources += gypi_values.views_desktop_aura_linux_sources
115       }
116     }
117   }
119   if (is_mac) {
120     deps += [ "//ui/accelerated_widget_mac" ]
121   }
124 static_library("test_support") {
125   testonly = true
126   sources = gypi_values.views_test_support_sources
128   public_deps = [
129     ":views",
130   ]
131   deps = [
132     "//base",
133     "//ipc:test_support",
134     "//skia",
135     "//testing/gtest",
136     "//ui/base",
137     "//ui/base/ime",
138     "//ui/compositor",
139     "//ui/compositor:test_support",
140     "//ui/events",
141     "//ui/events:events_base",
142     "//ui/events:test_support",
143     "//ui/events/platform",
144     "//ui/gfx",
145     "//ui/gfx/geometry",
146   ]
148   if (use_aura) {
149     sources += gypi_values.views_test_support_aura_sources
150     deps += [
151       "//ui/aura",
152       "//ui/aura:test_support",
153       "//ui/wm",
154     ]
155     if (use_x11 && !is_chromeos) {
156       sources += gypi_values.views_test_support_desktop_aura_x11_sources
157     }
158   }
159   if (use_x11) {
160     deps += [ "//ui/gfx/x" ]
161   }
162   if (use_ozone || !use_x11) {
163     sources -= [ "test/x11_property_change_waiter.cc" ]
164   }
167 test("views_unittests") {
168   sources = gypi_values.views_unittests_sources
170   deps = [
171     ":test_support",
172     "//base",
173     "//base:i18n",
174     "//base/allocator",
175     "//base/test:test_support",
176     "//skia",
177     "//testing/gtest",
178     "//third_party/icu",
179     "//ui/accessibility",
180     "//ui/base",
181     "//ui/base/ime",
182     "//ui/base:test_support",
183     "//ui/compositor:test_support",
184     "//ui/events:test_support",
185     "//ui/events:events_base",
186     "//ui/events/platform",
187     "//ui/gfx",
188     "//ui/gfx/geometry",
189     "//ui/gl",
190     "//ui/resources",
191     "//ui/strings",
192     "//url",
193   ]
195   if (is_win) {
196     deps += [
197       "//third_party/iaccessible2",
198       "//third_party/wtl",
199     ]
200     libs = [
201       "imm32.lib",
202       "oleacc.lib",
203       "comctl32.lib",
204     ]
206     # TOOD(GYP)
207     #'msvs_settings': {
208     #  'VCManifestTool': {
209     #    'AdditionalManifestFiles': [
210     #      '$(ProjectDir)\\test\\views_unittest.manifest',
211     #    ],
212     #  },
213     #},
214   }
216   if (use_x11) {
217     configs += [
218       "//build/config/linux:x11",
219       "//build/config/linux:xext",
220     ]
221     deps += [
222       "//ui/events/devices",
223       "//ui/events/platform/x11",
224       "//ui/gfx/x",
225     ]
226   }
228   if (use_aura) {
229     sources += gypi_values.views_unittests_aura_sources
230     deps += [
231       "//ui/aura",
232       "//ui/aura:test_support",
233       "//ui/wm",
234     ]
235     if (!is_chromeos) {
236       sources += gypi_values.views_unittests_desktop_aura_sources
237       if (use_x11) {
238         sources += gypi_values.views_unittests_desktop_aurax11_sources
239       }
240     }
241   }
242   if (!is_chromeos) {
243     sources += gypi_values.views_unittests_desktop_sources
244   }
245   if (use_x11) {
246     deps += [
247       "//ui/events/platform/x11",
248       "//ui/gfx/x",
249     ]
250   }
252   if (is_mac) {
253     # views_unittests not yet compiling on Mac. http://crbug.com/378134
254     sources -= [
255       "bubble/bubble_window_targeter_unittest.cc",
256       "controls/button/custom_button_unittest.cc",
257       "controls/button/menu_button_unittest.cc",
258       "controls/menu/menu_controller_unittest.cc",
259       "controls/native/native_view_host_unittest.cc",
260       "focus/focus_manager_unittest.cc",
261       "ime/input_method_bridge_unittest.cc",
262       "widget/widget_unittest.cc",
263       "widget/window_reorderer_unittest.cc",
264     ]
265   }
268 if (is_mac) {
269   test("macviews_interactive_ui_tests") {
270     sources = [
271       "cocoa/bridged_native_widget_interactive_uitest.mm",
272       "run_all_unittests.cc",
273       "widget/native_widget_mac_interactive_uitest.mm",
274     ]
275     deps = [
276       ":test_support",
277       ":views",
278       "//base",
279       "//base/test:test_support",
280       "//skia",
281       "//testing/gtest",
282       "//ui/compositor",
283       "//ui/resources",
284       "//ui/resources:ui_test_pak",
285       "//ui/strings",
286     ]
287   }