OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/ui.gni") | 5 import("//build/config/ui.gni") |
6 | 6 |
7 if (is_android) { | 7 if (is_android) { |
8 import("//build/config/android/config.gni") | 8 import("//build/config/android/config.gni") |
9 import("//build/config/android/rules.gni") | 9 import("//build/config/android/rules.gni") |
10 } | 10 } |
11 | 11 |
12 declare_args() { | |
13 ui_base_build_ime = true | |
14 } | |
15 | |
16 component("base") { | 12 component("base") { |
17 output_name = "ui_base" | 13 output_name = "ui_base" |
18 sources = [ | 14 sources = [ |
19 "android/system_ui_resource_manager.h", | 15 "android/system_ui_resource_manager.h", |
20 "android/ui_base_jni_registrar.cc", | 16 "android/ui_base_jni_registrar.cc", |
21 "android/ui_base_jni_registrar.h", | 17 "android/ui_base_jni_registrar.h", |
22 "android/view_android.cc", | 18 "android/view_android.cc", |
23 "android/view_android.h", | 19 "android/view_android.h", |
24 "android/window_android.cc", | 20 "android/window_android.cc", |
25 "android/window_android.h", | 21 "android/window_android.h", |
26 "android/window_android_compositor.h", | 22 "android/window_android_compositor.h", |
27 "android/window_android_observer.h", | 23 "android/window_android_observer.h", |
28 "cursor/cursor.cc", | |
29 "cursor/cursor.h", | 24 "cursor/cursor.h", |
30 "cursor/cursor_android.cc", | |
31 "cursor/cursor_loader.h", | |
32 "cursor/cursor_util.cc", | |
33 "cursor/cursor_util.h", | |
34 "cursor/cursor_win.cc", | |
35 "hit_test.h", | 25 "hit_test.h", |
36 "l10n/formatter.cc", | |
37 "l10n/formatter.h", | |
38 "l10n/l10n_font_util.cc", | |
39 "l10n/l10n_font_util.h", | |
40 "l10n/l10n_util.cc", | |
41 "l10n/l10n_util.h", | |
42 "l10n/l10n_util_android.cc", | |
43 "l10n/l10n_util_android.h", | |
44 "l10n/l10n_util_collator.h", | |
45 "l10n/l10n_util_mac.h", | |
46 "l10n/l10n_util_mac.mm", | |
47 "l10n/l10n_util_plurals.cc", | |
48 "l10n/l10n_util_plurals.h", | |
49 "l10n/l10n_util_posix.cc", | |
50 "l10n/l10n_util_win.cc", | |
51 "l10n/l10n_util_win.h", | |
52 "l10n/time_format.cc", | |
53 "l10n/time_format.h", | |
54 "layout.cc", | |
55 "layout.h", | |
56 "layout_mac.mm", | |
57 "resource/data_pack.cc", | |
58 "resource/data_pack.h", | |
59 "resource/resource_bundle.cc", | |
60 "resource/resource_bundle.h", | |
61 "resource/resource_bundle_android.cc", | |
62 "resource/resource_bundle_auralinux.cc", | |
63 "resource/resource_bundle_ios.mm", | |
64 "resource/resource_bundle_mac.mm", | |
65 "resource/resource_bundle_win.cc", | |
66 "resource/resource_bundle_win.h", | |
67 "resource/resource_data_dll_win.cc", | |
68 "resource/resource_data_dll_win.h", | |
69 "resource/resource_handle.h", | |
70 "text/bytes_formatting.cc", | |
71 "text/bytes_formatting.h", | |
72 "touch/touch_device.h", | 26 "touch/touch_device.h", |
73 "touch/touch_enabled.cc", | 27 "touch/touch_enabled.cc", |
74 "touch/touch_enabled.h", | 28 "touch/touch_enabled.h", |
75 "ui_base_export.h", | 29 "ui_base_export.h", |
76 "ui_base_paths.cc", | 30 "ui_base_paths.cc", |
77 "ui_base_paths.h", | 31 "ui_base_paths.h", |
78 "ui_base_switches.cc", | 32 "ui_base_switches.cc", |
79 "ui_base_switches.h", | 33 "ui_base_switches.h", |
80 "ui_base_switches_util.cc", | 34 "ui_base_switches_util.cc", |
81 "ui_base_switches_util.h", | 35 "ui_base_switches_util.h", |
82 "ui_base_types.cc", | 36 "ui_base_types.cc", |
83 "ui_base_types.h", | 37 "ui_base_types.h", |
84 "view_prop.cc", | 38 "view_prop.cc", |
85 "view_prop.h", | 39 "view_prop.h", |
86 "win/accessibility_ids_win.h", | 40 "win/accessibility_ids_win.h", |
87 "win/accessibility_misc_utils.cc", | 41 "win/accessibility_misc_utils.cc", |
88 "win/accessibility_misc_utils.h", | 42 "win/accessibility_misc_utils.h", |
89 "win/atl_module.h", | 43 "win/atl_module.h", |
90 "win/dpi_setup.cc", | |
91 "win/dpi_setup.h", | |
92 "win/foreground_helper.cc", | 44 "win/foreground_helper.cc", |
93 "win/foreground_helper.h", | 45 "win/foreground_helper.h", |
94 "win/hidden_window.cc", | 46 "win/hidden_window.cc", |
95 "win/hidden_window.h", | 47 "win/hidden_window.h", |
96 "win/hwnd_subclass.cc", | 48 "win/hwnd_subclass.cc", |
97 "win/hwnd_subclass.h", | 49 "win/hwnd_subclass.h", |
98 "win/internal_constants.cc", | 50 "win/internal_constants.cc", |
99 "win/internal_constants.h", | 51 "win/internal_constants.h", |
100 "win/lock_state.cc", | 52 "win/lock_state.cc", |
101 "win/lock_state.h", | 53 "win/lock_state.h", |
(...skipping 10 matching lines...) Expand all Loading... |
112 "win/touch_input.cc", | 64 "win/touch_input.cc", |
113 "win/touch_input.h", | 65 "win/touch_input.h", |
114 "win/window_event_target.cc", | 66 "win/window_event_target.cc", |
115 "win/window_event_target.h", | 67 "win/window_event_target.h", |
116 ] | 68 ] |
117 | 69 |
118 if (is_win) { | 70 if (is_win) { |
119 sources += [ "touch/touch_device_win.cc" ] | 71 sources += [ "touch/touch_device_win.cc" ] |
120 } else if (is_android) { | 72 } else if (is_android) { |
121 sources += [ "touch/touch_device_android.cc" ] | 73 sources += [ "touch/touch_device_android.cc" ] |
122 } else if (use_aura && use_x11) { | 74 } else if (use_x11) { |
123 sources += [ "touch/touch_device_aurax11.cc" ] | 75 sources += [ "touch/touch_device_x11.cc" ] |
124 } else { | 76 } else { |
125 # Empty implementation for all other cases. | 77 # Empty implementation for all other cases. |
126 sources += [ "touch/touch_device.cc" ] | 78 sources += [ "touch/touch_device.cc" ] |
127 } | 79 } |
128 | 80 |
129 defines = [ "UI_BASE_IMPLEMENTATION" ] | 81 defines = [ "UI_BASE_IMPLEMENTATION" ] |
130 | 82 |
131 public_deps = [ | 83 public_deps = [ |
132 "//base", | 84 "//base", |
133 "//skia", | 85 "//skia", |
| 86 "//ui/events", |
134 "//ui/events/platform", | 87 "//ui/events/platform", |
135 "//ui/events:events_base", | 88 "//ui/events:events_base", |
136 "//ui/gfx", | 89 "//ui/gfx", |
137 "//ui/gfx/geometry", | 90 "//ui/gfx/geometry", |
138 ] | 91 ] |
139 deps = [ | 92 deps = [ |
140 "//base/third_party/dynamic_annotations", | 93 "//base/third_party/dynamic_annotations", |
141 "//base:base_static", | 94 "//base:base_static", |
142 "//base:i18n", | 95 "//base:i18n", |
143 "//net", | 96 "//net", |
144 "//third_party/icu", | 97 "//third_party/icu", |
145 "//ui/resources", | |
146 "//ui/strings", | |
147 "//url", | 98 "//url", |
148 ] | 99 ] |
149 | 100 |
150 if (use_aura) { | |
151 deps += [ "//ui/events" ] | |
152 } else { | |
153 sources -= [ | |
154 "cursor/cursor.cc", | |
155 "cursor/cursor.h", | |
156 ] | |
157 } | |
158 if (use_x11) { | 101 if (use_x11) { |
159 sources += [ | 102 sources += [ |
160 "x/x11_foreign_window_manager.cc", | 103 "x/x11_foreign_window_manager.cc", |
161 "x/x11_foreign_window_manager.h", | 104 "x/x11_foreign_window_manager.h", |
162 "x/x11_menu_list.cc", | 105 "x/x11_menu_list.cc", |
163 "x/x11_menu_list.h", | 106 "x/x11_menu_list.h", |
164 "x/x11_util.cc", | 107 "x/x11_util.cc", |
165 "x/x11_util.h", | 108 "x/x11_util.h", |
166 "x/x11_util_internal.h", | 109 "x/x11_util_internal.h", |
167 ] | 110 ] |
168 deps += [ "//ui/gfx/x" ] | 111 deps += [ "//ui/gfx/x" ] |
169 } | 112 } |
170 | 113 |
171 if (!use_aura || !is_linux) { | |
172 sources -= [ "resource/resource_bundle_auralinux.cc" ] | |
173 } | |
174 | |
175 if (is_linux) { | 114 if (is_linux) { |
176 configs += [ | 115 configs += [ |
177 "//build/config/linux:fontconfig", | 116 "//build/config/linux:fontconfig", |
178 "//build/config/linux:glib", | 117 "//build/config/linux:glib", |
179 ] | 118 ] |
180 } | 119 } |
181 | 120 |
182 libs = [] | 121 libs = [] |
183 if (is_win) { | 122 if (is_win) { |
184 sources += [ | |
185 "cursor/cursor_loader_win.cc", | |
186 "cursor/cursor_loader_win.h", | |
187 ] | |
188 cflags = [ | 123 cflags = [ |
189 "/wd4267", # TODO(jschuh): C4267: http://crbug.com/167187 size_t -> int. | 124 "/wd4267", # TODO(jschuh): C4267: http://crbug.com/167187 size_t -> int. |
190 "/wd4324", # Structure was padded due to __declspec(align()), which is | 125 "/wd4324", # Structure was padded due to __declspec(align()), which is |
191 # uninteresting. | 126 # uninteresting. |
192 ] | 127 ] |
193 ldflags = [ | 128 ldflags = [ |
194 "/DELAYLOAD:d2d1.dll", | 129 "/DELAYLOAD:d2d1.dll", |
195 "/DELAYLOAD:d3d10_1.dll", | 130 "/DELAYLOAD:d3d10_1.dll", |
196 "/DELAYLOAD:dwmapi.dll", | 131 "/DELAYLOAD:dwmapi.dll", |
197 ] | 132 ] |
(...skipping 25 matching lines...) Expand all Loading... |
223 | 158 |
224 if (use_x11) { | 159 if (use_x11) { |
225 #'all_dependent_settings': { | 160 #'all_dependent_settings': { |
226 #'ldflags': [ | 161 #'ldflags': [ |
227 #'-L<(PRODUCT_DIR)', | 162 #'-L<(PRODUCT_DIR)', |
228 #], | 163 #], |
229 #}, | 164 #}, |
230 configs += [ "//build/config/linux:x11" ] | 165 configs += [ "//build/config/linux:x11" ] |
231 } | 166 } |
232 | 167 |
233 if (use_x11) { | |
234 sources += [ | |
235 "cursor/cursor_loader_x11.cc", | |
236 "cursor/cursor_loader_x11.h", | |
237 "cursor/cursor_x11.cc", | |
238 ] | |
239 } | |
240 | |
241 if (is_android) { | 168 if (is_android) { |
242 sources -= [ | 169 sources -= [ "ui_base_types.cc" ] |
243 "l10n/l10n_font_util.cc", | |
244 "ui_base_types.cc", | |
245 ] | |
246 | 170 |
247 deps += [ ":ui_base_jni_headers" ] | 171 deps += [ ":ui_base_jni_headers" ] |
248 | 172 |
249 libs += [ "jnigraphics" ] | 173 libs += [ "jnigraphics" ] |
250 } | 174 } |
251 | 175 |
252 if (is_android && is_android_webview_build) { | 176 if (is_android && is_android_webview_build) { |
253 deps += [ | 177 deps += [ |
254 #TODO(GYP): port this component to GN. | 178 #TODO(GYP): port this component to GN. |
255 #"//ui/android:ui_java", | 179 #"//ui/android:ui_java", |
256 ] | 180 ] |
257 } | 181 } |
258 | |
259 if (is_android && !use_aura) { | |
260 sources -= [ "cursor/cursor_android.cc" ] | |
261 } | |
262 } | 182 } |
263 | 183 |
264 if (is_android) { | 184 if (is_android) { |
265 generate_jni("ui_base_jni_headers") { | 185 generate_jni("ui_base_jni_headers") { |
266 sources = [ | 186 sources = [ |
267 "../android/java/src/org/chromium/ui/base/DeviceFormFactor.java", | 187 "../android/java/src/org/chromium/ui/base/DeviceFormFactor.java", |
268 "../android/java/src/org/chromium/ui/base/LocalizationUtils.java", | |
269 "../android/java/src/org/chromium/ui/base/ResourceBundle.java", | |
270 "../android/java/src/org/chromium/ui/base/SelectFileDialog.java", | 188 "../android/java/src/org/chromium/ui/base/SelectFileDialog.java", |
271 "../android/java/src/org/chromium/ui/base/TouchDevice.java", | 189 "../android/java/src/org/chromium/ui/base/TouchDevice.java", |
272 "../android/java/src/org/chromium/ui/base/ViewAndroid.java", | 190 "../android/java/src/org/chromium/ui/base/ViewAndroid.java", |
273 "../android/java/src/org/chromium/ui/base/WindowAndroid.java", | 191 "../android/java/src/org/chromium/ui/base/WindowAndroid.java", |
274 ] | 192 ] |
275 jni_package = "base" | 193 jni_package = "base" |
276 } | 194 } |
277 } | 195 } |
278 | 196 |
279 if (false) { | 197 if (false) { |
280 # TODO(GYP): Make this work on Android and reenable it. | 198 # TODO(GYP): Make this work on Android and reenable it. |
281 if (!is_android) { | 199 if (!is_android) { |
282 # TODO(tfarina): Rename this target to ui_base_unittests. | 200 # TODO(tfarina): Rename this target to ui_base_unittests. |
283 # In order to do this we will need to keep this target, add a dummy | 201 # In order to do this we will need to keep this target, add a dummy |
284 # ui_base_unittests target that just points to ui_unittests, change | 202 # ui_base_unittests target that just points to ui_unittests, change |
285 # buildbot code to reference the new 'ui_base_unittests' target. | 203 # buildbot code to reference the new 'ui_base_unittests' target. |
286 # After buildbot is updated, we can make the changes in Chromium and | 204 # After buildbot is updated, we can make the changes in Chromium and |
287 # remove 'ui_unittests' target. crbug.com/331829 | 205 # remove 'ui_unittests' target. crbug.com/331829 |
288 # GYP version: ui/base/ui_base_tests.gyp:ui_unittests | 206 # GYP version: ui/base/ui_base_tests.gyp:ui_unittests |
289 test("ui_unittests") { | 207 test("ui_unittests") { |
290 sources = [ | 208 sources = [ |
291 "l10n/l10n_util_mac_unittest.mm", | |
292 "l10n/l10n_util_unittest.cc", | |
293 "l10n/l10n_util_win_unittest.cc", | |
294 "l10n/time_format_unittest.cc", | |
295 "layout_unittest.cc", | 209 "layout_unittest.cc", |
296 "models/tree_node_iterator_unittest.cc", | |
297 "resource/data_pack_literal.cc", | |
298 "resource/data_pack_unittest.cc", | |
299 "resource/resource_bundle_unittest.cc", | |
300 "test/run_all_unittests.cc", | 210 "test/run_all_unittests.cc", |
301 ] | 211 ] |
302 | 212 |
303 sources += [ | 213 sources += [ |
304 "accelerators/accelerator_manager_unittest.cc", | 214 "accelerators/accelerator_manager_unittest.cc", |
305 "accelerators/menu_label_accelerator_util_linux_unittest.cc", | 215 "accelerators/menu_label_accelerator_util_linux_unittest.cc", |
306 "models/list_model_unittest.cc", | |
307 "models/list_selection_model_unittest.cc", | |
308 "models/tree_node_model_unittest.cc", | |
309 "test/data/resource.h", | 216 "test/data/resource.h", |
310 "text/bytes_formatting_unittest.cc", | |
311 "view_prop_unittest.cc", | 217 "view_prop_unittest.cc", |
312 ] | 218 ] |
313 | 219 |
314 deps = [ | 220 deps = [ |
315 "//base", | 221 "//base", |
316 "//base/allocator", | 222 "//base/allocator", |
317 "//base/test:test_support", | 223 "//base/test:test_support", |
318 "//net", | 224 "//net", |
319 "//skia", | 225 "//skia", |
320 "//testing/gmock", | 226 "//testing/gmock", |
321 "//testing/gtest", | 227 "//testing/gtest", |
322 "//third_party/icu", | 228 "//third_party/icu", |
323 "//ui/base", | 229 "//ui/base", |
324 "//ui/events:events_base", | 230 "//ui/events:events_base", |
325 "//ui/events:test_support", | 231 "//ui/events:test_support", |
326 "//ui/gfx:test_support", | 232 "//ui/gfx:test_support", |
327 "//ui/resources", | |
328 "//ui/resources:ui_test_pak", | |
329 "//ui/strings", | |
330 "//url", | 233 "//url", |
331 ] | 234 ] |
332 | 235 |
333 if (is_win) { | 236 if (is_win) { |
334 sources += [ | 237 sources += [ |
335 "win/hwnd_subclass_unittest.cc", | 238 "win/hwnd_subclass_unittest.cc", |
336 "win/open_file_name_win_unittest.cc", | 239 "win/open_file_name_win_unittest.cc", |
337 ] | 240 ] |
338 | 241 |
339 ldflags = [ | 242 ldflags = [ |
(...skipping 15 matching lines...) Expand all Loading... |
355 deps += [ | 258 deps += [ |
356 #"testing/android/native_test.gyp:native_test_native_code" TODO(GYP) | 259 #"testing/android/native_test.gyp:native_test_native_code" TODO(GYP) |
357 ] | 260 ] |
358 } | 261 } |
359 | 262 |
360 if (use_pango) { | 263 if (use_pango) { |
361 configs += [ "//build/config/linux:pangocairo" ] | 264 configs += [ "//build/config/linux:pangocairo" ] |
362 } | 265 } |
363 | 266 |
364 if (use_x11) { | 267 if (use_x11) { |
365 sources += [ "cursor/cursor_loader_x11_unittest.cc" ] | |
366 | |
367 configs += [ "//build/config/linux:x11" ] | 268 configs += [ "//build/config/linux:x11" ] |
368 | 269 |
369 deps += [ | 270 deps += [ |
370 "//ui/events/platform/x11", | 271 "//ui/events/platform/x11", |
371 "//ui/gfx/x", | 272 "//ui/gfx/x", |
372 ] | 273 ] |
373 | 274 |
374 datadeps = [ | 275 datadeps = [ |
375 "//tools/xdisplaycheck", | 276 "//tools/xdisplaycheck", |
376 ] | 277 ] |
377 } | 278 } |
378 | 279 |
379 if (!is_win || !use_aura) { | 280 if (!is_win) { |
380 sources -= [ "view_prop_unittest.cc" ] | 281 sources -= [ "view_prop_unittest.cc" ] |
381 } | 282 } |
382 | 283 |
383 if (is_mac) { | 284 if (is_mac) { |
384 deps += [ | 285 deps += [ |
385 "//third_party/mozilla", | 286 "//third_party/mozilla", |
386 #'ui_unittests_bundle', TODO(GYP) | 287 #'ui_unittests_bundle', TODO(GYP) |
387 ] | 288 ] |
388 } | 289 } |
389 | 290 |
390 if (is_chromeos) { | 291 if (is_chromeos) { |
391 sources += [ "../chromeos/touch_exploration_controller_unittest.cc" ] | 292 sources += [ "../chromeos/touch_exploration_controller_unittest.cc" ] |
392 deps += [ | 293 deps += [ |
393 "//chromeos", | 294 "//chromeos", |
394 "//ui/aura:test_support", | 295 "//ui/aura:test_support", |
395 "//ui/events:gesture_detection", | 296 "//ui/events:gesture_detection", |
396 "//ui/chromeos:ui_chromeos", | 297 "//ui/chromeos:ui_chromeos", |
397 ] | 298 ] |
398 } | 299 } |
399 } | 300 } |
400 } | 301 } |
401 } | 302 } |
402 # TODO(GYP) Mac (ui_unittest_bundle) and Android (ui_unittests_apk). | 303 # TODO(GYP) Mac (ui_unittest_bundle) and Android (ui_unittests_apk). |
OLD | NEW |