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")
9 import("//build/config/android/rules.gni")
13 output_name = "ui_base"
15 "accelerators/accelerator.cc",
16 "accelerators/accelerator.h",
17 "accelerators/accelerator_manager.cc",
18 "accelerators/accelerator_manager.h",
19 "accelerators/menu_label_accelerator_util_linux.cc",
20 "accelerators/menu_label_accelerator_util_linux.h",
21 "accelerators/platform_accelerator.h",
22 "accelerators/platform_accelerator_cocoa.h",
23 "accelerators/platform_accelerator_cocoa.mm",
24 "android/system_ui_resource_manager.h",
25 "android/ui_base_jni_registrar.cc",
26 "android/ui_base_jni_registrar.h",
27 "android/view_android.cc",
28 "android/view_android.h",
29 "android/window_android.cc",
30 "android/window_android.h",
31 "android/window_android_compositor.h",
32 "android/window_android_observer.h",
35 "clipboard/clipboard.cc",
36 "clipboard/clipboard.h",
37 "clipboard/clipboard_android.cc",
38 "clipboard/clipboard_android_initialization.h",
39 "clipboard/clipboard_constants.cc",
40 "clipboard/clipboard_mac.mm",
41 "clipboard/clipboard_types.h",
42 "clipboard/clipboard_util_win.cc",
43 "clipboard/clipboard_util_win.h",
44 "clipboard/clipboard_win.cc",
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/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/find_pasteboard.h",
67 "cocoa/find_pasteboard.mm",
68 "cocoa/flipped_view.h",
69 "cocoa/flipped_view.mm",
70 "cocoa/focus_tracker.h",
71 "cocoa/focus_tracker.mm",
72 "cocoa/focus_window_set.h",
73 "cocoa/focus_window_set.mm",
74 "cocoa/fullscreen_window_manager.h",
75 "cocoa/fullscreen_window_manager.mm",
76 "cocoa/hover_button.h",
77 "cocoa/hover_button.mm",
78 "cocoa/hover_image_button.h",
79 "cocoa/hover_image_button.mm",
80 "cocoa/menu_controller.h",
81 "cocoa/menu_controller.mm",
82 "cocoa/nib_loading.h",
83 "cocoa/nib_loading.mm",
84 "cocoa/nsgraphics_context_additions.h",
85 "cocoa/nsgraphics_context_additions.mm",
86 "cocoa/remote_layer_api.h",
87 "cocoa/remote_layer_api.mm",
88 "cocoa/tracking_area.h",
89 "cocoa/tracking_area.mm",
90 "cocoa/underlay_opengl_hosting_window.h",
91 "cocoa/underlay_opengl_hosting_window.mm",
92 "cocoa/view_description.h",
93 "cocoa/view_description.mm",
94 "cocoa/window_size_constants.h",
95 "cocoa/window_size_constants.mm",
98 "cursor/cursor_android.cc",
99 "cursor/cursor_loader.h",
100 "cursor/cursor_util.cc",
101 "cursor/cursor_util.h",
102 "cursor/cursor_win.cc",
103 "cursor/cursors_aura.cc",
104 "cursor/cursors_aura.h",
105 "cursor/image_cursors.cc",
106 "cursor/image_cursors.h",
107 "default_theme_provider.cc",
108 "default_theme_provider.h",
109 "default_theme_provider_mac.mm",
110 "device_form_factor_android.cc",
111 "device_form_factor_android.h",
112 "device_form_factor_desktop.cc",
113 "device_form_factor_ios.mm",
114 "device_form_factor.h",
115 "dragdrop/cocoa_dnd_util.h",
116 "dragdrop/cocoa_dnd_util.mm",
117 "dragdrop/drag_drop_types.h",
118 "dragdrop/drag_drop_types_win.cc",
119 "dragdrop/drag_source_win.cc",
120 "dragdrop/drag_source_win.h",
121 "dragdrop/drag_utils.cc",
122 "dragdrop/drag_utils.h",
123 "dragdrop/drag_utils_aura.cc",
124 "dragdrop/drag_utils_mac.mm",
125 "dragdrop/drag_utils_win.cc",
126 "dragdrop/drop_target_event.cc",
127 "dragdrop/drop_target_event.h",
128 "dragdrop/drop_target_win.cc",
129 "dragdrop/drop_target_win.h",
130 "dragdrop/file_info.cc",
131 "dragdrop/file_info.h",
132 "dragdrop/os_exchange_data.cc",
133 "dragdrop/os_exchange_data.h",
134 "dragdrop/os_exchange_data_provider_mac.h",
135 "dragdrop/os_exchange_data_provider_mac.mm",
136 "dragdrop/os_exchange_data_provider_win.cc",
137 "dragdrop/os_exchange_data_provider_win.h",
141 "l10n/l10n_font_util.cc",
142 "l10n/l10n_font_util.h",
145 "l10n/l10n_util_android.cc",
146 "l10n/l10n_util_android.h",
147 "l10n/l10n_util_collator.h",
148 "l10n/l10n_util_mac.h",
149 "l10n/l10n_util_mac.mm",
150 "l10n/l10n_util_plurals.cc",
151 "l10n/l10n_util_plurals.h",
152 "l10n/l10n_util_posix.cc",
153 "l10n/l10n_util_win.cc",
154 "l10n/l10n_util_win.h",
155 "l10n/time_format.cc",
156 "l10n/time_format.h",
160 "models/button_menu_item_model.cc",
161 "models/button_menu_item_model.h",
162 "models/combobox_model.cc",
163 "models/combobox_model.h",
164 "models/combobox_model_observer.h",
165 "models/dialog_model.cc",
166 "models/dialog_model.h",
167 "models/list_model.h",
168 "models/list_model_observer.h",
169 "models/list_selection_model.cc",
170 "models/list_selection_model.h",
171 "models/menu_model.cc",
172 "models/menu_model.h",
173 "models/menu_model_delegate.h",
174 "models/menu_separator_types.h",
175 "models/simple_combobox_model.cc",
176 "models/simple_combobox_model.h",
177 "models/simple_menu_model.cc",
178 "models/simple_menu_model.h",
179 "models/table_model.cc",
180 "models/table_model.h",
181 "models/table_model_observer.h",
182 "models/tree_model.cc",
183 "models/tree_model.h",
184 "models/tree_node_iterator.h",
185 "models/tree_node_model.h",
186 "nine_image_painter_factory.cc",
187 "nine_image_painter_factory.h",
188 "resource/data_pack.cc",
189 "resource/data_pack.h",
190 "resource/resource_bundle.cc",
191 "resource/resource_bundle.h",
192 "resource/resource_bundle_android.cc",
193 "resource/resource_bundle_auralinux.cc",
194 "resource/resource_bundle_ios.mm",
195 "resource/resource_bundle_mac.mm",
196 "resource/resource_bundle_win.cc",
197 "resource/resource_bundle_win.h",
198 "resource/resource_data_dll_win.cc",
199 "resource/resource_data_dll_win.h",
200 "resource/resource_handle.h",
201 "text/bytes_formatting.cc",
202 "text/bytes_formatting.h",
205 "touch/touch_device.h",
206 "touch/touch_editing_controller.cc",
207 "touch/touch_editing_controller.h",
208 "touch/touch_enabled.cc",
209 "touch/touch_enabled.h",
211 "ui_base_exports.cc",
214 "ui_base_switches.cc",
215 "ui_base_switches.h",
216 "ui_base_switches_util.cc",
217 "ui_base_switches_util.h",
222 "webui/jstemplate_builder.cc",
223 "webui/jstemplate_builder.h",
224 "webui/web_ui_util.cc",
225 "webui/web_ui_util.h",
226 "win/accessibility_ids_win.h",
227 "win/accessibility_misc_utils.cc",
228 "win/accessibility_misc_utils.h",
232 "win/foreground_helper.cc",
233 "win/foreground_helper.h",
234 "win/hidden_window.cc",
235 "win/hidden_window.h",
236 "win/hwnd_subclass.cc",
237 "win/hwnd_subclass.h",
238 "win/internal_constants.cc",
239 "win/internal_constants.h",
242 "win/open_file_name_win.cc",
243 "win/open_file_name_win.h",
244 "win/message_box_win.cc",
245 "win/message_box_win.h",
246 "win/mouse_wheel_util.cc",
247 "win/mouse_wheel_util.h",
248 "win/scoped_ole_initializer.cc",
249 "win/scoped_ole_initializer.h",
252 "win/touch_input.cc",
254 "win/window_event_target.cc",
255 "win/window_event_target.h",
256 "window_open_disposition.cc",
257 "window_open_disposition.h",
258 "work_area_watcher_observer.h",
259 "x/x11_foreign_window_manager.cc",
260 "x/x11_foreign_window_manager.h",
261 "x/x11_menu_list.cc",
265 "x/x11_util_internal.h",
269 sources += [ "touch/touch_device_win.cc" ]
270 } else if (is_android) {
271 sources += [ "touch/touch_device_android.cc" ]
272 } else if (use_ozone) {
273 sources += [ "touch/touch_device_ozone.cc" ]
274 } else if (use_aura && use_x11) {
275 sources += [ "touch/touch_device_aurax11.cc" ]
277 # Empty implementation for all other cases.
278 sources += [ "touch/touch_device.cc" ]
281 defines = [ "UI_BASE_IMPLEMENTATION" ]
285 "//base/third_party/dynamic_annotations",
286 "//base:base_static",
291 "//ui/events/platform",
292 "//ui/events:events_base",
299 # We expose these things in our headers:
300 forward_dependent_configs_from = [
306 "l10n/l10n_util_mac.h",
307 "l10n/l10n_util_mac.mm",
310 deps += [ "//ui/base/ime" ]
319 if (use_x11 && use_aura) {
321 "x/selection_owner.cc",
322 "x/selection_owner.h",
323 "x/selection_requestor.cc",
324 "x/selection_requestor.h",
325 "x/selection_utils.cc",
326 "x/selection_utils.h",
338 "dragdrop/drag_utils_aura.cc",
343 "x/x11_foreign_window_manager.cc",
344 "x/x11_foreign_window_manager.h",
345 "x/x11_menu_list.cc",
349 "x/x11_util_internal.h",
353 if (!use_aura || !is_linux) {
355 "resource/resource_bundle_auralinux.cc",
359 if (use_aura && is_win) {
361 "dragdrop/drag_utils_aura.cc",
367 "//build/config/linux:fontconfig",
368 "//build/config/linux:glib",
372 if ((is_linux && !is_chromeos) || is_chromeos) {
373 if (!toolkit_views && !use_aura) {
375 "dragdrop/drag_utils.cc",
376 "dragdrop/drag_utils.h",
381 if (is_chromeos || (use_aura && is_linux && !use_x11)) {
383 "dragdrop/os_exchange_data_provider_aura.cc",
384 "dragdrop/os_exchange_data_provider_aura.h",
391 "cursor/cursor_loader_win.cc",
392 "cursor/cursor_loader_win.h",
398 "/wd4267", # TODO(jschuh): C4267: http://crbug.com/167187 size_t -> int.
399 "/wd4324", # Structure was padded due to __declspec(align()), which is
403 "/DELAYLOAD:d2d1.dll",
404 "/DELAYLOAD:d3d10_1.dll",
405 "/DELAYLOAD:dwmapi.dll",
427 #TODO(tfarina): port this third_party component to GN.
428 #"//third_party/mozilla",
432 "cursor/image_cursors.cc",
433 "cursor/image_cursors.h",
434 "dragdrop/drag_utils.cc",
435 "dragdrop/drag_utils.h",
439 "Accelerate.framework",
440 "AudioUnit.framework",
441 "CoreVideo.framework",
446 #'all_dependent_settings': {
452 "//build/config/linux:x11"
459 "cursor/cursor_loader_x11.cc",
460 "cursor/cursor_loader_x11.h",
461 "cursor/cursor_x11.cc",
464 # These Aura X11 files aren't used on ChromeOS.
466 "dragdrop/os_exchange_data_provider_aurax11.cc",
467 "dragdrop/os_exchange_data_provider_aurax11.h",
474 "cursor/cursor_loader_ozone.cc",
475 "cursor/cursor_loader_ozone.h",
476 "cursor/cursor_ozone.cc",
477 "cursor/ozone/bitmap_cursor_factory_ozone.cc",
478 "cursor/ozone/bitmap_cursor_factory_ozone.h",
482 "//ui/ozone:ozone_base",
486 if (!toolkit_views) {
488 "dragdrop/drag_drop_types.h",
489 "dragdrop/drop_target_event.cc",
490 "dragdrop/drop_target_event.h",
491 "dragdrop/os_exchange_data.cc",
492 "dragdrop/os_exchange_data.h",
493 "nine_image_painter_factory.cc",
494 "nine_image_painter_factory.h",
500 "default_theme_provider.cc",
501 "dragdrop/drag_utils.cc",
502 "dragdrop/drag_utils.h",
503 "l10n/l10n_font_util.cc",
504 "models/button_menu_item_model.cc",
505 "models/dialog_model.cc",
507 "touch/touch_editing_controller.cc",
512 ":ui_base_jni_headers",
520 if (is_android && is_android_webview_build) {
522 #TODO(GYP): port this component to GN.
523 #"//ui/android:ui_java",
527 if (is_android && !use_aura) {
529 "cursor/cursor_android.cc",
536 sources += [ "clipboard/clipboard_aurax11.cc" ]
537 } else if (!is_win) {
538 # This file is used for all non-X11, non-Windows aura Builds.
539 sources += [ "clipboard/clipboard_aura.cc" ]
543 if (is_android || is_ios) {
545 "device_form_factor_desktop.cc",
550 source_set("test_support") {
552 "test/ui_controls.h",
553 "test/ui_controls_aura.cc",
554 "test/ui_controls_internal_win.cc",
555 "test/ui_controls_internal_win.h",
556 "test/ui_controls_mac.mm",
557 "test/ui_controls_win.cc",
564 "//ui/events:events_base",
571 "ime/dummy_input_method.cc",
572 "ime/dummy_input_method.h",
573 "ime/dummy_text_input_client.cc",
574 "ime/dummy_text_input_client.h",
580 generate_jni("ui_base_jni_headers") {
582 "../android/java/src/org/chromium/ui/base/Clipboard.java",
583 "../android/java/src/org/chromium/ui/base/DeviceFormFactor.java",
584 "../android/java/src/org/chromium/ui/base/LocalizationUtils.java",
585 "../android/java/src/org/chromium/ui/base/ResourceBundle.java",
586 "../android/java/src/org/chromium/ui/base/SelectFileDialog.java",
587 "../android/java/src/org/chromium/ui/base/TouchDevice.java",
588 "../android/java/src/org/chromium/ui/base/ViewAndroid.java",
589 "../android/java/src/org/chromium/ui/base/WindowAndroid.java",