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")
8 import("//build/config/android/config.gni")
11 component("ui_base") {
13 "accelerators/accelerator.cc",
14 "accelerators/accelerator.h",
15 "accelerators/accelerator_manager.cc",
16 "accelerators/accelerator_manager.h",
17 "accelerators/menu_label_accelerator_util_linux.cc",
18 "accelerators/menu_label_accelerator_util_linux.h",
19 "accelerators/platform_accelerator.h",
20 "accelerators/platform_accelerator_cocoa.h",
21 "accelerators/platform_accelerator_cocoa.mm",
22 "android/ui_base_jni_registrar.cc",
23 "android/ui_base_jni_registrar.h",
24 "android/view_android.cc",
25 "android/view_android.h",
26 "android/window_android.cc",
27 "android/window_android.h",
28 "android/window_android_compositor.h",
29 "android/window_android_observer.h",
32 "clipboard/clipboard.cc",
33 "clipboard/clipboard.h",
34 "clipboard/clipboard_android.cc",
35 "clipboard/clipboard_android_initialization.h",
36 "clipboard/clipboard_aura.cc",
37 "clipboard/clipboard_aurax11.cc",
38 "clipboard/clipboard_constants.cc",
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/custom_data_helper.cc",
45 "clipboard/custom_data_helper.h",
46 "clipboard/custom_data_helper_linux.cc",
47 "clipboard/custom_data_helper_mac.mm",
48 "clipboard/scoped_clipboard_writer.cc",
49 "clipboard/scoped_clipboard_writer.h",
50 "cocoa/animation_utils.h",
51 "cocoa/appkit_utils.h",
52 "cocoa/appkit_utils.mm",
55 "cocoa/cocoa_base_utils.h",
56 "cocoa/cocoa_base_utils.mm",
57 "cocoa/controls/blue_label_button.h",
58 "cocoa/controls/blue_label_button.mm",
59 "cocoa/controls/hover_image_menu_button.h",
60 "cocoa/controls/hover_image_menu_button.mm",
61 "cocoa/controls/hover_image_menu_button_cell.h",
62 "cocoa/controls/hover_image_menu_button_cell.mm",
63 "cocoa/controls/hyperlink_button_cell.h",
64 "cocoa/controls/hyperlink_button_cell.mm",
65 "cocoa/find_pasteboard.h",
66 "cocoa/find_pasteboard.mm",
67 "cocoa/flipped_view.h",
68 "cocoa/flipped_view.mm",
69 "cocoa/focus_tracker.h",
70 "cocoa/focus_tracker.mm",
71 "cocoa/focus_window_set.h",
72 "cocoa/focus_window_set.mm",
73 "cocoa/fullscreen_window_manager.h",
74 "cocoa/fullscreen_window_manager.mm",
75 "cocoa/hover_button.h",
76 "cocoa/hover_button.mm",
77 "cocoa/hover_image_button.h",
78 "cocoa/hover_image_button.mm",
79 "cocoa/menu_controller.h",
80 "cocoa/menu_controller.mm",
81 "cocoa/nib_loading.h",
82 "cocoa/nib_loading.mm",
83 "cocoa/nsgraphics_context_additions.h",
84 "cocoa/nsgraphics_context_additions.mm",
85 "cocoa/tracking_area.h",
86 "cocoa/tracking_area.mm",
87 "cocoa/underlay_opengl_hosting_window.h",
88 "cocoa/underlay_opengl_hosting_window.mm",
89 "cocoa/view_description.h",
90 "cocoa/view_description.mm",
91 "cocoa/window_size_constants.h",
92 "cocoa/window_size_constants.mm",
95 "cursor/cursor_android.cc",
96 "cursor/cursor_loader.h",
97 "cursor/cursor_loader_win.cc",
98 "cursor/cursor_loader_win.h",
99 "cursor/cursor_loader_x11.cc",
100 "cursor/cursor_loader_x11.h",
101 "cursor/cursor_mac.mm",
102 "cursor/cursor_util.cc",
103 "cursor/cursor_util.h",
104 "cursor/cursor_win.cc",
105 "cursor/cursor_x11.cc",
106 "cursor/cursors_aura.cc",
107 "cursor/cursors_aura.h",
108 "default_theme_provider.cc",
109 "default_theme_provider.h",
110 "default_theme_provider_mac.mm",
111 "device_form_factor_android.cc",
112 "device_form_factor_android.h",
113 "device_form_factor_desktop.cc",
114 "device_form_factor_ios.mm",
115 "device_form_factor.h",
116 "dragdrop/cocoa_dnd_util.h",
117 "dragdrop/cocoa_dnd_util.mm",
118 "dragdrop/drag_drop_types.h",
119 "dragdrop/drag_drop_types.h",
120 "dragdrop/drag_drop_types_win.cc",
121 "dragdrop/drag_source_win.cc",
122 "dragdrop/drag_source_win.h",
123 "dragdrop/drag_utils.cc",
124 "dragdrop/drag_utils.h",
125 "dragdrop/drag_utils_aura.cc",
126 "dragdrop/drag_utils_win.cc",
127 "dragdrop/drop_target_event.cc",
128 "dragdrop/drop_target_event.h",
129 "dragdrop/drop_target_win.cc",
130 "dragdrop/drop_target_win.h",
131 "dragdrop/file_info.cc",
132 "dragdrop/file_info.h",
133 "dragdrop/os_exchange_data.cc",
134 "dragdrop/os_exchange_data.h",
135 "dragdrop/os_exchange_data_provider_aura.cc",
136 "dragdrop/os_exchange_data_provider_aura.h",
137 "dragdrop/os_exchange_data_provider_aurax11.cc",
138 "dragdrop/os_exchange_data_provider_aurax11.h",
139 "dragdrop/os_exchange_data_provider_win.cc",
140 "dragdrop/os_exchange_data_provider_win.h",
144 "l10n/l10n_font_util.cc",
145 "l10n/l10n_font_util.h",
148 "l10n/l10n_util_android.cc",
149 "l10n/l10n_util_android.h",
150 "l10n/l10n_util_collator.h",
151 "l10n/l10n_util_mac.h",
152 "l10n/l10n_util_mac.mm",
153 "l10n/l10n_util_plurals.cc",
154 "l10n/l10n_util_plurals.h",
155 "l10n/l10n_util_posix.cc",
156 "l10n/l10n_util_win.cc",
157 "l10n/l10n_util_win.h",
158 "l10n/time_format.cc",
159 "l10n/time_format.h",
163 "models/button_menu_item_model.cc",
164 "models/button_menu_item_model.h",
165 "models/combobox_model.cc",
166 "models/combobox_model.h",
167 "models/combobox_model_observer.h",
168 "models/dialog_model.cc",
169 "models/dialog_model.h",
170 "models/list_model.h",
171 "models/list_model_observer.h",
172 "models/list_selection_model.cc",
173 "models/list_selection_model.h",
174 "models/menu_model.cc",
175 "models/menu_model.h",
176 "models/menu_model_delegate.h",
177 "models/menu_separator_types.h",
178 "models/simple_menu_model.cc",
179 "models/simple_menu_model.h",
180 "models/table_model.cc",
181 "models/table_model.h",
182 "models/table_model_observer.h",
183 "models/tree_model.cc",
184 "models/tree_model.h",
185 "models/tree_node_iterator.h",
186 "models/tree_node_model.h",
187 "nine_image_painter_factory.cc",
188 "nine_image_painter_factory.h",
189 "resource/data_pack.cc",
190 "resource/data_pack.h",
191 "resource/resource_bundle.cc",
192 "resource/resource_bundle.h",
193 "resource/resource_bundle_android.cc",
194 "resource/resource_bundle_auralinux.cc",
195 "resource/resource_bundle_ios.mm",
196 "resource/resource_bundle_mac.mm",
197 "resource/resource_bundle_win.cc",
198 "resource/resource_bundle_win.h",
199 "resource/resource_data_dll_win.cc",
200 "resource/resource_data_dll_win.h",
201 "resource/resource_handle.h",
202 "text/bytes_formatting.cc",
203 "text/bytes_formatting.h",
206 "touch/touch_device.cc",
207 "touch/touch_device.h",
208 "touch/touch_device_android.cc",
209 "touch/touch_device_aurax11.cc",
210 "touch/touch_device_ozone.cc",
211 "touch/touch_device_win.cc",
212 "touch/touch_editing_controller.cc",
213 "touch/touch_editing_controller.h",
214 "touch/touch_enabled.cc",
215 "touch/touch_enabled.h",
216 "ui_base_exports.cc",
219 "ui_base_switches.cc",
220 "ui_base_switches.h",
221 "ui_base_switches_util.cc",
222 "ui_base_switches_util.h",
228 # TODO(tfarina): Uncomment these when http://crbug.com/367591 is fixed.
229 #"webui/jstemplate_builder.cc",
230 #"webui/jstemplate_builder.h",
231 #"webui/web_ui_util.cc",
232 #"webui/web_ui_util.h",
233 "win/accessibility_ids_win.h",
234 "win/accessibility_misc_utils.cc",
235 "win/accessibility_misc_utils.h",
239 "win/foreground_helper.cc",
240 "win/foreground_helper.h",
241 "win/hidden_window.cc",
242 "win/hidden_window.h",
243 "win/hwnd_subclass.cc",
244 "win/hwnd_subclass.h",
245 "win/internal_constants.cc",
246 "win/internal_constants.h",
249 "win/message_box_win.cc",
250 "win/message_box_win.h",
251 "win/mouse_wheel_util.cc",
252 "win/mouse_wheel_util.h",
253 "win/scoped_ole_initializer.cc",
254 "win/scoped_ole_initializer.h",
257 "win/touch_input.cc",
259 "win/window_event_target.cc",
260 "win/window_event_target.h",
261 "window_open_disposition.cc",
262 "window_open_disposition.h",
263 "work_area_watcher_observer.h",
264 "x/selection_owner.cc",
265 "x/selection_owner.h",
266 "x/selection_requestor.cc",
267 "x/selection_requestor.h",
268 "x/selection_utils.cc",
269 "x/selection_utils.h",
270 "x/x11_menu_list.cc",
274 "x/x11_util_internal.h",
277 defines = [ "UI_BASE_IMPLEMENTATION" ]
281 "//base/third_party/dynamic_annotations",
282 "//base:base_static",
294 "l10n/l10n_util_mac.h",
295 "l10n/l10n_util_mac.mm",
313 "cursor/cursor_loader_x11.cc",
314 "cursor/cursor_loader_x11.h",
315 "cursor/cursor_mac.mm",
316 "cursor/cursor_win.cc",
317 "cursor/cursor_x11.cc",
318 "x/selection_owner.cc",
319 "x/selection_owner.h",
320 "x/selection_requestor.cc",
321 "x/selection_requestor.h",
322 "x/selection_utils.cc",
323 "x/selection_utils.h",
327 if (!use_aura || !is_linux) {
329 "resource/resource_bundle_auralinux.cc",
333 if (use_aura && is_win) {
335 "dragdrop/drag_utils_aura.cc",
341 "//build/config/linux:fontconfig",
342 "//build/config/linux:glib",
346 if ((is_linux && !is_chromeos) || is_chromeos) {
347 if (!toolkit_views && !use_aura) {
349 "dragdrop/drag_utils.cc",
350 "dragdrop/drag_utils.h",
357 "//build/config/linux:pangocairo",
360 if (is_win || use_clipboard_aurax11) {
362 "clipboard/clipboard_aura.cc",
366 "clipboard/clipboard_aurax11.cc",
370 if (is_chromeos || (use_aura && is_linux && !use_x11)) {
372 "dragdrop/os_exchange_data_provider_aurax11.cc",
373 "touch/touch_device.cc",
377 "dragdrop/os_exchange_data_provider_aura.cc",
378 "dragdrop/os_exchange_data_provider_aura.h",
379 "touch/touch_device_aurax11.cc",
388 "touch/touch_device.cc",
391 "/wd4267", # TODO(jschuh): C4267: http://crbug.com/167187 size_t -> int.
392 "/wd4324", # Structure was padded due to __declspec(align()), which is
396 "/DELAYLOAD:d2d1.dll",
397 "/DELAYLOAD:d3d10_1.dll",
398 "/DELAYLOAD:dwmapi.dll",
420 #TODO(tfarina): port this third_party component to GN.
421 #"//third_party/mozilla",
425 "dragdrop/drag_utils.cc",
426 "dragdrop/drag_utils.h",
430 "Accelerate.framework",
431 "AudioUnit.framework",
432 "CoreView.framework",
437 #'all_dependent_settings': {
443 "//build/config/linux:x11"
447 if (!toolkit_views) {
449 "dragdrop/drag_drop_types.h",
450 "dragdrop/drop_target_event.cc",
451 "dragdrop/drop_target_event.h",
452 "dragdrop/os_exchange_data.cc",
453 "dragdrop/os_exchange_data.h",
454 "nine_image_painter_factory.cc",
455 "nine_image_painter_factory.h",
461 "default_theme_provider.cc",
462 "dragdrop/drag_utils.cc",
463 "dragdrop/drag_utils.h",
464 "l10n/l10n_font_util.cc",
465 "models/button_menu_item_model.cc",
466 "models/dialog_model.cc",
468 "touch/touch_device.cc",
469 "touch/touch_editing_controller.cc",
474 #":ui_base_jni_headers",
482 if (is_android && is_android_webview_build) {
484 #TODO(GYP): port this component to GN.
485 #"//ui/android:ui_java",
489 if (is_android && !use_aura) {
491 "cursor/cursor_android.cc",
495 if (is_android && use_aura) {
497 "clipboard/clipboard_aura.cc",
501 if (is_android || is_ios) {
503 "device_form_factor_desktop.cc",
507 # TODO(GYP): Port this to GN.
508 #if (use_system_icu) {
509 # When using the system icu, the icu targets generate shim headers
510 # which are included by public headers in the ui target, so we need
511 # ui to be a hard dependency for all its users.
512 #'hard_dependency': 1,
516 source_set("ui_base_test_support") {
518 "test/ui_controls.h",
519 "test/ui_controls_aura.cc",
520 "test/ui_controls_internal_win.cc",
521 "test/ui_controls_internal_win.h",
522 "test/ui_controls_mac.mm",
523 "test/ui_controls_win.cc",
536 "ime/dummy_input_method.cc",
537 "ime/dummy_input_method.h",
538 "ime/dummy_text_input_client.cc",
539 "ime/dummy_text_input_client.h",