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