Moved --top-chrome-md command line switch from chrome_switches to ui_base_switches.
[chromium-blink-merge.git] / ui / base / BUILD.gn
blob259672db8a3ec125af2fe102fb97bf3abb34b1ce
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     "base_window.cc",
32     "base_window.h",
33     "clipboard/clipboard.cc",
34     "clipboard/clipboard.h",
35     "clipboard/clipboard_android.cc",
36     "clipboard/clipboard_android.h",
37     "clipboard/clipboard_constants.cc",
38     "clipboard/clipboard_mac.h",
39     "clipboard/clipboard_mac.mm",
40     "clipboard/clipboard_types.h",
41     "clipboard/clipboard_util_win.cc",
42     "clipboard/clipboard_util_win.h",
43     "clipboard/clipboard_win.cc",
44     "clipboard/clipboard_win.h",
45     "clipboard/custom_data_helper.cc",
46     "clipboard/custom_data_helper.h",
47     "clipboard/custom_data_helper_linux.cc",
48     "clipboard/custom_data_helper_mac.mm",
49     "clipboard/scoped_clipboard_writer.cc",
50     "clipboard/scoped_clipboard_writer.h",
51     "cocoa/animation_utils.h",
52     "cocoa/appkit_utils.h",
53     "cocoa/appkit_utils.mm",
54     "cocoa/base_view.h",
55     "cocoa/base_view.mm",
56     "cocoa/cocoa_base_utils.h",
57     "cocoa/cocoa_base_utils.mm",
58     "cocoa/constrained_window/constrained_window_animation.h",
59     "cocoa/constrained_window/constrained_window_animation.mm",
60     "cocoa/controls/blue_label_button.h",
61     "cocoa/controls/blue_label_button.mm",
62     "cocoa/controls/hover_image_menu_button.h",
63     "cocoa/controls/hover_image_menu_button.mm",
64     "cocoa/controls/hover_image_menu_button_cell.h",
65     "cocoa/controls/hover_image_menu_button_cell.mm",
66     "cocoa/controls/hyperlink_button_cell.h",
67     "cocoa/controls/hyperlink_button_cell.mm",
68     "cocoa/controls/hyperlink_text_view.h",
69     "cocoa/controls/hyperlink_text_view.mm",
70     "cocoa/find_pasteboard.h",
71     "cocoa/find_pasteboard.mm",
72     "cocoa/flipped_view.h",
73     "cocoa/flipped_view.mm",
74     "cocoa/focus_tracker.h",
75     "cocoa/focus_tracker.mm",
76     "cocoa/focus_window_set.h",
77     "cocoa/focus_window_set.mm",
78     "cocoa/fullscreen_window_manager.h",
79     "cocoa/fullscreen_window_manager.mm",
80     "cocoa/hover_button.h",
81     "cocoa/hover_button.mm",
82     "cocoa/hover_image_button.h",
83     "cocoa/hover_image_button.mm",
84     "cocoa/menu_controller.h",
85     "cocoa/menu_controller.mm",
86     "cocoa/nib_loading.h",
87     "cocoa/nib_loading.mm",
88     "cocoa/nsgraphics_context_additions.h",
89     "cocoa/nsgraphics_context_additions.mm",
90     "cocoa/nsview_additions.h",
91     "cocoa/nsview_additions.mm",
92     "cocoa/remote_layer_api.h",
93     "cocoa/remote_layer_api.mm",
94     "cocoa/three_part_image.h",
95     "cocoa/three_part_image.mm",
96     "cocoa/tool_tip_base_view.h",
97     "cocoa/tool_tip_base_view.mm",
98     "cocoa/tracking_area.h",
99     "cocoa/tracking_area.mm",
100     "cocoa/underlay_opengl_hosting_window.h",
101     "cocoa/underlay_opengl_hosting_window.mm",
102     "cocoa/view_description.h",
103     "cocoa/view_description.mm",
104     "cocoa/window_size_constants.h",
105     "cocoa/window_size_constants.mm",
106     "cursor/cursor.cc",
107     "cursor/cursor.h",
108     "cursor/cursor_android.cc",
109     "cursor/cursor_loader.h",
110     "cursor/cursor_util.cc",
111     "cursor/cursor_util.h",
112     "cursor/cursor_win.cc",
113     "cursor/cursors_aura.cc",
114     "cursor/cursors_aura.h",
115     "cursor/image_cursors.cc",
116     "cursor/image_cursors.h",
117     "default_theme_provider.cc",
118     "default_theme_provider.h",
119     "default_theme_provider_mac.mm",
120     "device_form_factor.h",
121     "device_form_factor_android.cc",
122     "device_form_factor_android.h",
123     "device_form_factor_desktop.cc",
124     "device_form_factor_ios.mm",
125     "dragdrop/cocoa_dnd_util.h",
126     "dragdrop/cocoa_dnd_util.mm",
127     "dragdrop/drag_drop_types.h",
128     "dragdrop/drag_drop_types_win.cc",
129     "dragdrop/drag_source_win.cc",
130     "dragdrop/drag_source_win.h",
131     "dragdrop/drag_utils.cc",
132     "dragdrop/drag_utils.h",
133     "dragdrop/drag_utils_aura.cc",
134     "dragdrop/drag_utils_mac.mm",
135     "dragdrop/drag_utils_win.cc",
136     "dragdrop/drop_target_event.cc",
137     "dragdrop/drop_target_event.h",
138     "dragdrop/drop_target_win.cc",
139     "dragdrop/drop_target_win.h",
140     "dragdrop/file_info.cc",
141     "dragdrop/file_info.h",
142     "dragdrop/os_exchange_data.cc",
143     "dragdrop/os_exchange_data.h",
144     "dragdrop/os_exchange_data_provider_mac.h",
145     "dragdrop/os_exchange_data_provider_mac.mm",
146     "dragdrop/os_exchange_data_provider_win.cc",
147     "dragdrop/os_exchange_data_provider_win.h",
148     "hit_test.h",
149     "idle/idle.cc",
150     "idle/idle.h",
151     "idle/idle_chromeos.cc",
152     "idle/idle_linux.cc",
153     "idle/idle_mac.mm",
154     "idle/idle_win.cc",
155     "ios/cru_context_menu_controller.h",
156     "ios/cru_context_menu_controller.mm",
157     "ios/cru_context_menu_holder.h",
158     "ios/cru_context_menu_holder.mm",
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/message_box_win.cc",
268     "win/message_box_win.h",
269     "win/mouse_wheel_util.cc",
270     "win/mouse_wheel_util.h",
271     "win/open_file_name_win.cc",
272     "win/open_file_name_win.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_chromeos || is_linux || is_win) {
287     sources += [
288       "resource/material_design/material_design_controller.cc",
289       "resource/material_design/material_design_controller.h",
290     ]
291   }
293   if (is_win) {
294     sources += [ "touch/touch_device_win.cc" ]
295   } else if (is_android) {
296     sources += [ "touch/touch_device_android.cc" ]
297   } else if (is_linux) {
298     sources += [ "touch/touch_device_linux.cc" ]
299   } else {
300     # Empty implementation for all other cases.
301     sources += [ "touch/touch_device.cc" ]
302   }
304   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
305   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
307   defines = [ "UI_BASE_IMPLEMENTATION" ]
309   public_deps = [
310     "//base",
311     "//skia",
312     "//ui/events/platform",
313     "//ui/events:events_base",
314     "//ui/gfx",
315     "//ui/gfx/geometry",
316   ]
317   deps = [
318     "//base/third_party/dynamic_annotations",
319     "//base:base_static",
320     "//base:i18n",
321     "//net",
322     "//third_party/icu",
323     "//ui/events",
324     "//ui/events/devices",
325     "//ui/resources",
326     "//ui/strings",
327     "//url",
328   ]
330   if (is_ios) {
331     sources += [
332       "l10n/l10n_util_mac.h",
333       "l10n/l10n_util_mac.mm",
334     ]
335   }
337   if (toolkit_views) {
338     deps += [ "//ui/events" ]
339   }
341   if (use_x11 && use_aura) {
342     sources += [
343       "x/selection_owner.cc",
344       "x/selection_owner.h",
345       "x/selection_requestor.cc",
346       "x/selection_requestor.h",
347       "x/selection_utils.cc",
348       "x/selection_utils.h",
349     ]
350   }
352   if (use_aura) {
353     deps += [ "//ui/events" ]
354   } else {
355     sources -= [
356       "cursor/cursor.cc",
357       "cursor/cursor.h",
358       "dragdrop/drag_utils_aura.cc",
359     ]
360   }
361   if (use_x11) {
362     sources += [
363       "x/x11_foreign_window_manager.cc",
364       "x/x11_foreign_window_manager.h",
365       "x/x11_menu_list.cc",
366       "x/x11_menu_list.h",
367       "x/x11_util.cc",
368       "x/x11_util.h",
369       "x/x11_util_internal.h",
370     ]
371     if (!is_chromeos) {
372       sources += [
373         "idle/idle_query_x11.cc",
374         "idle/idle_query_x11.h",
375         "idle/screensaver_window_finder_x11.cc",
376         "idle/screensaver_window_finder_x11.h",
377       ]
378       configs += [ "//build/config/linux:xscrnsaver" ]
379     }
380     deps += [ "//ui/gfx/x" ]
381   }
383   if (!use_aura || !is_linux) {
384     sources -= [ "resource/resource_bundle_auralinux.cc" ]
385   }
387   if (use_aura && is_win) {
388     sources -= [ "dragdrop/drag_utils_aura.cc" ]
389   }
391   if (is_linux) {
392     configs += [
393       "//build/config/linux:fontconfig",
394       "//build/config/linux:glib",
395     ]
396   }
398   if ((is_linux && !is_chromeos) || is_chromeos) {
399     if (!toolkit_views && !use_aura) {
400       sources -= [
401         "dragdrop/drag_utils.cc",
402         "dragdrop/drag_utils.h",
403       ]
404     }
405   }
407   if (is_chromeos) {
408     deps += [ "//chromeos" ]
409     sources -= [ "idle/idle_linux.cc" ]
410   }
412   if (is_chromeos || (use_aura && ((is_linux && !use_x11) || is_android))) {
413     sources += [
414       "dragdrop/os_exchange_data_provider_aura.cc",
415       "dragdrop/os_exchange_data_provider_aura.h",
416     ]
417   }
419   libs = []
420   if (is_win) {
421     sources += [
422       "cursor/cursor_loader_win.cc",
423       "cursor/cursor_loader_win.h",
424     ]
425     deps += [ "//third_party/wtl" ]
426     cflags = [ "/wd4324" ]  # Structure was padded due to __declspec(align()), which is
427                             # uninteresting.
429     ldflags = [
430       "/DELAYLOAD:d2d1.dll",
431       "/DELAYLOAD:d3d10_1.dll",
432       "/DELAYLOAD:dwmapi.dll",
433     ]
434     libs += [
435       "d2d1.lib",
436       "d3d10_1.lib",
437       "dwmapi.lib",
438       "d2d1.lib",
439       "dwmapi.lib",
440       "oleacc.lib",
441     ]
442   } else {
443     if (!use_aura) {
444       sources -= [
445         "view_prop.cc",
446         "view_prop.h",
447       ]
448     }
449   }
451   if (is_mac) {
452     deps += [ "//third_party/mozilla" ]
454     sources -= [
455       "cursor/image_cursors.cc",
456       "cursor/image_cursors.h",
457       "dragdrop/drag_utils.cc",
458       "dragdrop/drag_utils.h",
459     ]
461     libs += [
462       "Accelerate.framework",
463       "AudioUnit.framework",
464       "CoreVideo.framework",
465     ]
466   }
468   if (use_x11) {
469     #'all_dependent_settings': {
470     #'ldflags': [
471     #'-L<(PRODUCT_DIR)',
472     #],
473     #},
474     configs += [ "//build/config/linux:x11" ]
475   }
477   if (use_aura) {
478     if (use_x11) {
479       sources += [
480         "cursor/cursor_loader_x11.cc",
481         "cursor/cursor_loader_x11.h",
482         "cursor/cursor_x11.cc",
483       ]
484       if (!is_chromeos) {
485         # These Aura X11 files aren't used on ChromeOS.
486         sources += [
487           "dragdrop/os_exchange_data_provider_aurax11.cc",
488           "dragdrop/os_exchange_data_provider_aurax11.h",
489         ]
490       }
491     }
492   }
493   if (use_ozone) {
494     sources += [
495       "cursor/cursor_loader_ozone.cc",
496       "cursor/cursor_loader_ozone.h",
497       "cursor/cursor_ozone.cc",
498       "cursor/ozone/bitmap_cursor_factory_ozone.cc",
499       "cursor/ozone/bitmap_cursor_factory_ozone.h",
500     ]
502     deps += [
503       "//ui/events/ozone:events_ozone_layout",
504       "//ui/ozone:ozone_base",
505     ]
506   }
508   if (!toolkit_views && !use_aura) {
509     sources -= [
510       "dragdrop/drag_drop_types.h",
511       "dragdrop/drop_target_event.cc",
512       "dragdrop/drop_target_event.h",
513       "dragdrop/os_exchange_data.cc",
514       "dragdrop/os_exchange_data.h",
515       "nine_image_painter_factory.cc",
516       "nine_image_painter_factory.h",
517     ]
518   }
520   if (is_android) {
521     deps += [
522       ":ui_base_jni_headers",
523       "//ui/android:ui_java",
524     ]
526     libs += [ "jnigraphics" ]
527   }
529   if (is_android && !use_aura) {
530     sources -= [
531       "cursor/cursor_android.cc",
532       "cursor/image_cursors.cc",
533       "cursor/image_cursors.h",
534       "default_theme_provider.cc",
535       "dragdrop/drag_utils.cc",
536       "dragdrop/drag_utils.h",
537       "l10n/l10n_font_util.cc",
538       "models/button_menu_item_model.cc",
539       "models/dialog_model.cc",
540       "theme_provider.cc",
541       "touch/touch_editing_controller.cc",
542       "ui_base_types.cc",
543     ]
544   }
546   # Aura clipboard.
547   if (use_aura) {
548     if (use_x11) {
549       sources += [ "clipboard/clipboard_aurax11.cc" ]
550     } else if (!is_win && !is_android) {
551       # This file is used for all non-X11, non-Windows, non-Android 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/nswindow_fullscreen_notification_waiter.h",
569     "test/nswindow_fullscreen_notification_waiter.mm",
570     "test/test_clipboard.cc",
571     "test/test_clipboard.h",
572     "test/ui_controls.h",
573     "test/ui_controls_aura.cc",
574     "test/ui_controls_internal_win.cc",
575     "test/ui_controls_internal_win.h",
576     "test/ui_controls_mac.mm",
577     "test/ui_controls_win.cc",
578     "test/windowed_nsnotification_observer.h",
579     "test/windowed_nsnotification_observer.mm",
580   ]
582   public_deps = [
583     ":base",
584   ]
585   deps = [
586     "//base",
587     "//skia",
588     "//testing/gtest",
589     "//ui/events:events_base",
590     "//ui/gfx",
591     "//ui/gfx/geometry",
592   ]
594   if (build_ime) {
595     sources += [
596       "ime/dummy_input_method.cc",
597       "ime/dummy_input_method.h",
598       "ime/dummy_text_input_client.cc",
599       "ime/dummy_text_input_client.h",
600     ]
602     deps += [ "//ui/base/ime" ]
603   }
605   if (is_chromeos || is_linux || is_win) {
606     sources += [
607       "test/material_design_controller_test_api.cc",
608       "test/material_design_controller_test_api.h",
609     ]
610   }
612   if (!use_aura) {
613     sources -= [ "test/ui_controls_aura.cc" ]
614   } else if (is_win) {
615     sources -= [ "test/ui_controls_win.cc" ]
616   }
619 if (is_android) {
620   generate_jni("ui_base_jni_headers") {
621     sources = [
622       "../android/java/src/org/chromium/ui/base/Clipboard.java",
623       "../android/java/src/org/chromium/ui/base/DeviceFormFactor.java",
624       "../android/java/src/org/chromium/ui/base/LocalizationUtils.java",
625       "../android/java/src/org/chromium/ui/base/ResourceBundle.java",
626       "../android/java/src/org/chromium/ui/base/SelectFileDialog.java",
627       "../android/java/src/org/chromium/ui/base/TouchDevice.java",
628     ]
629     jni_package = "base"
630   }
633 # GYP version: ui/base/ui_base_tests.gyp:ui_base_unittests
634 test("ui_base_unittests") {
635   sources = [
636     "ios/cru_context_menu_controller_unittest.mm",
637     "l10n/l10n_util_mac_unittest.mm",
638     "l10n/l10n_util_unittest.cc",
639     "l10n/l10n_util_win_unittest.cc",
640     "l10n/time_format_unittest.cc",
641     "layout_unittest.cc",
642     "models/tree_node_iterator_unittest.cc",
643     "resource/data_pack_literal.cc",
644     "resource/data_pack_unittest.cc",
645     "resource/resource_bundle_unittest.cc",
646     "test/run_all_unittests.cc",
647     "test/test_clipboard_unittest.cc",
648     "user_activity/user_activity_detector_unittest.cc",
649   ]
651   if (is_chromeos || is_linux || is_win) {
652     sources +=
653         [ "resource/material_design/material_design_controller_unittest.cc" ]
654   }
656   if (is_android) {
657     sources -= [ "user_activity/user_activity_detector_unittest.cc" ]
658   }
660   if (is_ios) {
661     # Compile this Mac file on iOS as well.
662     set_sources_assignment_filter([])
663     sources += [ "l10n/l10n_util_mac_unittest.mm" ]
664     set_sources_assignment_filter(sources_assignment_filter)
665   } else {  # !is_ios
666     sources += [
667       "accelerators/accelerator_manager_unittest.cc",
668       "accelerators/menu_label_accelerator_util_linux_unittest.cc",
669       "clipboard/custom_data_helper_unittest.cc",
670       "cocoa/base_view_unittest.mm",
671       "cocoa/cocoa_base_utils_unittest.mm",
672       "cocoa/constrained_window/constrained_window_animation_unittest.mm",
673       "cocoa/controls/blue_label_button_unittest.mm",
674       "cocoa/controls/hover_image_menu_button_unittest.mm",
675       "cocoa/controls/hyperlink_button_cell_unittest.mm",
676       "cocoa/controls/hyperlink_text_view_unittest.mm",
677       "cocoa/focus_tracker_unittest.mm",
678       "cocoa/fullscreen_window_manager_unittest.mm",
679       "cocoa/hover_image_button_unittest.mm",
680       "cocoa/menu_controller_unittest.mm",
681       "cocoa/nsgraphics_context_additions_unittest.mm",
682       "cocoa/nsview_additions_unittest.mm",
683       "cocoa/three_part_image_unittest.mm",
684       "cocoa/tracking_area_unittest.mm",
685       "models/list_model_unittest.cc",
686       "models/list_selection_model_unittest.cc",
687       "models/tree_node_model_unittest.cc",
688       "test/data/resource.h",
689       "text/bytes_formatting_unittest.cc",
690       "touch/selection_bound_unittest.cc",
691       "view_prop_unittest.cc",
692       "webui/web_ui_util_unittest.cc",
693     ]
694   }
696   if (build_ime) {
697     sources += [
698       "ime/candidate_window_unittest.cc",
699       "ime/chromeos/character_composer_unittest.cc",
700       "ime/chromeos/composition_text_chromeos_unittest.cc",
701       "ime/input_method_base_unittest.cc",
702       "ime/input_method_chromeos_unittest.cc",
703       "ime/remote_input_method_win_unittest.cc",
704       "ime/win/imm32_manager_unittest.cc",
705       "ime/win/tsf_input_scope_unittest.cc",
706     ]
707     if (is_linux && use_aura && !is_chromeos) {
708       sources += [ "ime/input_method_auralinux_unittest.cc" ]
709     }
710     if (use_x11) {
711       sources += [ "ime/composition_text_util_pango_unittest.cc" ]
712     }
713     if (!use_x11 && is_chromeos) {
714       # These were already removed in the non-chromeos case.
715       sources -= [
716         "ime/chromeos/character_composer_unittest.cc",
717         "ime/input_method_chromeos_unittest.cc",
718       ]
719     }
720   }
722   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
723   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
725   deps = [
726     "//base",
727     "//base/allocator",
728     "//base/test:test_support",
729     "//net",
730     "//skia",
731     "//testing/gmock",
732     "//testing/gtest",
733     "//third_party/icu",
734     "//ui/base",
735     "//ui/base:test_support",
736     "//ui/events:events_base",
737     "//ui/events:test_support",
738     "//ui/gfx:test_support",
739     "//ui/resources",
740     "//ui/resources:ui_test_pak",
741     "//ui/strings",
742     "//url",
743   ]
745   if (is_ios) {
746     # TODO(GYP) lots of iOS-only steps for ui_base_unittests
747   }
749   if (build_ime) {
750     deps += [ "//ui/base/ime" ]
751   }
753   if (is_win) {
754     sources += [
755       "dragdrop/os_exchange_data_win_unittest.cc",
756       "win/hwnd_subclass_unittest.cc",
757       "win/open_file_name_win_unittest.cc",
758     ]
760     ldflags = [
761       "/DELAYLOAD:d2d1.dll",
762       "/DELAYLOAD:d3d10_1.dll",
763     ]
764     libs = [
765       "d2d1.lib",
766       "d3d10_1.lib",
767       "imm32.lib",
768       "oleacc.lib",
769     ]
770   }
772   if (!is_win || !use_aura) {
773     sources -= [ "view_prop_unittest.cc" ]
774   }
776   if (is_android) {
777     apk_deps = [ "//chrome:resources" ]
778     isolate_file = "ui_base_unittests.isolate"
779   }
781   if (use_pango) {
782     configs += [ "//build/config/linux:pangocairo" ]
783   }
785   if (use_x11) {
786     sources += [ "cursor/cursor_loader_x11_unittest.cc" ]
788     configs += [ "//build/config/linux:x11" ]
790     deps += [
791       "//ui/events/platform/x11",
792       "//ui/gfx/x",
793     ]
795     datadeps = [
796       "//tools/xdisplaycheck",
797     ]
798   }
800   if (is_mac) {
801     deps += [
802       "//third_party/mozilla",
803       #'ui_base_tests_bundle',  TODO(GYP)
804     ]
805   }
807   if (use_aura || toolkit_views) {
808     sources += [ "dragdrop/os_exchange_data_unittest.cc" ]
810     deps += [
811       "//ui/events",
812       "//ui/events/platform",
813     ]
814   }
816   if (use_x11 && !is_chromeos) {
817     sources += [
818       "dragdrop/os_exchange_data_provider_aurax11_unittest.cc",
819       "x/selection_requestor_unittest.cc",
820     ]
821   }
823   if (is_chromeos) {
824     deps += [
825       "//chromeos",
826       "//ui/events:dom_keycode_converter",
827     ]
828   }
830 # TODO(GYP) Mac (ui_base_tests_bundle)