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/crypto.gni")
6 import("//build/config/features.gni")
7 import("//build/config/ui.gni")
9 gypi_values = exec_script("//build/gypi_to_gn.py",
10 [ rebase_path("../../chrome_browser_ui.gypi") ],
12 [ "../../chrome_browser_ui.gypi" ])
14 static_library("ui") {
15 output_name = "browser_ui"
22 "//build/config/compiler:wexit_time_destructors",
23 "//third_party/WebKit/public:debug_devtools",
26 # Since browser and browser_ui actually depend on each other,
27 # we must omit the dependency from browser_ui to browser.
28 # However, this means browser_ui and browser should more or less
29 # have the same dependencies. Once browser_ui is untangled from
30 # browser, then we can clean up these dependencies.
32 "//components/dom_distiller/core",
33 "//content/public/browser",
37 # NOTE: New dependencies should generally be added in the OS!="ios"
38 # dependencies block below, rather than here.
40 "//chrome:extra_resources",
43 "//chrome/app/resources:platform_locale_settings",
44 "//chrome/app/theme:theme_resources",
45 "//chrome/browser/net:cert_logger_proto",
47 "//chrome/common/net",
48 "//components/app_modal",
49 "//components/auto_login_parser",
50 "//components/dom_distiller/webui",
51 "//components/invalidation",
53 "//components/password_manager/core/browser",
54 "//components/resources",
55 "//components/strings",
56 "//components/update_client",
57 "//content/public/common",
60 "//third_party/cacheinvalidation",
62 "//third_party/libxml",
66 "//ui/content_accelerators",
68 "//ui/events:gesture_detection",
71 "//ui/message_center",
79 sources += rebase_path(gypi_values.chrome_browser_ui_non_ios_sources,
82 sources += rebase_path(gypi_values.chrome_browser_ui_global_error_sources,
85 sources += rebase_path(gypi_values.chrome_browser_ui_omnibox_sources,
88 sources += rebase_path(gypi_values.chrome_browser_ui_toolbar_model_sources,
92 "//chrome/browser/devtools",
93 "//chrome/browser/ui/views",
94 "//chrome/browser/ui/webui/omnibox:mojo_bindings",
95 "//chrome/installer/util",
96 "//components/autofill/content/browser:risk_proto",
98 "//components/suggestions/proto",
104 "//third_party/WebKit/public:resources",
105 "//third_party/adobe/flash:flapper_version_h",
106 "//third_party/expat",
107 "//third_party/hunspell",
108 "//third_party/leveldatabase",
109 "//third_party/mojo/src/mojo/edk/system",
110 "//third_party/npapi",
111 "//third_party/libjingle",
122 rebase_path(gypi_values.chrome_browser_ui_ios_sources, ".", "//chrome")
126 if (!is_android && !is_ios) {
127 sources += rebase_path(gypi_values.chrome_browser_ui_non_mobile_sources,
131 rebase_path(gypi_values.chrome_browser_ui_omnibox_non_mobile_sources,
135 "//components/copresence",
136 "//components/feedback/proto",
137 "//device/bluetooth",
138 "//third_party/libusb",
142 if (enable_basic_printing || enable_print_preview) {
143 deps += [ "//printing" ]
146 if (enable_one_click_signin) {
148 rebase_path(gypi_values.chrome_browser_ui_one_click_signin_sources,
154 rebase_path(gypi_values.chrome_browser_ui_nacl_sources, ".", "//chrome")
155 deps += [ "//native_client/src/trusted/service_runtime:sel" ]
157 if (enable_configuration_policy) {
158 sources += rebase_path(gypi_values.chrome_browser_ui_policy_sources,
161 deps += [ "//components/policy" ]
163 if (enable_plugins) {
164 sources += rebase_path(gypi_values.chrome_browser_ui_plugin_sources,
167 deps += [ "//ppapi/proxy:ipc" ]
169 if (safe_browsing_mode == 1) {
170 defines += [ "FULL_SAFE_BROWSING" ]
172 "//chrome/browser/safe_browsing:chunk_proto",
173 "//chrome/common/safe_browsing:proto",
174 "//chrome/browser/safe_browsing:report_proto",
178 sources += rebase_path(gypi_values.chrome_browser_ui_chromeos_sources,
181 deps += [ "//chrome/browser/chromeos" ]
183 sources += rebase_path(gypi_values.chrome_browser_ui_non_chromeos_sources,
188 configs += [ "//printing:cups" ]
192 rebase_path(gypi_values.chrome_browser_ui_ash_sources, ".", "//chrome")
195 "//ash:ash_with_content",
197 "//components/user_manager",
200 sources += rebase_path(gypi_values.chrome_browser_ui_ash_non_chromeos,
205 sources += rebase_path(gypi_values.chrome_browser_ui_non_ash_sources,
210 sources += rebase_path(gypi_values.chrome_browser_ui_views_sources,
213 deps += [ "//components/constrained_window" ]
216 rebase_path(gypi_values.chrome_browser_ui_views_non_chromeos_sources,
221 if (mac_views_browser) {
222 sources += rebase_path(
223 gypi_values.chrome_browser_ui_views_mac_experimental_sources,
227 rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
231 "cocoa/apps/chrome_app_window_client_cocoa.mm",
232 "cocoa/autofill/card_unmask_prompt_view_bridge.mm",
233 "cocoa/autofill/generated_credit_card_bubble_cocoa.mm",
234 "cocoa/autofill/new_credit_card_bubble_cocoa.mm",
235 "cocoa/bookmarks/bookmark_drag_drop_cocoa.mm",
236 "cocoa/browser_window_factory_cocoa.mm",
237 "cocoa/constrained_web_dialog_delegate_mac.mm",
238 "cocoa/extensions/browser_action_test_util_mac.mm",
239 "cocoa/extensions/extension_action_platform_delegate_cocoa.mm",
240 "cocoa/extensions/extension_install_dialog_controller.mm",
241 "cocoa/extensions/extension_installed_bubble_bridge.mm",
242 "cocoa/extensions/extension_uninstall_dialog_cocoa.mm",
243 "cocoa/extensions/media_galleries_dialog_cocoa.mm",
244 "cocoa/infobars/alternate_nav_infobar_controller.mm",
245 "cocoa/infobars/confirm_infobar_controller.mm",
246 "cocoa/login_prompt_cocoa.mm",
247 "cocoa/panels/panel_stack_window_cocoa.mm",
248 "cocoa/simple_message_box_mac.mm",
249 "cocoa/single_web_contents_dialog_manager_cocoa.cc",
250 "cocoa/ssl_client_certificate_selector_cocoa.mm",
251 "cocoa/tab_dialogs_cocoa.mm",
252 "cocoa/tab_modal_confirm_dialog_mac.mm",
253 "cocoa/task_manager_mac.mm",
254 "cocoa/web_dialog_window_controller.mm",
256 deps += [ "//extensions/components/native_app_window" ]
260 rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
263 deps += [ "//extensions/components/native_app_window" ]
266 sources += rebase_path(gypi_values.chrome_browser_ui_ash_views_sources,
271 if (use_aura && !use_ozone && is_desktop_linux) {
273 "//build/config/linux:gio",
275 # gtk2 is the only component that can interact with gtk2 in our new
277 "//chrome/browser/ui/libgtk2ui",
280 if (is_win || is_mac || is_desktop_linux) {
281 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_sources,
287 rebase_path(gypi_values.chrome_browser_ui_aura_sources, ".", "//chrome")
289 # aura uses some of ash resources.
293 "//ui/keyboard:resources",
297 sources += rebase_path(gypi_values.chrome_browser_ui_aura_non_chromeos,
302 if (ui_compositor_image_transport) {
303 deps += [ "//ui/gl" ]
307 rebase_path(gypi_values.chrome_browser_ui_nss_sources, ".", "//chrome")
309 if (!enable_themes) {
310 sources -= [ "webui/theme_source.cc" ]
312 if (enable_print_preview) {
313 sources += rebase_path(gypi_values.chrome_browser_ui_print_preview_sources,
317 if (is_linux || is_android) {
318 sources += rebase_path(gypi_values.chrome_browser_ui_android_linux_sources,
325 "//chrome/browser:jni_headers",
327 "//components/web_contents_delegate_android",
330 "//chrome/browser/ui/views",
333 sources += rebase_path(gypi_values.chrome_browser_ui_android_sources,
337 defines += [ "CHROME_BUILD_ID=" + android_chrome_build_id ]
342 rebase_path(gypi_values.chrome_browser_ui_mac_sources, ".", "//chrome")
344 ":generate_localizer",
345 "//third_party/apple_sample_code",
346 "//third_party/google_toolbox_for_mac",
347 "//third_party/molokocacao",
348 "//third_party/mozilla",
350 include_dirs = [ "$target_gen_dir" ]
351 libs += [ "Quartz.framework" ]
353 [ "//third_party/google_toolbox_for_mac:google_toolbox_for_mac_config" ]
355 sources += rebase_path(gypi_values.chrome_browser_ui_non_mac_sources,
362 rebase_path(gypi_values.chrome_browser_ui_win_sources, ".", "//chrome")
364 "views/apps/keyboard_hook_handler.cc",
365 "views/frame/taskbar_decorator.cc",
369 "//ui/views/controls/webview",
372 "//chrome/browser/metro_utils",
373 "//chrome/installer/util:strings",
376 "//third_party/iaccessible2",
377 "//third_party/isimpledom",
380 } else { # 'OS!="win"
384 "//ui/views/controls/webview",
388 if (is_desktop_linux) {
389 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_linux_sources,
393 if (is_linux) { # Both desktop Linux and ChromeOS.
394 sources += rebase_path(gypi_values.chrome_browser_ui_linux_sources,
397 deps += [ "//device/udev_linux" ]
399 configs += [ "//build/config/linux:fontconfig" ]
403 sources += rebase_path(gypi_values.chrome_browser_ui_x11_sources,
406 configs += [ "//build/config/linux:x11" ]
407 deps += [ "//ui/events/devices" ]
409 sources -= [ "views/tabs/window_finder_x11.cc" ]
414 if (enable_app_list) {
415 sources += rebase_path(gypi_values.chrome_browser_ui_app_list_sources,
418 deps += [ "//ui/app_list" ]
420 sources += rebase_path(gypi_values.chrome_browser_ui_non_app_list_sources,
424 if (enable_autofill_dialog) {
426 rebase_path(gypi_values.chrome_browser_ui_autofill_dialog_sources,
429 if (!is_android && !is_ios) {
430 sources += rebase_path(
431 gypi_values.chrome_browser_ui_autofill_dialog_non_mobile_sources,
435 "//third_party/libaddressinput",
436 "//third_party/libaddressinput:strings",
440 if (enable_extensions) {
442 "//chrome/browser/extensions",
443 "//chrome/common/extensions/api",
444 "//chrome/common/extensions/api:api_registration",
446 sources += rebase_path(gypi_values.chrome_browser_ui_extensions_sources,
450 if (enable_google_now && !is_android) {
451 sources += rebase_path(
452 gypi_values.chrome_browser_ui_google_now_non_android_sources,
457 sources += rebase_path(gypi_values.chrome_browser_ui_webrtc_sources,
461 if (enable_service_discovery) {
463 rebase_path(gypi_values.chrome_browser_ui_service_discovery_sources,
467 if (enable_spellcheck) {
468 deps += [ "//third_party/hunspell" ]
473 nib_gypi_values = exec_script("//build/gypi_to_gn.py",
474 [ rebase_path("../../chrome_nibs.gypi") ],
476 [ "../../chrome_nibs.gypi" ])
478 action("generate_localizer") {
479 script = "//chrome/tools/build/mac/generate_localizer"
481 table_path = "$target_gen_dir/ui_localizer_table.h"
485 args = [ rebase_path(table_path, root_build_dir) ] +
486 rebase_path(nib_gypi_values.mac_translated_xibs,
492 # In GYP this is part of test_support_common.
493 source_set("test_support") {
498 "cocoa/find_bar/find_bar_host_unittest_util_cocoa.mm",
499 "cocoa/run_loop_testing.h",
500 "cocoa/run_loop_testing.mm",
501 "exclusive_access/fullscreen_controller_state_test.cc",
502 "exclusive_access/fullscreen_controller_state_test.h",
503 "exclusive_access/fullscreen_controller_state_tests.h",
504 "exclusive_access/fullscreen_controller_test.cc",
505 "exclusive_access/fullscreen_controller_test.h",
506 "find_bar/find_bar_host_unittest_util.h",
507 "login/login_prompt_test_utils.cc",
508 "login/login_prompt_test_utils.h",
509 "passwords/manage_passwords_ui_controller_mock.cc",
510 "passwords/manage_passwords_ui_controller_mock.h",
511 "pdf/pdf_browsertest_base.cc",
512 "pdf/pdf_browsertest_base.h",
513 "test/test_confirm_bubble_model.cc",
514 "test/test_confirm_bubble_model.h",
515 "toolbar/test_toolbar_action_view_controller.cc",
516 "toolbar/test_toolbar_action_view_controller.h",
517 "website_settings/mock_permission_bubble_request.cc",
518 "website_settings/mock_permission_bubble_request.h",
522 sources += [ "views/find_bar_host_unittest_util_views.cc" ]
529 "//chrome/app/theme:theme_resources",
531 "//content/public/browser",
532 "//content/public/common",
533 "//content/test:test_support",
534 "//net:test_support",