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(
10 "//build/gypi_to_gn.py",
11 [ rebase_path("../../chrome_browser_ui.gypi") ],
13 [ "../../chrome_browser_ui.gypi" ])
15 static_library("ui") {
16 output_name = "browser_ui"
23 "//build/config/compiler:wexit_time_destructors",
24 "//third_party/WebKit/public:debug_devtools",
27 # Since browser and browser_ui actually depend on each other,
28 # we must omit the dependency from browser_ui to browser.
29 # However, this means browser_ui and browser should more or less
30 # have the same dependencies. Once browser_ui is untangled from
31 # browser, then we can clean up these dependencies.
33 "//components/dom_distiller/core",
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/history:in_memory_url_index_cache_proto",
46 "//chrome/browser/net:cert_logger_proto",
48 "//chrome/common/net",
49 "//components/auto_login_parser",
50 "//components/dom_distiller/webui",
51 "//components/feedback/proto",
52 "//components/invalidation",
53 "//components/omaha_query_params",
55 "//components/password_manager/core/browser",
56 "//components/resources",
57 "//components/strings",
58 "//content/public/browser",
59 "//content/public/common",
62 "//third_party/cacheinvalidation",
64 "//third_party/libusb",
65 "//third_party/libxml",
72 "//ui/message_center",
80 sources += rebase_path(gypi_values.chrome_browser_ui_non_ios_sources,
83 "//chrome/browser/devtools",
84 "//chrome/browser/ui/views",
85 "//chrome/browser/ui/webui/omnibox:mojo_bindings",
86 "//chrome/installer/util",
87 "//components/autofill/content/browser:risk_proto",
96 "//third_party/WebKit/public:resources",
97 "//third_party/adobe/flash:flapper_version_h",
98 "//third_party/expat",
99 "//third_party/hunspell",
100 "//third_party/leveldatabase",
101 "//third_party/npapi",
102 "//third_party/libjingle",
111 # '<@(nacl_defines)',
113 #'direct_dependent_settings': {
115 # '<@(nacl_defines)',
120 sources += rebase_path(gypi_values.chrome_browser_ui_ios_sources,
125 if (printing_mode != 0) {
126 deps += [ "//printing" ]
129 if (enable_one_click_signin) {
130 sources += rebase_path(
131 gypi_values.chrome_browser_ui_one_click_signin_sources,
134 if (enable_task_manager) {
135 sources += rebase_path(gypi_values.chrome_browser_ui_task_manager_sources,
137 if (!toolkit_views || is_mac) {
138 sources -= [ "views/task_manager_view.cc" ]
142 sources += rebase_path(gypi_values.chrome_browser_ui_nacl_sources,
145 #"//native_client/src/trusted/service_runtime/service_runtime.gyp:sel", TODO(GYP)
148 if (enable_configuration_policy) {
149 sources += rebase_path(gypi_values.chrome_browser_ui_policy_sources,
151 deps += [ "//components/policy" ]
153 if (enable_plugins) {
154 sources += rebase_path(gypi_values.chrome_browser_ui_plugin_sources,
156 deps += [ "//ppapi:ppapi_ipc" ]
158 if (safe_browsing_mode == 1) {
159 defines += [ "FULL_SAFE_BROWSING" ]
161 "//chrome/browser/safe_browsing:chunk_proto",
162 "//chrome/common/safe_browsing:proto",
163 "//chrome/browser/safe_browsing:report_proto",
167 sources += rebase_path(gypi_values.chrome_browser_ui_chromeos_sources,
170 "//chrome/browser/chromeos",
173 sources += rebase_path(gypi_values.chrome_browser_ui_non_chromeos_sources,
177 configs += [ "//printing:cups" ]
180 sources += rebase_path(gypi_values.chrome_browser_ui_ash_sources,
184 "//ash:ash_with_content",
186 "//components/user_manager",
189 sources += rebase_path(gypi_values.chrome_browser_ui_ash_non_chromeos,
193 sources += rebase_path(gypi_values.chrome_browser_ui_non_ash_sources,
197 sources += rebase_path(gypi_values.chrome_browser_ui_athena_sources,
199 } else { # Not athena.
201 sources += rebase_path(
202 gypi_values.chrome_browser_ui_ash_non_athena_sources,
207 sources += rebase_path(gypi_values.chrome_browser_ui_views_sources,
210 sources += rebase_path(
211 gypi_values.chrome_browser_ui_views_non_chromeos_sources,
215 sources += rebase_path(
216 gypi_values.chrome_browser_ui_views_non_mac_sources,
218 deps += [ "//extensions/components/native_app_window" ]
221 sources += rebase_path(gypi_values.chrome_browser_ui_ash_views_sources,
225 if (use_aura && !use_ozone && is_desktop_linux) {
227 "//build/config/linux:gio",
228 # gtk2 is the only component that can interact with gtk2 in our new
230 "//chrome/browser/ui/libgtk2ui",
233 if (is_win || is_mac || is_desktop_linux) {
234 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_sources,
238 sources += rebase_path(gypi_values.chrome_browser_ui_aura_sources,
241 # aura uses some of ash resources.
245 "//ui/keyboard:resources",
249 sources += rebase_path(gypi_values.chrome_browser_ui_aura_non_chromeos,
253 if (ui_compositor_image_transport) {
254 deps += [ "//ui/gl" ]
257 sources += rebase_path(gypi_values.chrome_browser_ui_nss_sources,
260 if (!enable_themes) {
261 sources -= [ "webui/theme_source.cc" ]
263 if (printing_mode == 1) {
264 sources += rebase_path(gypi_values.chrome_browser_ui_print_preview_sources,
267 if (is_linux || is_android) {
268 sources += rebase_path(gypi_values.chrome_browser_ui_android_linux_sources,
274 "//chrome/browser:jni_headers",
276 #'../components/components.gyp:web_contents_delegate_android', TODO(GYP)
279 "//chrome/browser/ui/views",
280 "//components/feedback/proto",
281 "//third_party/libusb",
284 sources += rebase_path(gypi_values.chrome_browser_ui_android_sources,
287 defines += [ "CHROME_BUILD_ID=" + android_chrome_build_id ]
288 } else { # Non-Android.
289 sources += rebase_path(gypi_values.chrome_browser_ui_non_android_sources,
294 sources += rebase_path(gypi_values.chrome_browser_ui_mac_sources,
297 # Mac has its own way of drawing tabs.
298 "tabs/tab_resources.cc",
299 "tabs/tab_resources.h",
302 "//third_party/google_toolbox_for_mac",
303 ":generate_localizer",
304 #'../third_party/apple_sample_code/apple_sample_code.gyp:apple_sample_code', TODO(GYP)
305 #'../third_party/molokocacao/molokocacao.gyp:molokocacao', TODO(GYP)
306 #'../third_party/mozilla/mozilla.gyp:mozilla', TODO(GYP)
308 include_dirs = [ "$target_gen_dir" ]
309 libs += [ "Quartz.framework" ]
311 "//third_party/google_toolbox_for_mac:google_toolbox_for_mac_config",
314 sources += rebase_path(gypi_values.chrome_browser_ui_non_mac_sources,
319 sources += rebase_path(gypi_values.chrome_browser_ui_win_sources,
323 "//ui/views/controls/webview",
326 "//chrome/installer/util:strings",
328 "//third_party/iaccessible2",
329 "//third_party/isimpledom",
331 #'metro_utils', TODO(GYP)
332 #'../google_update/google_update.gyp:google_update', TODO(GYP)
334 } else { # 'OS!="win"
338 "//ui/views/controls/webview",
342 if (is_desktop_linux) {
343 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_linux_sources,
346 if (is_linux) { # Both desktop Linux and ChromeOS.
347 sources += rebase_path(gypi_values.chrome_browser_ui_linux_sources,
349 configs += [ "//build/config/linux:udev" ]
351 configs += [ "//build/config/linux:fontconfig" ]
355 sources += rebase_path(gypi_values.chrome_browser_ui_x11_sources,
357 configs += [ "//build/config/linux:x11" ]
361 if (enable_app_list) {
362 sources += rebase_path(gypi_values.chrome_browser_ui_app_list_sources,
364 deps += [ "//ui/app_list" ]
366 sources += rebase_path(gypi_values.chrome_browser_ui_non_app_list_sources,
369 if (enable_autofill_dialog) {
370 sources += rebase_path(
371 gypi_values.chrome_browser_ui_autofill_dialog_sources,
373 if (!is_android && !is_ios) {
374 sources += rebase_path(
375 gypi_values.chrome_browser_ui_autofill_dialog_non_mobile_sources,
378 "//third_party/libaddressinput",
379 "//third_party/libaddressinput:strings",
383 if (enable_extensions) {
385 "//chrome/browser/extensions",
386 "//chrome/common/extensions/api",
387 "//chrome/common/extensions/api:api_registration",
389 sources += rebase_path(gypi_values.chrome_browser_ui_extensions_sources,
392 if (enable_google_now && !is_android) {
393 sources += rebase_path(
394 gypi_values.chrome_browser_ui_google_now_non_android_sources,
398 sources += rebase_path(gypi_values.chrome_browser_ui_webrtc_sources,
401 if (enable_service_discovery) {
402 sources += rebase_path(
403 gypi_values.chrome_browser_ui_service_discovery_sources,
406 if (enable_spellcheck) {
407 deps += [ "//third_party/hunspell" ]
412 nib_gypi_values = exec_script(
413 "//build/gypi_to_gn.py",
414 [ rebase_path("../../chrome_nibs.gypi") ],
416 [ "../../chrome_nibs.gypi" ])
418 action("generate_localizer") {
419 script = "//chrome/tools/build/mac/generate_localizer"
421 table_path = "$target_gen_dir/ui_localizer_table.h"
422 outputs = [ table_path ]
423 args = [ rebase_path(table_path, root_build_dir) ] +
424 rebase_path(nib_gypi_values.mac_translated_xibs,
430 # In GYP this is part of test_support_common.
431 source_set("test_support") {
436 "cocoa/find_bar/find_bar_host_unittest_util_cocoa.mm",
437 "cocoa/run_loop_testing.h",
438 "cocoa/run_loop_testing.mm",
439 "find_bar/find_bar_host_unittest_util.h",
440 "fullscreen/fullscreen_controller_state_test.cc",
441 "fullscreen/fullscreen_controller_state_test.h",
442 "fullscreen/fullscreen_controller_state_tests.h",
443 "fullscreen/fullscreen_controller_test.cc",
444 "fullscreen/fullscreen_controller_test.h",
445 "login/login_prompt_test_utils.cc",
446 "login/login_prompt_test_utils.h",
447 "passwords/manage_passwords_ui_controller_mock.cc",
448 "passwords/manage_passwords_ui_controller_mock.h",
449 "pdf/pdf_browsertest_base.cc",
450 "pdf/pdf_browsertest_base.h",
451 "test/test_confirm_bubble_model.cc",
452 "test/test_confirm_bubble_model.h",
453 "website_settings/mock_permission_bubble_request.cc",
454 "website_settings/mock_permission_bubble_request.h",
459 "views/find_bar_host_unittest_util_views.cc",
467 "//chrome/app/theme:theme_resources",
469 "//content/public/browser",
470 "//content/public/common",
471 "//content/test:test_support",
472 "//net:test_support",