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/app_modal_dialogs",
50 "//components/auto_login_parser",
51 "//components/dom_distiller/webui",
52 "//components/feedback/proto",
53 "//components/invalidation",
54 "//components/omaha_query_params",
56 "//components/password_manager/core/browser",
57 "//components/resources",
58 "//components/strings",
59 "//content/public/browser",
60 "//content/public/common",
63 "//third_party/cacheinvalidation",
65 "//third_party/libusb",
66 "//third_party/libxml",
71 "//ui/events:gesture_detection",
74 "//ui/message_center",
82 sources += rebase_path(gypi_values.chrome_browser_ui_non_ios_sources,
85 "//chrome/browser/devtools",
86 "//chrome/browser/ui/views",
87 "//chrome/browser/ui/webui/omnibox:mojo_bindings",
88 "//chrome/installer/util",
89 "//components/autofill/content/browser:risk_proto",
97 "//third_party/WebKit/public:resources",
98 "//third_party/adobe/flash:flapper_version_h",
99 "//third_party/expat",
100 "//third_party/hunspell",
101 "//third_party/leveldatabase",
102 "//third_party/npapi",
103 "//third_party/libjingle",
112 # '<@(nacl_defines)',
114 #'direct_dependent_settings': {
116 # '<@(nacl_defines)',
121 sources += rebase_path(gypi_values.chrome_browser_ui_ios_sources,
126 if (!is_android && !is_ios) {
127 sources += rebase_path(gypi_values.chrome_browser_ui_non_mobile_sources,
129 deps += [ "//device/bluetooth" ]
132 if (enable_basic_printing || enable_print_preview) {
133 deps += [ "//printing" ]
136 if (enable_one_click_signin) {
137 sources += rebase_path(
138 gypi_values.chrome_browser_ui_one_click_signin_sources,
141 if (enable_task_manager) {
142 sources += rebase_path(gypi_values.chrome_browser_ui_task_manager_sources,
144 if (!toolkit_views || is_mac) {
145 sources -= [ "views/task_manager_view.cc" ]
149 sources += rebase_path(gypi_values.chrome_browser_ui_nacl_sources,
152 #"//native_client/src/trusted/service_runtime/service_runtime.gyp:sel", TODO(GYP)
155 if (enable_configuration_policy) {
156 sources += rebase_path(gypi_values.chrome_browser_ui_policy_sources,
158 deps += [ "//components/policy" ]
160 if (enable_plugins) {
161 sources += rebase_path(gypi_values.chrome_browser_ui_plugin_sources,
163 deps += [ "//ppapi:ppapi_ipc" ]
165 if (safe_browsing_mode == 1) {
166 defines += [ "FULL_SAFE_BROWSING" ]
168 "//chrome/browser/safe_browsing:chunk_proto",
169 "//chrome/common/safe_browsing:proto",
170 "//chrome/browser/safe_browsing:report_proto",
174 sources += rebase_path(gypi_values.chrome_browser_ui_chromeos_sources,
177 "//chrome/browser/chromeos",
180 sources += rebase_path(gypi_values.chrome_browser_ui_non_chromeos_sources,
184 configs += [ "//printing:cups" ]
187 sources += rebase_path(gypi_values.chrome_browser_ui_ash_sources,
191 "//ash:ash_with_content",
193 "//components/user_manager",
196 sources += rebase_path(gypi_values.chrome_browser_ui_ash_non_chromeos,
200 sources += rebase_path(gypi_values.chrome_browser_ui_non_ash_sources,
204 sources += rebase_path(gypi_values.chrome_browser_ui_athena_sources,
206 } else { # Not athena.
208 sources += rebase_path(
209 gypi_values.chrome_browser_ui_non_athena_non_android_sources,
213 sources += rebase_path(
214 gypi_values.chrome_browser_ui_ash_non_athena_sources,
219 sources += rebase_path(gypi_values.chrome_browser_ui_views_sources,
221 deps += [ "//components/constrained_window" ]
223 sources += rebase_path(
224 gypi_values.chrome_browser_ui_views_non_chromeos_sources,
228 sources += rebase_path(
229 gypi_values.chrome_browser_ui_views_non_mac_sources,
232 "//extensions/components/native_app_window",
236 sources += rebase_path(gypi_values.chrome_browser_ui_ash_views_sources,
240 if (use_aura && !use_ozone && is_desktop_linux) {
242 "//build/config/linux:gio",
243 # gtk2 is the only component that can interact with gtk2 in our new
245 "//chrome/browser/ui/libgtk2ui",
248 if (is_win || is_mac || is_desktop_linux) {
249 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_sources,
253 sources += rebase_path(gypi_values.chrome_browser_ui_aura_sources,
256 # aura uses some of ash resources.
260 "//ui/keyboard:resources",
264 sources += rebase_path(gypi_values.chrome_browser_ui_aura_non_chromeos,
268 if (ui_compositor_image_transport) {
269 deps += [ "//ui/gl" ]
272 sources += rebase_path(gypi_values.chrome_browser_ui_nss_sources,
275 if (!enable_themes) {
276 sources -= [ "webui/theme_source.cc" ]
278 if (enable_print_preview) {
279 sources += rebase_path(gypi_values.chrome_browser_ui_print_preview_sources,
282 if (is_linux || is_android) {
283 sources += rebase_path(gypi_values.chrome_browser_ui_android_linux_sources,
289 "//chrome/browser:jni_headers",
291 #'../components/components.gyp:web_contents_delegate_android', TODO(GYP)
294 "//chrome/browser/ui/views",
295 "//components/feedback/proto",
296 "//third_party/libusb",
299 sources += rebase_path(gypi_values.chrome_browser_ui_android_sources,
302 defines += [ "CHROME_BUILD_ID=" + android_chrome_build_id ]
303 } else { # Non-Android.
304 sources += rebase_path(gypi_values.chrome_browser_ui_non_android_sources,
309 sources += rebase_path(gypi_values.chrome_browser_ui_mac_sources,
312 # Mac has its own way of drawing tabs.
313 "tabs/tab_resources.cc",
314 "tabs/tab_resources.h",
317 "//third_party/google_toolbox_for_mac",
318 ":generate_localizer",
319 #'../third_party/apple_sample_code/apple_sample_code.gyp:apple_sample_code', TODO(GYP)
320 #'../third_party/molokocacao/molokocacao.gyp:molokocacao', TODO(GYP)
321 #'../third_party/mozilla/mozilla.gyp:mozilla', TODO(GYP)
323 include_dirs = [ "$target_gen_dir" ]
324 libs += [ "Quartz.framework" ]
326 "//third_party/google_toolbox_for_mac:google_toolbox_for_mac_config",
329 sources += rebase_path(gypi_values.chrome_browser_ui_non_mac_sources,
334 sources += rebase_path(gypi_values.chrome_browser_ui_win_sources,
338 "//ui/views/controls/webview",
341 "//chrome/installer/util:strings",
343 "//third_party/iaccessible2",
344 "//third_party/isimpledom",
346 #'metro_utils', TODO(GYP)
347 #'../google_update/google_update.gyp:google_update', TODO(GYP)
349 } else { # 'OS!="win"
353 "//ui/views/controls/webview",
357 if (is_desktop_linux) {
358 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_linux_sources,
361 if (is_linux) { # Both desktop Linux and ChromeOS.
362 sources += rebase_path(gypi_values.chrome_browser_ui_linux_sources,
364 configs += [ "//build/config/linux:udev" ]
366 configs += [ "//build/config/linux:fontconfig" ]
370 sources += rebase_path(gypi_values.chrome_browser_ui_x11_sources,
372 configs += [ "//build/config/linux:x11" ]
373 deps += [ "//ui/events/devices" ]
375 sources -= [ "views/tabs/window_finder_x11.cc" ]
380 if (enable_app_list) {
381 sources += rebase_path(gypi_values.chrome_browser_ui_app_list_sources,
383 deps += [ "//ui/app_list" ]
385 sources += rebase_path(gypi_values.chrome_browser_ui_non_app_list_sources,
388 if (enable_autofill_dialog) {
389 sources += rebase_path(
390 gypi_values.chrome_browser_ui_autofill_dialog_sources,
392 if (!is_android && !is_ios) {
393 sources += rebase_path(
394 gypi_values.chrome_browser_ui_autofill_dialog_non_mobile_sources,
397 "//third_party/libaddressinput",
398 "//third_party/libaddressinput:strings",
402 if (enable_extensions) {
404 "//chrome/browser/extensions",
405 "//chrome/common/extensions/api",
406 "//chrome/common/extensions/api:api_registration",
408 sources += rebase_path(gypi_values.chrome_browser_ui_extensions_sources,
411 if (enable_google_now && !is_android) {
412 sources += rebase_path(
413 gypi_values.chrome_browser_ui_google_now_non_android_sources,
417 sources += rebase_path(gypi_values.chrome_browser_ui_webrtc_sources,
420 if (enable_service_discovery) {
421 sources += rebase_path(
422 gypi_values.chrome_browser_ui_service_discovery_sources,
425 if (enable_spellcheck) {
426 deps += [ "//third_party/hunspell" ]
431 nib_gypi_values = exec_script(
432 "//build/gypi_to_gn.py",
433 [ rebase_path("../../chrome_nibs.gypi") ],
435 [ "../../chrome_nibs.gypi" ])
437 action("generate_localizer") {
438 script = "//chrome/tools/build/mac/generate_localizer"
440 table_path = "$target_gen_dir/ui_localizer_table.h"
441 outputs = [ table_path ]
442 args = [ rebase_path(table_path, root_build_dir) ] +
443 rebase_path(nib_gypi_values.mac_translated_xibs,
449 # In GYP this is part of test_support_common.
450 source_set("test_support") {
455 "cocoa/find_bar/find_bar_host_unittest_util_cocoa.mm",
456 "cocoa/run_loop_testing.h",
457 "cocoa/run_loop_testing.mm",
458 "find_bar/find_bar_host_unittest_util.h",
459 "fullscreen/fullscreen_controller_state_test.cc",
460 "fullscreen/fullscreen_controller_state_test.h",
461 "fullscreen/fullscreen_controller_state_tests.h",
462 "fullscreen/fullscreen_controller_test.cc",
463 "fullscreen/fullscreen_controller_test.h",
464 "login/login_prompt_test_utils.cc",
465 "login/login_prompt_test_utils.h",
466 "passwords/manage_passwords_ui_controller_mock.cc",
467 "passwords/manage_passwords_ui_controller_mock.h",
468 "pdf/pdf_browsertest_base.cc",
469 "pdf/pdf_browsertest_base.h",
470 "test/test_confirm_bubble_model.cc",
471 "test/test_confirm_bubble_model.h",
472 "website_settings/mock_permission_bubble_request.cc",
473 "website_settings/mock_permission_bubble_request.h",
478 "views/find_bar_host_unittest_util_views.cc",
486 "//chrome/app/theme:theme_resources",
488 "//content/public/browser",
489 "//content/public/common",
490 "//content/test:test_support",
491 "//net:test_support",