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",
36 # NOTE: New dependencies should generally be added in the OS!="ios"
37 # dependencies block below, rather than here.
39 "//chrome:extra_resources",
42 "//chrome/app/resources:platform_locale_settings",
43 "//chrome/app/theme:theme_resources",
44 "//chrome/browser/net:cert_logger_proto",
46 "//chrome/common/net",
47 "//components/app_modal",
48 "//components/auto_login_parser",
49 "//components/dom_distiller/webui",
50 "//components/feedback/proto",
51 "//components/history/core/browser:proto",
52 "//components/invalidation",
54 "//components/password_manager/core/browser",
55 "//components/resources",
56 "//components/strings",
57 "//components/update_client",
58 "//content/public/browser",
59 "//content/public/common",
62 "//third_party/cacheinvalidation",
64 "//third_party/libusb",
65 "//third_party/libxml",
69 "//ui/content_accelerators",
71 "//ui/events:gesture_detection",
74 "//ui/message_center",
82 sources += rebase_path(gypi_values.chrome_browser_ui_non_ios_sources,
85 sources += rebase_path(gypi_values.chrome_browser_ui_global_error_sources,
88 sources += rebase_path(gypi_values.chrome_browser_ui_omnibox_sources,
91 sources += rebase_path(gypi_values.chrome_browser_ui_toolbar_model_sources,
95 "//chrome/browser/devtools",
96 "//chrome/browser/ui/views",
97 "//chrome/browser/ui/webui/omnibox:mojo_bindings",
98 "//chrome/installer/util",
99 "//components/autofill/content/browser:risk_proto",
100 "//components/power",
101 "//components/suggestions/proto",
107 "//third_party/WebKit/public:resources",
108 "//third_party/adobe/flash:flapper_version_h",
109 "//third_party/expat",
110 "//third_party/hunspell",
111 "//third_party/leveldatabase",
112 "//third_party/mojo/src/mojo/edk/system",
113 "//third_party/npapi",
114 "//third_party/libjingle",
125 # '<@(nacl_defines)',
127 #'direct_dependent_settings': {
129 # '<@(nacl_defines)',
135 rebase_path(gypi_values.chrome_browser_ui_ios_sources, ".", "//chrome")
139 if (!is_android && !is_ios) {
140 sources += rebase_path(gypi_values.chrome_browser_ui_non_mobile_sources,
144 rebase_path(gypi_values.chrome_browser_ui_omnibox_non_mobile_sources,
148 "//device/bluetooth",
149 "//components/copresence",
153 if (enable_basic_printing || enable_print_preview) {
154 deps += [ "//printing" ]
157 if (enable_one_click_signin) {
159 rebase_path(gypi_values.chrome_browser_ui_one_click_signin_sources,
163 if (enable_task_manager) {
164 sources += rebase_path(gypi_values.chrome_browser_ui_task_manager_sources,
167 if (!toolkit_views || is_mac) {
168 sources -= [ "views/task_manager_view.cc" ]
173 rebase_path(gypi_values.chrome_browser_ui_nacl_sources, ".", "//chrome")
175 #"//native_client/src/trusted/service_runtime/service_runtime.gyp:sel", TODO(GYP)
178 if (enable_configuration_policy) {
179 sources += rebase_path(gypi_values.chrome_browser_ui_policy_sources,
182 deps += [ "//components/policy" ]
184 if (enable_plugins) {
185 sources += rebase_path(gypi_values.chrome_browser_ui_plugin_sources,
188 deps += [ "//ppapi:ppapi_ipc" ]
190 if (safe_browsing_mode == 1) {
191 defines += [ "FULL_SAFE_BROWSING" ]
193 "//chrome/browser/safe_browsing:chunk_proto",
194 "//chrome/common/safe_browsing:proto",
195 "//chrome/browser/safe_browsing:report_proto",
199 sources += rebase_path(gypi_values.chrome_browser_ui_chromeos_sources,
202 deps += [ "//chrome/browser/chromeos" ]
204 sources += rebase_path(gypi_values.chrome_browser_ui_non_chromeos_sources,
209 configs += [ "//printing:cups" ]
213 rebase_path(gypi_values.chrome_browser_ui_ash_sources, ".", "//chrome")
216 "//ash:ash_with_content",
218 "//components/user_manager",
221 sources += rebase_path(gypi_values.chrome_browser_ui_ash_non_chromeos,
226 sources += rebase_path(gypi_values.chrome_browser_ui_non_ash_sources,
231 sources += rebase_path(gypi_values.chrome_browser_ui_views_sources,
234 deps += [ "//components/constrained_window" ]
237 rebase_path(gypi_values.chrome_browser_ui_views_non_chromeos_sources,
242 if (mac_views_browser) {
244 "cocoa/bookmarks/bookmark_drag_drop_cocoa.mm",
245 "cocoa/browser_window_factory_cocoa.mm",
246 "cocoa/tab_dialogs_cocoa.mm",
250 "views/bookmarks/bookmark_drag_drop_views.cc",
251 "views/frame/browser_window_factory.cc",
252 "views/tab_dialogs_views.cc",
257 rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
260 deps += [ "//extensions/components/native_app_window" ]
263 sources += rebase_path(gypi_values.chrome_browser_ui_ash_views_sources,
268 if (use_aura && !use_ozone && is_desktop_linux) {
270 "//build/config/linux:gio",
272 # gtk2 is the only component that can interact with gtk2 in our new
274 "//chrome/browser/ui/libgtk2ui",
277 if (is_win || is_mac || is_desktop_linux) {
278 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_sources,
284 rebase_path(gypi_values.chrome_browser_ui_aura_sources, ".", "//chrome")
286 # aura uses some of ash resources.
290 "//ui/keyboard:resources",
294 sources += rebase_path(gypi_values.chrome_browser_ui_aura_non_chromeos,
299 if (ui_compositor_image_transport) {
300 deps += [ "//ui/gl" ]
304 rebase_path(gypi_values.chrome_browser_ui_nss_sources, ".", "//chrome")
306 if (!enable_themes) {
307 sources -= [ "webui/theme_source.cc" ]
309 if (enable_print_preview) {
310 sources += rebase_path(gypi_values.chrome_browser_ui_print_preview_sources,
314 if (is_linux || is_android) {
315 sources += rebase_path(gypi_values.chrome_browser_ui_android_linux_sources,
322 "//chrome/browser:jni_headers",
325 #'../components/components.gyp:web_contents_delegate_android', TODO(GYP)
328 "//chrome/browser/ui/views",
329 "//components/feedback/proto",
330 "//third_party/libusb",
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 "//third_party/google_toolbox_for_mac",
345 ":generate_localizer",
347 #'../third_party/apple_sample_code/apple_sample_code.gyp:apple_sample_code', TODO(GYP)
348 #'../third_party/molokocacao/molokocacao.gyp:molokocacao', TODO(GYP)
349 #'../third_party/mozilla/mozilla.gyp:mozilla', TODO(GYP)
351 include_dirs = [ "$target_gen_dir" ]
352 libs += [ "Quartz.framework" ]
354 [ "//third_party/google_toolbox_for_mac:google_toolbox_for_mac_config" ]
356 sources += rebase_path(gypi_values.chrome_browser_ui_non_mac_sources,
363 rebase_path(gypi_values.chrome_browser_ui_win_sources, ".", "//chrome")
364 sources -= [ "views/frame/taskbar_decorator.cc" ]
367 "//ui/views/controls/webview",
370 "//chrome/browser/metro_utils",
371 "//chrome/installer/util:strings",
374 "//third_party/iaccessible2",
375 "//third_party/isimpledom",
378 } else { # 'OS!="win"
382 "//ui/views/controls/webview",
386 if (is_desktop_linux) {
387 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_linux_sources,
391 if (is_linux) { # Both desktop Linux and ChromeOS.
392 sources += rebase_path(gypi_values.chrome_browser_ui_linux_sources,
395 deps += [ "//device/udev_linux" ]
397 configs += [ "//build/config/linux:fontconfig" ]
401 sources += rebase_path(gypi_values.chrome_browser_ui_x11_sources,
404 configs += [ "//build/config/linux:x11" ]
405 deps += [ "//ui/events/devices" ]
407 sources -= [ "views/tabs/window_finder_x11.cc" ]
412 if (enable_app_list) {
413 sources += rebase_path(gypi_values.chrome_browser_ui_app_list_sources,
416 deps += [ "//ui/app_list" ]
418 sources += rebase_path(gypi_values.chrome_browser_ui_non_app_list_sources,
422 if (enable_autofill_dialog) {
424 rebase_path(gypi_values.chrome_browser_ui_autofill_dialog_sources,
427 if (!is_android && !is_ios) {
428 sources += rebase_path(
429 gypi_values.chrome_browser_ui_autofill_dialog_non_mobile_sources,
433 "//third_party/libaddressinput",
434 "//third_party/libaddressinput:strings",
438 if (enable_extensions) {
440 "//chrome/browser/extensions",
441 "//chrome/common/extensions/api",
442 "//chrome/common/extensions/api:api_registration",
444 sources += rebase_path(gypi_values.chrome_browser_ui_extensions_sources,
448 if (enable_google_now && !is_android) {
449 sources += rebase_path(
450 gypi_values.chrome_browser_ui_google_now_non_android_sources,
455 sources += rebase_path(gypi_values.chrome_browser_ui_webrtc_sources,
459 if (enable_service_discovery) {
461 rebase_path(gypi_values.chrome_browser_ui_service_discovery_sources,
465 if (enable_spellcheck) {
466 deps += [ "//third_party/hunspell" ]
471 nib_gypi_values = exec_script("//build/gypi_to_gn.py",
472 [ rebase_path("../../chrome_nibs.gypi") ],
474 [ "../../chrome_nibs.gypi" ])
476 action("generate_localizer") {
477 script = "//chrome/tools/build/mac/generate_localizer"
479 table_path = "$target_gen_dir/ui_localizer_table.h"
483 args = [ rebase_path(table_path, root_build_dir) ] +
484 rebase_path(nib_gypi_values.mac_translated_xibs,
490 # In GYP this is part of test_support_common.
491 source_set("test_support") {
496 "cocoa/find_bar/find_bar_host_unittest_util_cocoa.mm",
497 "cocoa/run_loop_testing.h",
498 "cocoa/run_loop_testing.mm",
499 "exclusive_access/fullscreen_controller_state_test.cc",
500 "exclusive_access/fullscreen_controller_state_test.h",
501 "exclusive_access/fullscreen_controller_state_tests.h",
502 "exclusive_access/fullscreen_controller_test.cc",
503 "exclusive_access/fullscreen_controller_test.h",
504 "find_bar/find_bar_host_unittest_util.h",
505 "login/login_prompt_test_utils.cc",
506 "login/login_prompt_test_utils.h",
507 "passwords/manage_passwords_ui_controller_mock.cc",
508 "passwords/manage_passwords_ui_controller_mock.h",
509 "pdf/pdf_browsertest_base.cc",
510 "pdf/pdf_browsertest_base.h",
511 "test/test_confirm_bubble_model.cc",
512 "test/test_confirm_bubble_model.h",
513 "website_settings/mock_permission_bubble_request.cc",
514 "website_settings/mock_permission_bubble_request.h",
518 sources += [ "views/find_bar_host_unittest_util_views.cc" ]
525 "//chrome/app/theme:theme_resources",
527 "//content/public/browser",
528 "//content/public/common",
529 "//content/test:test_support",
530 "//net:test_support",