Roll src/third_party/WebKit 4526c29:30f3df0 (svn 190187:190189)
[chromium-blink-merge.git] / ui / base / BUILD.gn
blobd6effd4c1fe255e5c2c49ecee9d1d76bdda9c83a
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 if (is_android) {
9   import("//build/config/android/config.gni")
10   import("//build/config/android/rules.gni")
13 build_ime = !is_ios
15 component("base") {
16   output_name = "ui_base"
17   sources = [
18     "accelerators/accelerator.cc",
19     "accelerators/accelerator.h",
20     "accelerators/accelerator_history.cc",
21     "accelerators/accelerator_history.h",
22     "accelerators/accelerator_manager.cc",
23     "accelerators/accelerator_manager.h",
24     "accelerators/menu_label_accelerator_util_linux.cc",
25     "accelerators/menu_label_accelerator_util_linux.h",
26     "accelerators/platform_accelerator.h",
27     "accelerators/platform_accelerator_cocoa.h",
28     "accelerators/platform_accelerator_cocoa.mm",
29     "android/ui_base_jni_registrar.cc",
30     "android/ui_base_jni_registrar.h",
31     "android/view_android.cc",
32     "android/view_android.h",
33     "android/window_android.cc",
34     "android/window_android.h",
35     "android/window_android_compositor.h",
36     "android/window_android_observer.h",
37     "base_window.cc",
38     "base_window.h",
39     "clipboard/clipboard.cc",
40     "clipboard/clipboard.h",
41     "clipboard/clipboard_android.cc",
42     "clipboard/clipboard_android.h",
43     "clipboard/clipboard_constants.cc",
44     "clipboard/clipboard_mac.h",
45     "clipboard/clipboard_mac.mm",
46     "clipboard/clipboard_types.h",
47     "clipboard/clipboard_util_win.cc",
48     "clipboard/clipboard_util_win.h",
49     "clipboard/clipboard_win.cc",
50     "clipboard/clipboard_win.h",
51     "clipboard/custom_data_helper.cc",
52     "clipboard/custom_data_helper.h",
53     "clipboard/custom_data_helper_linux.cc",
54     "clipboard/custom_data_helper_mac.mm",
55     "clipboard/scoped_clipboard_writer.cc",
56     "clipboard/scoped_clipboard_writer.h",
57     "cocoa/animation_utils.h",
58     "cocoa/appkit_utils.h",
59     "cocoa/appkit_utils.mm",
60     "cocoa/base_view.h",
61     "cocoa/base_view.mm",
62     "cocoa/cocoa_base_utils.h",
63     "cocoa/cocoa_base_utils.mm",
64     "cocoa/controls/blue_label_button.h",
65     "cocoa/controls/blue_label_button.mm",
66     "cocoa/controls/hover_image_menu_button.h",
67     "cocoa/controls/hover_image_menu_button.mm",
68     "cocoa/controls/hover_image_menu_button_cell.h",
69     "cocoa/controls/hover_image_menu_button_cell.mm",
70     "cocoa/controls/hyperlink_button_cell.h",
71     "cocoa/controls/hyperlink_button_cell.mm",
72     "cocoa/controls/hyperlink_text_view.h",
73     "cocoa/controls/hyperlink_text_view.mm",
74     "cocoa/find_pasteboard.h",
75     "cocoa/find_pasteboard.mm",
76     "cocoa/flipped_view.h",
77     "cocoa/flipped_view.mm",
78     "cocoa/focus_tracker.h",
79     "cocoa/focus_tracker.mm",
80     "cocoa/focus_window_set.h",
81     "cocoa/focus_window_set.mm",
82     "cocoa/fullscreen_window_manager.h",
83     "cocoa/fullscreen_window_manager.mm",
84     "cocoa/hover_button.h",
85     "cocoa/hover_button.mm",
86     "cocoa/hover_image_button.h",
87     "cocoa/hover_image_button.mm",
88     "cocoa/menu_controller.h",
89     "cocoa/menu_controller.mm",
90     "cocoa/nib_loading.h",
91     "cocoa/nib_loading.mm",
92     "cocoa/nsgraphics_context_additions.h",
93     "cocoa/nsgraphics_context_additions.mm",
94     "cocoa/nsview_additions.h",
95     "cocoa/nsview_additions.mm",
96     "cocoa/remote_layer_api.h",
97     "cocoa/remote_layer_api.mm",
98     "cocoa/three_part_image.h",
99     "cocoa/three_part_image.mm",
100     "cocoa/tracking_area.h",
101     "cocoa/tracking_area.mm",
102     "cocoa/underlay_opengl_hosting_window.h",
103     "cocoa/underlay_opengl_hosting_window.mm",
104     "cocoa/view_description.h",
105     "cocoa/view_description.mm",
106     "cocoa/window_size_constants.h",
107     "cocoa/window_size_constants.mm",
108     "cursor/cursor.cc",
109     "cursor/cursor.h",
110     "cursor/cursor_android.cc",
111     "cursor/cursor_loader.h",
112     "cursor/cursor_util.cc",
113     "cursor/cursor_util.h",
114     "cursor/cursor_win.cc",
115     "cursor/cursors_aura.cc",
116     "cursor/cursors_aura.h",
117     "cursor/image_cursors.cc",
118     "cursor/image_cursors.h",
119     "default_theme_provider.cc",
120     "default_theme_provider.h",
121     "default_theme_provider_mac.mm",
122     "device_form_factor_android.cc",
123     "device_form_factor_android.h",
124     "device_form_factor_desktop.cc",
125     "device_form_factor_ios.mm",
126     "device_form_factor.h",
127     "dragdrop/cocoa_dnd_util.h",
128     "dragdrop/cocoa_dnd_util.mm",
129     "dragdrop/drag_drop_types.h",
130     "dragdrop/drag_drop_types_win.cc",
131     "dragdrop/drag_source_win.cc",
132     "dragdrop/drag_source_win.h",
133     "dragdrop/drag_utils.cc",
134     "dragdrop/drag_utils.h",
135     "dragdrop/drag_utils_aura.cc",
136     "dragdrop/drag_utils_mac.mm",
137     "dragdrop/drag_utils_win.cc",
138     "dragdrop/drop_target_event.cc",
139     "dragdrop/drop_target_event.h",
140     "dragdrop/drop_target_win.cc",
141     "dragdrop/drop_target_win.h",
142     "dragdrop/file_info.cc",
143     "dragdrop/file_info.h",
144     "dragdrop/os_exchange_data.cc",
145     "dragdrop/os_exchange_data.h",
146     "dragdrop/os_exchange_data_provider_mac.h",
147     "dragdrop/os_exchange_data_provider_mac.mm",
148     "dragdrop/os_exchange_data_provider_win.cc",
149     "dragdrop/os_exchange_data_provider_win.h",
150     "font_helper_chromeos.cc",
151     "font_helper_chromeos.h",
152     "hit_test.h",
153     "idle/idle.cc",
154     "idle/idle_chromeos.cc",
155     "idle/idle.h",
156     "idle/idle_linux.cc",
157     "idle/idle_mac.mm",
158     "idle/idle_win.cc",
159     "l10n/formatter.cc",
160     "l10n/formatter.h",
161     "l10n/l10n_font_util.cc",
162     "l10n/l10n_font_util.h",
163     "l10n/l10n_util.cc",
164     "l10n/l10n_util.h",
165     "l10n/l10n_util_android.cc",
166     "l10n/l10n_util_android.h",
167     "l10n/l10n_util_collator.h",
168     "l10n/l10n_util_mac.h",
169     "l10n/l10n_util_mac.mm",
170     "l10n/l10n_util_plurals.cc",
171     "l10n/l10n_util_plurals.h",
172     "l10n/l10n_util_posix.cc",
173     "l10n/l10n_util_win.cc",
174     "l10n/l10n_util_win.h",
175     "l10n/time_format.cc",
176     "l10n/time_format.h",
177     "layout.cc",
178     "layout.h",
179     "layout_mac.mm",
180     "models/button_menu_item_model.cc",
181     "models/button_menu_item_model.h",
182     "models/combobox_model.cc",
183     "models/combobox_model.h",
184     "models/combobox_model_observer.h",
185     "models/dialog_model.cc",
186     "models/dialog_model.h",
187     "models/list_model.h",
188     "models/list_model_observer.h",
189     "models/list_selection_model.cc",
190     "models/list_selection_model.h",
191     "models/menu_model.cc",
192     "models/menu_model.h",
193     "models/menu_model_delegate.h",
194     "models/menu_separator_types.h",
195     "models/simple_combobox_model.cc",
196     "models/simple_combobox_model.h",
197     "models/simple_menu_model.cc",
198     "models/simple_menu_model.h",
199     "models/table_model.cc",
200     "models/table_model.h",
201     "models/table_model_observer.h",
202     "models/tree_model.cc",
203     "models/tree_model.h",
204     "models/tree_node_iterator.h",
205     "models/tree_node_model.h",
206     "nine_image_painter_factory.cc",
207     "nine_image_painter_factory.h",
208     "page_transition_types.cc",
209     "page_transition_types.h",
210     "resource/data_pack.cc",
211     "resource/data_pack.h",
212     "resource/resource_bundle.cc",
213     "resource/resource_bundle.h",
214     "resource/resource_bundle_android.cc",
215     "resource/resource_bundle_auralinux.cc",
216     "resource/resource_bundle_ios.mm",
217     "resource/resource_bundle_mac.mm",
218     "resource/resource_bundle_win.cc",
219     "resource/resource_bundle_win.h",
220     "resource/resource_data_dll_win.cc",
221     "resource/resource_data_dll_win.h",
222     "resource/resource_handle.h",
223     "text/bytes_formatting.cc",
224     "text/bytes_formatting.h",
225     "theme_provider.cc",
226     "theme_provider.h",
227     "touch/selection_bound.cc",
228     "touch/selection_bound.h",
229     "touch/touch_device.h",
230     "touch/touch_editing_controller.cc",
231     "touch/touch_editing_controller.h",
232     "touch/touch_enabled.cc",
233     "touch/touch_enabled.h",
234     "ui_base_export.h",
235     "ui_base_exports.cc",
236     "ui_base_paths.cc",
237     "ui_base_paths.h",
238     "ui_base_switches.cc",
239     "ui_base_switches.h",
240     "ui_base_switches_util.cc",
241     "ui_base_switches_util.h",
242     "ui_base_types.cc",
243     "ui_base_types.h",
244     "user_activity/user_activity_detector.cc",
245     "user_activity/user_activity_detector.h",
246     "user_activity/user_activity_observer.h",
247     "view_prop.cc",
248     "view_prop.h",
249     "webui/jstemplate_builder.cc",
250     "webui/jstemplate_builder.h",
251     "webui/web_ui_util.cc",
252     "webui/web_ui_util.h",
253     "win/accessibility_ids_win.h",
254     "win/accessibility_misc_utils.cc",
255     "win/accessibility_misc_utils.h",
256     "win/atl_module.h",
257     "win/foreground_helper.cc",
258     "win/foreground_helper.h",
259     "win/hidden_window.cc",
260     "win/hidden_window.h",
261     "win/hwnd_subclass.cc",
262     "win/hwnd_subclass.h",
263     "win/internal_constants.cc",
264     "win/internal_constants.h",
265     "win/lock_state.cc",
266     "win/lock_state.h",
267     "win/open_file_name_win.cc",
268     "win/open_file_name_win.h",
269     "win/message_box_win.cc",
270     "win/message_box_win.h",
271     "win/mouse_wheel_util.cc",
272     "win/mouse_wheel_util.h",
273     "win/scoped_ole_initializer.cc",
274     "win/scoped_ole_initializer.h",
275     "win/shell.cc",
276     "win/shell.h",
277     "win/touch_input.cc",
278     "win/touch_input.h",
279     "win/window_event_target.cc",
280     "win/window_event_target.h",
281     "window_open_disposition.cc",
282     "window_open_disposition.h",
283     "work_area_watcher_observer.h",
284   ]
286   if (is_win) {
287     sources += [ "touch/touch_device_win.cc" ]
288   } else if (is_android) {
289     sources += [ "touch/touch_device_android.cc" ]
290   } else if (is_linux) {
291     sources += [ "touch/touch_device_linux.cc" ]
292   } else {
293     # Empty implementation for all other cases.
294     sources += [ "touch/touch_device.cc" ]
295   }
297   defines = [ "UI_BASE_IMPLEMENTATION" ]
299   public_deps = [
300     "//base",
301     "//skia",
302     "//ui/events/platform",
303     "//ui/events:events_base",
304     "//ui/gfx",
305     "//ui/gfx/geometry",
306   ]
307   deps = [
308     "//base/third_party/dynamic_annotations",
309     "//base:base_static",
310     "//base:i18n",
311     "//cc",
312     "//net",
313     "//third_party/icu",
314     "//ui/events",
315     "//ui/events/devices",
316     "//ui/resources",
317     "//ui/strings",
318     "//url",
319   ]
321   if (is_ios) {
322     sources += [
323       "l10n/l10n_util_mac.h",
324       "l10n/l10n_util_mac.mm",
325     ]
326   }
328   if (toolkit_views) {
329     deps += [ "//ui/events" ]
330   }
332   if (use_x11 && use_aura) {
333     sources += [
334       "x/selection_owner.cc",
335       "x/selection_owner.h",
336       "x/selection_requestor.cc",
337       "x/selection_requestor.h",
338       "x/selection_utils.cc",
339       "x/selection_utils.h",
340     ]
341   }
343   if (use_aura) {
344     deps += [ "//ui/events" ]
345   } else {
346     sources -= [
347       "cursor/cursor.cc",
348       "cursor/cursor.h",
349       "dragdrop/drag_utils_aura.cc",
350     ]
351   }
352   if (use_x11) {
353     sources += [
354       "x/x11_foreign_window_manager.cc",
355       "x/x11_foreign_window_manager.h",
356       "x/x11_menu_list.cc",
357       "x/x11_menu_list.h",
358       "x/x11_util.cc",
359       "x/x11_util.h",
360       "x/x11_util_internal.h",
361     ]
362     if (!is_chromeos) {
363       sources += [
364         "idle/idle_query_x11.cc",
365         "idle/idle_query_x11.h",
366         "idle/screensaver_window_finder_x11.cc",
367         "idle/screensaver_window_finder_x11.h",
368       ]
369       configs += [ "//build/config/linux:xscrnsaver" ]
370     }
371     deps += [ "//ui/gfx/x" ]
372   }
374   if (!use_aura || !is_linux) {
375     sources -= [ "resource/resource_bundle_auralinux.cc" ]
376   }
378   if (use_aura && is_win) {
379     sources -= [ "dragdrop/drag_utils_aura.cc" ]
380   }
382   if (is_linux) {
383     configs += [
384       "//build/config/linux:fontconfig",
385       "//build/config/linux:glib",
386     ]
387   }
389   if ((is_linux && !is_chromeos) || is_chromeos) {
390     if (!toolkit_views && !use_aura) {
391       sources -= [
392         "dragdrop/drag_utils.cc",
393         "dragdrop/drag_utils.h",
394       ]
395     }
396   }
398   if (is_chromeos) {
399     deps += [ "//chromeos" ]
400     sources -= [ "idle/idle_linux.cc" ]
401   }
403   if (is_chromeos || (use_aura && is_linux && !use_x11)) {
404     sources += [
405       "dragdrop/os_exchange_data_provider_aura.cc",
406       "dragdrop/os_exchange_data_provider_aura.h",
407     ]
408   }
410   libs = []
411   if (is_win) {
412     sources += [
413       "cursor/cursor_loader_win.cc",
414       "cursor/cursor_loader_win.h",
415     ]
416     deps += [ "//third_party/wtl" ]
417     cflags = [
418       "/wd4267",  # TODO(jschuh): C4267: http://crbug.com/167187 size_t -> int.
419       "/wd4324",  # Structure was padded due to __declspec(align()), which is
420                   # uninteresting.
421     ]
422     ldflags = [
423       "/DELAYLOAD:d2d1.dll",
424       "/DELAYLOAD:d3d10_1.dll",
425       "/DELAYLOAD:dwmapi.dll",
426     ]
427     libs += [
428       "d2d1.lib",
429       "d3d10_1.lib",
430       "dwmapi.lib",
431       "d2d1.lib",
432       "dwmapi.lib",
433       "oleacc.lib",
434     ]
435   } else {
436     if (!use_aura) {
437       sources -= [
438         "view_prop.cc",
439         "view_prop.h",
440       ]
441     }
442   }
444   if (is_mac) {
445     deps += [ "//third_party/mozilla" ]
447     sources -= [
448       "cursor/image_cursors.cc",
449       "cursor/image_cursors.h",
450       "dragdrop/drag_utils.cc",
451       "dragdrop/drag_utils.h",
452     ]
454     libs += [
455       "Accelerate.framework",
456       "AudioUnit.framework",
457       "CoreVideo.framework",
458     ]
459   }
461   if (use_x11) {
462     #'all_dependent_settings': {
463     #'ldflags': [
464     #'-L<(PRODUCT_DIR)',
465     #],
466     #},
467     configs += [ "//build/config/linux:x11" ]
468   }
470   if (use_aura) {
471     if (use_x11) {
472       sources += [
473         "cursor/cursor_loader_x11.cc",
474         "cursor/cursor_loader_x11.h",
475         "cursor/cursor_x11.cc",
476       ]
477       if (!is_chromeos) {
478         # These Aura X11 files aren't used on ChromeOS.
479         sources += [
480           "dragdrop/os_exchange_data_provider_aurax11.cc",
481           "dragdrop/os_exchange_data_provider_aurax11.h",
482         ]
483       }
484     }
485   }
486   if (use_ozone) {
487     sources += [
488       "cursor/cursor_loader_ozone.cc",
489       "cursor/cursor_loader_ozone.h",
490       "cursor/cursor_ozone.cc",
491       "cursor/ozone/bitmap_cursor_factory_ozone.cc",
492       "cursor/ozone/bitmap_cursor_factory_ozone.h",
493     ]
495     deps += [
496       "//ui/events/ozone:events_ozone_layout",
497       "//ui/ozone:ozone_base",
498     ]
499   }
501   if (!toolkit_views) {
502     sources -= [
503       "dragdrop/drag_drop_types.h",
504       "dragdrop/drop_target_event.cc",
505       "dragdrop/drop_target_event.h",
506     ]
507   }
509   if (!toolkit_views && !use_aura) {
510     sources -= [
511       "dragdrop/os_exchange_data.cc",
512       "dragdrop/os_exchange_data.h",
513       "nine_image_painter_factory.cc",
514       "nine_image_painter_factory.h",
515     ]
516   }
518   if (is_android) {
519     sources -= [
520       "cursor/image_cursors.cc",
521       "cursor/image_cursors.h",
522       "default_theme_provider.cc",
523       "dragdrop/drag_utils.cc",
524       "dragdrop/drag_utils.h",
525       "l10n/l10n_font_util.cc",
526       "models/button_menu_item_model.cc",
527       "models/dialog_model.cc",
528       "theme_provider.cc",
529       "touch/touch_editing_controller.cc",
530       "ui_base_types.cc",
531     ]
533     deps += [ ":ui_base_jni_headers" ]
535     libs += [ "jnigraphics" ]
536   }
538   if (is_android && is_android_webview_build) {
539     deps += [ "//ui/android:ui_java" ]
540   }
542   if (is_android && !use_aura) {
543     sources -= [ "cursor/cursor_android.cc" ]
544   }
546   # Aura clipboard.
547   if (use_aura) {
548     if (use_x11) {
549       sources += [ "clipboard/clipboard_aurax11.cc" ]
550     } else if (!is_win) {
551       # This file is used for all non-X11, non-Windows aura Builds.
552       sources += [ "clipboard/clipboard_aura.cc" ]
553     }
554   }
556   if (is_android || is_ios) {
557     sources -= [
558       "device_form_factor_desktop.cc",
559       "idle/idle.cc",
560       "idle/idle.h",
561     ]
562   }
565 source_set("test_support") {
566   testonly = true
567   sources = [
568     "test/test_clipboard.cc",
569     "test/test_clipboard.h",
570     "test/ui_controls.h",
571     "test/ui_controls_aura.cc",
572     "test/ui_controls_internal_win.cc",
573     "test/ui_controls_internal_win.h",
574     "test/ui_controls_mac.mm",
575     "test/ui_controls_win.cc",
576   ]
578   public_deps = [
579     ":base",
580   ]
581   deps = [
582     "//base",
583     "//skia",
584     "//testing/gtest",
585     "//ui/events:events_base",
586     "//ui/gfx",
587     "//ui/gfx/geometry",
588   ]
590   if (build_ime) {
591     sources += [
592       "ime/dummy_input_method.cc",
593       "ime/dummy_input_method.h",
594       "ime/dummy_text_input_client.cc",
595       "ime/dummy_text_input_client.h",
596     ]
598     deps += [ "//ui/base/ime" ]
599   }
601   if (!use_aura) {
602     sources -= [ "test/ui_controls_aura.cc" ]
603   } else if (is_win) {
604     sources -= [ "test/ui_controls_win.cc" ]
605   }
608 if (is_android) {
609   generate_jni("ui_base_jni_headers") {
610     sources = [
611       "../android/java/src/org/chromium/ui/base/Clipboard.java",
612       "../android/java/src/org/chromium/ui/base/DeviceFormFactor.java",
613       "../android/java/src/org/chromium/ui/base/LocalizationUtils.java",
614       "../android/java/src/org/chromium/ui/base/ResourceBundle.java",
615       "../android/java/src/org/chromium/ui/base/SelectFileDialog.java",
616       "../android/java/src/org/chromium/ui/base/TouchDevice.java",
617       "../android/java/src/org/chromium/ui/base/ViewAndroid.java",
618       "../android/java/src/org/chromium/ui/base/WindowAndroid.java",
619     ]
620     jni_package = "base"
621   }
624 # GYP version: ui/base/ui_base_tests.gyp:ui_base_unittests
625 test("ui_base_unittests") {
626   sources = [
627     "l10n/l10n_util_mac_unittest.mm",
628     "l10n/l10n_util_unittest.cc",
629     "l10n/l10n_util_win_unittest.cc",
630     "l10n/time_format_unittest.cc",
631     "layout_unittest.cc",
632     "models/tree_node_iterator_unittest.cc",
633     "resource/data_pack_literal.cc",
634     "resource/data_pack_unittest.cc",
635     "resource/resource_bundle_unittest.cc",
636     "test/test_clipboard_unittest.cc",
637     "test/run_all_unittests.cc",
638     "user_activity/user_activity_detector_unittest.cc",
639   ]
641   if (is_android) {
642     sources -= [ "user_activity/user_activity_detector_unittest.cc" ]
643   }
645   if (is_ios) {
646     # Compile this Mac file on iOS as well.
647     set_sources_assignment_filter([])
648     sources += [ "l10n/l10n_util_mac_unittest.mm" ]
649     set_sources_assignment_filter(sources_assignment_filter)
650   } else {  # !is_ios
651     sources += [
652       "accelerators/accelerator_manager_unittest.cc",
653       "accelerators/menu_label_accelerator_util_linux_unittest.cc",
654       "clipboard/custom_data_helper_unittest.cc",
655       "cocoa/base_view_unittest.mm",
656       "cocoa/cocoa_base_utils_unittest.mm",
657       "cocoa/controls/blue_label_button_unittest.mm",
658       "cocoa/controls/hover_image_menu_button_unittest.mm",
659       "cocoa/controls/hyperlink_button_cell_unittest.mm",
660       "cocoa/controls/hyperlink_text_view_unittest.mm",
661       "cocoa/focus_tracker_unittest.mm",
662       "cocoa/fullscreen_window_manager_unittest.mm",
663       "cocoa/hover_image_button_unittest.mm",
664       "cocoa/menu_controller_unittest.mm",
665       "cocoa/nsgraphics_context_additions_unittest.mm",
666       "cocoa/nsview_additions_unittest.mm",
667       "cocoa/three_part_image_unittest.mm",
668       "cocoa/tracking_area_unittest.mm",
669       "models/list_model_unittest.cc",
670       "models/list_selection_model_unittest.cc",
671       "models/tree_node_model_unittest.cc",
672       "test/data/resource.h",
673       "text/bytes_formatting_unittest.cc",
674       "touch/selection_bound_unittest.cc",
675       "view_prop_unittest.cc",
676       "webui/web_ui_util_unittest.cc",
677     ]
678   }
680   if (build_ime) {
681     sources += [
682       "ime/candidate_window_unittest.cc",
683       "ime/chromeos/character_composer_unittest.cc",
684       "ime/input_method_base_unittest.cc",
685       "ime/input_method_chromeos_unittest.cc",
686       "ime/remote_input_method_win_unittest.cc",
687       "ime/win/imm32_manager_unittest.cc",
688       "ime/win/tsf_input_scope_unittest.cc",
689     ]
690     if (use_x11) {
691       sources += [ "ime/composition_text_util_pango_unittest.cc" ]
692     }
693     if (!use_x11 && is_chromeos) {
694       # These were already removed in the non-chromeos case.
695       sources -= [
696         "ime/chromeos/character_composer_unittest.cc",
697         "ime/input_method_chromeos_unittest.cc",
698       ]
699     }
700   }
702   deps = [
703     "//base",
704     "//base/allocator",
705     "//base/test:test_support",
706     "//net",
707     "//skia",
708     "//testing/gmock",
709     "//testing/gtest",
710     "//third_party/icu",
711     "//ui/base",
712     "//ui/base:test_support",
713     "//ui/events:events_base",
714     "//ui/events:test_support",
715     "//ui/gfx:test_support",
716     "//ui/resources",
717     "//ui/resources:ui_test_pak",
718     "//ui/strings",
719     "//url",
720   ]
722   if (is_ios) {
723     # TODO(GYP) lots of iOS-only steps for ui_base_unittests
724   }
726   if (build_ime) {
727     deps += [ "//ui/base/ime" ]
728   }
730   if (is_win) {
731     sources += [
732       "dragdrop/os_exchange_data_win_unittest.cc",
733       "win/hwnd_subclass_unittest.cc",
734       "win/open_file_name_win_unittest.cc",
735     ]
737     ldflags = [
738       "/DELAYLOAD:d2d1.dll",
739       "/DELAYLOAD:d3d10_1.dll",
740     ]
741     libs = [
742       "d2d1.lib",
743       "d3d10_1.lib",
744       "imm32.lib",
745       "oleacc.lib",
746     ]
748     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
749     cflags = [ "/wd4267" ]
750   }
752   if (!is_win || !use_aura) {
753     sources -= [ "view_prop_unittest.cc" ]
754   }
756   if (is_android) {
757     apk_deps = [ "//chrome:resources" ]
758   }
760   if (use_pango) {
761     configs += [ "//build/config/linux:pangocairo" ]
762   }
764   if (use_x11) {
765     sources += [ "cursor/cursor_loader_x11_unittest.cc" ]
767     configs += [ "//build/config/linux:x11" ]
769     deps += [
770       "//ui/events/platform/x11",
771       "//ui/gfx/x",
772     ]
774     datadeps = [
775       "//tools/xdisplaycheck",
776     ]
777   }
779   if (is_mac) {
780     deps += [
781       "//third_party/mozilla",
782       #'ui_base_tests_bundle',  TODO(GYP)
783     ]
784   }
786   if (use_aura || toolkit_views) {
787     sources += [ "dragdrop/os_exchange_data_unittest.cc" ]
789     deps += [
790       "//ui/events",
791       "//ui/events/platform",
792     ]
793   }
795   if (use_x11 && !is_chromeos) {
796     sources += [
797       "dragdrop/os_exchange_data_provider_aurax11_unittest.cc",
798       "x/selection_requestor_unittest.cc",
799     ]
800   }
802   if (is_chromeos) {
803     deps += [
804       "//chromeos",
805       "//ui/events:dom4_keycode_converter",
806     ]
807   }
809 # TODO(GYP) Mac (ui_base_tests_bundle)