Sort unlaunched apps on app list start page by apps grid order.
[chromium-blink-merge.git] / ui / views / BUILD.gn
blobbe6c0da39a3d686fa05851be1a6880bf5e134a69
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/aura",
29     "//ui/native_theme",
30     "//ui/resources",
31     "//ui/strings",
32     "//ui/wm",
33     "//url",
34   ]
36   public_deps = [
37     "//base",
38     "//ui/accessibility:ax_gen",
39     "//ui/base",
40     "//ui/base/ime",
41     "//ui/compositor",
42     "//ui/events",
43     "//ui/events:events_base",
44     "//ui/events/platform",
45     "//ui/gfx",
46     "//ui/gfx/geometry",
47   ]
49   if (use_x11 && !is_chromeos) {
50     deps += [ "//ui/display/util" ]
51   }
52   if (is_linux && !is_chromeos) {
53     sources -= [ "window/window_button_order_provider.cc" ]
54     deps += [ "//ui/shell_dialogs" ]
55   } else {
56     sources -= [
57       "linux_ui/linux_ui.cc",
58       "linux_ui/linux_ui.h",
59       "linux_ui/window_button_order_observer.h",
60       "linux_ui/window_button_order_provider.cc",
61     ]
62   }
64   if (is_chromeos) {
65     sources -= [
66       "linux_ui/status_icon_linux.cc",
67       "linux_ui/status_icon_linux.h",
68     ]
69   }
71   if (is_win) {
72     sources += gypi_values.views_win_sources
73     libs = [
74       "imm32.lib",
75       "oleacc.lib",
76     ]
77     ldflags = [ "/DELAYLOAD:user32.dll" ]
78     deps += [
79       "//third_party/iaccessible2",
80       "//third_party/wtl",
81     ]
82   }
84   if (use_ozone) {
85     deps += [ "//ui/ozone" ]
86   }
87   if (use_x11) {
88     configs += [
89       "//build/config/linux:x11",
90       "//build/config/linux:xrandr",
91     ]
92     deps += [
93       "//ui/events/devices",
94       "//ui/events/platform/x11",
95       "//ui/gfx/x",
96     ]
97   }
99   if (use_aura) {
100     sources += gypi_values.views_aura_sources
101     if (!is_chromeos) {
102       sources += gypi_values.views_desktop_aura_sources
103       if (use_x11) {
104         sources += gypi_values.views_desktop_aura_x11_sources
105       } else if (is_win) {
106         sources += gypi_values.views_desktop_aura_win_sources
107       } else if (use_ozone) {
108         sources += gypi_values.views_desktop_aura_ozone_sources
109       }
110       if (is_linux) {
111         sources += gypi_values.views_desktop_aura_linux_sources
112       }
113     }
114   }
116   if (is_mac) {
117     deps += [ "//ui/accelerated_widget_mac" ]
118   }
121 static_library("test_support") {
122   testonly = true
123   sources = gypi_values.views_test_support_sources
125   public_deps = [
126     ":views",
127   ]
128   deps = [
129     "//base",
130     "//ipc:test_support",
131     "//skia",
132     "//testing/gtest",
133     "//ui/aura",
134     "//ui/base",
135     "//ui/base/ime",
136     "//ui/compositor",
137     "//ui/compositor:test_support",
138     "//ui/events",
139     "//ui/events:events_base",
140     "//ui/events:test_support",
141     "//ui/events/platform",
142     "//ui/gfx",
143     "//ui/gfx/geometry",
144     "//ui/wm",
145   ]
147   if (is_chromeos || !use_x11) {
148     sources -= [
149       "test/ui_controls_factory_desktop_aurax11.cc",
150       "test/ui_controls_factory_desktop_aurax11.h",
151     ]
152   }
153   if (use_aura) {
154     sources += gypi_values.views_test_support_aura_sources
155     deps += [ "//ui/aura:test_support" ]
156   }
157   if (use_x11) {
158     deps += [ "//ui/gfx/x" ]
159   }
160   if (use_ozone || !use_x11) {
161     sources -= [ "test/x11_property_change_waiter.cc" ]
162   }
165 if (!is_win || link_chrome_on_windows) {
166   test("views_unittests") {
167     sources = gypi_values.views_unittests_sources
169     deps = [
170       ":test_support",
171       "//base",
172       "//base:i18n",
173       "//base/allocator",
174       "//base/test:test_support",
175       "//skia",
176       "//testing/gtest",
177       "//third_party/icu",
178       "//ui/accessibility",
179       "//ui/aura",
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       "//ui/wm",
193       "//url",
194     ]
196     if (is_chromeos) {
197       sources -= [ "ime/input_method_bridge_unittest.cc" ]
198     }
200     if (is_win) {
201       deps += [
202         "//third_party/iaccessible2",
203         "//third_party/wtl",
204       ]
205       libs = [
206         "imm32.lib",
207         "oleacc.lib",
208         "comctl32.lib",
209       ]
211       # TOOD(GYP)
212       #'msvs_settings': {
213       #  'VCManifestTool': {
214       #    'AdditionalManifestFiles': [
215       #      '$(ProjectDir)\\test\\views_unittest.manifest',
216       #    ],
217       #  },
218       #},
219     }
221     if (use_x11) {
222       configs += [
223         "//build/config/linux:x11",
224         "//build/config/linux:xext",
225       ]
226       deps += [
227         "//ui/events/devices",
228         "//ui/events/platform/x11",
229         "//ui/gfx/x",
230       ]
231     }
233     if (use_aura) {
234       sources += gypi_values.views_unittests_aura_sources
235       deps += [ "//ui/aura:test_support" ]
236       if (!is_chromeos) {
237         sources += gypi_values.views_unittests_desktop_aura_sources
238         if (use_x11) {
239           sources += gypi_values.views_unittests_desktop_aurax11_sources
240         }
241       }
242     }
243     if (use_x11) {
244       deps += [
245         "//ui/events/platform/x11",
246         "//ui/gfx/x",
247       ]
248     }
250     if (is_mac) {
251       # views_unittests not yet compiling on Mac. http://crbug.com/378134
252       sources -= [
253         "bubble/bubble_window_targeter_unittest.cc",
254         "controls/button/custom_button_unittest.cc",
255         "controls/button/menu_button_unittest.cc",
256         "controls/menu/menu_controller_unittest.cc",
257         "controls/native/native_view_host_unittest.cc",
258         "focus/focus_manager_unittest.cc",
259         "ime/input_method_bridge_unittest.cc",
260         "widget/widget_unittest.cc",
261         "widget/window_reorderer_unittest.cc",
262       ]
263     }
264   }
267 if (is_mac) {
268   test("macviews_interactive_ui_tests") {
269     sources = [
270       "cocoa/bridged_native_widget_interactive_uitest.mm",
271       "run_all_unittests.cc",
272       "widget/native_widget_mac_interactive_uitest.mm",
273     ]
274     deps = [
275       ":test_support",
276       ":views",
277       "//base",
278       "//base/test:test_support",
279       "//skia",
280       "//testing/gtest",
281       "//ui/aura",
282       "//ui/compositor",
283       "//ui/resources",
284       "//ui/resources:ui_test_pak",
285       "//ui/strings",
286       "//ui/wm",
287     ]
288   }