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")
9 import("//build/config/android/config.gni")
10 import("//build/config/android/rules.gni")
16 output_name = "ui_base"
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",
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",
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",
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",
151 "idle/idle_chromeos.cc",
152 "idle/idle_linux.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",
161 "l10n/l10n_font_util.cc",
162 "l10n/l10n_font_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",
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",
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",
235 "ui_base_exports.cc",
238 "ui_base_switches.cc",
239 "ui_base_switches.h",
240 "ui_base_switches_util.cc",
241 "ui_base_switches_util.h",
244 "user_activity/user_activity_detector.cc",
245 "user_activity/user_activity_detector.h",
246 "user_activity/user_activity_observer.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",
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",
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",
277 "win/touch_input.cc",
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",
286 if (is_chromeos || is_linux || is_win) {
288 "resource/material_design/material_design_controller.cc",
289 "resource/material_design/material_design_controller.h",
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" ]
300 # Empty implementation for all other cases.
301 sources += [ "touch/touch_device.cc" ]
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" ]
312 "//ui/events/platform",
313 "//ui/events:events_base",
318 "//base/third_party/dynamic_annotations",
319 "//base:base_static",
324 "//ui/events/devices",
332 "l10n/l10n_util_mac.h",
333 "l10n/l10n_util_mac.mm",
338 deps += [ "//ui/events" ]
341 if (use_x11 && use_aura) {
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",
353 deps += [ "//ui/events" ]
358 "dragdrop/drag_utils_aura.cc",
363 "x/x11_foreign_window_manager.cc",
364 "x/x11_foreign_window_manager.h",
365 "x/x11_menu_list.cc",
369 "x/x11_util_internal.h",
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",
378 configs += [ "//build/config/linux:xscrnsaver" ]
380 deps += [ "//ui/gfx/x" ]
383 if (!use_aura || !is_linux) {
384 sources -= [ "resource/resource_bundle_auralinux.cc" ]
387 if (use_aura && is_win) {
388 sources -= [ "dragdrop/drag_utils_aura.cc" ]
393 "//build/config/linux:fontconfig",
394 "//build/config/linux:glib",
398 if ((is_linux && !is_chromeos) || is_chromeos) {
399 if (!toolkit_views && !use_aura) {
401 "dragdrop/drag_utils.cc",
402 "dragdrop/drag_utils.h",
408 deps += [ "//chromeos" ]
409 sources -= [ "idle/idle_linux.cc" ]
412 if (is_chromeos || (use_aura && ((is_linux && !use_x11) || is_android))) {
414 "dragdrop/os_exchange_data_provider_aura.cc",
415 "dragdrop/os_exchange_data_provider_aura.h",
422 "cursor/cursor_loader_win.cc",
423 "cursor/cursor_loader_win.h",
425 deps += [ "//third_party/wtl" ]
426 cflags = [ "/wd4324" ] # Structure was padded due to __declspec(align()), which is
430 "/DELAYLOAD:d2d1.dll",
431 "/DELAYLOAD:d3d10_1.dll",
432 "/DELAYLOAD:dwmapi.dll",
452 deps += [ "//third_party/mozilla" ]
455 "cursor/image_cursors.cc",
456 "cursor/image_cursors.h",
457 "dragdrop/drag_utils.cc",
458 "dragdrop/drag_utils.h",
462 "Accelerate.framework",
463 "AudioUnit.framework",
464 "CoreVideo.framework",
469 #'all_dependent_settings': {
474 configs += [ "//build/config/linux:x11" ]
480 "cursor/cursor_loader_x11.cc",
481 "cursor/cursor_loader_x11.h",
482 "cursor/cursor_x11.cc",
485 # These Aura X11 files aren't used on ChromeOS.
487 "dragdrop/os_exchange_data_provider_aurax11.cc",
488 "dragdrop/os_exchange_data_provider_aurax11.h",
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",
503 "//ui/events/ozone:events_ozone_layout",
504 "//ui/ozone:ozone_base",
508 if (!toolkit_views && !use_aura) {
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",
522 ":ui_base_jni_headers",
523 "//ui/android:ui_java",
526 libs += [ "jnigraphics" ]
529 if (is_android && !use_aura) {
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",
541 "touch/touch_editing_controller.cc",
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" ]
556 if (is_android || is_ios) {
558 "device_form_factor_desktop.cc",
565 source_set("test_support") {
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",
589 "//ui/events:events_base",
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",
602 deps += [ "//ui/base/ime" ]
605 if (is_chromeos || is_linux || is_win) {
607 "test/material_design_controller_test_api.cc",
608 "test/material_design_controller_test_api.h",
613 sources -= [ "test/ui_controls_aura.cc" ]
615 sources -= [ "test/ui_controls_win.cc" ]
620 generate_jni("ui_base_jni_headers") {
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",
633 # GYP version: ui/base/ui_base_tests.gyp:ui_base_unittests
634 test("ui_base_unittests") {
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",
651 if (is_chromeos || is_linux || is_win) {
653 [ "resource/material_design/material_design_controller_unittest.cc" ]
657 sources -= [ "user_activity/user_activity_detector_unittest.cc" ]
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)
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",
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",
707 if (is_linux && use_aura && !is_chromeos) {
708 sources += [ "ime/input_method_auralinux_unittest.cc" ]
711 sources += [ "ime/composition_text_util_pango_unittest.cc" ]
713 if (!use_x11 && is_chromeos) {
714 # These were already removed in the non-chromeos case.
716 "ime/chromeos/character_composer_unittest.cc",
717 "ime/input_method_chromeos_unittest.cc",
722 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
723 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
728 "//base/test:test_support",
735 "//ui/base:test_support",
736 "//ui/events:events_base",
737 "//ui/events:test_support",
738 "//ui/gfx:test_support",
740 "//ui/resources:ui_test_pak",
746 # TODO(GYP) lots of iOS-only steps for ui_base_unittests
750 deps += [ "//ui/base/ime" ]
755 "dragdrop/os_exchange_data_win_unittest.cc",
756 "win/hwnd_subclass_unittest.cc",
757 "win/open_file_name_win_unittest.cc",
761 "/DELAYLOAD:d2d1.dll",
762 "/DELAYLOAD:d3d10_1.dll",
772 if (!is_win || !use_aura) {
773 sources -= [ "view_prop_unittest.cc" ]
777 apk_deps = [ "//chrome:resources" ]
778 isolate_file = "ui_base_unittests.isolate"
782 configs += [ "//build/config/linux:pangocairo" ]
786 sources += [ "cursor/cursor_loader_x11_unittest.cc" ]
788 configs += [ "//build/config/linux:x11" ]
791 "//ui/events/platform/x11",
796 "//tools/xdisplaycheck",
802 "//third_party/mozilla",
803 #'ui_base_tests_bundle', TODO(GYP)
807 if (use_aura || toolkit_views) {
808 sources += [ "dragdrop/os_exchange_data_unittest.cc" ]
812 "//ui/events/platform",
816 if (use_x11 && !is_chromeos) {
818 "dragdrop/os_exchange_data_provider_aurax11_unittest.cc",
819 "x/selection_requestor_unittest.cc",
826 "//ui/events:dom_keycode_converter",
830 # TODO(GYP) Mac (ui_base_tests_bundle)