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" ])
15 output_name = "browser_ui"
22 "//build/config:precompiled_headers",
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",
34 "//content/public/browser",
38 # NOTE: New dependencies should generally be added in the OS!="ios"
39 # dependencies block below, rather than here.
41 "//chrome:extra_resources",
44 "//chrome/app/resources:platform_locale_settings",
45 "//chrome/app/theme:theme_resources",
47 "//components/app_modal",
48 "//components/auto_login_parser",
49 "//components/certificate_reporting:cert_logger_proto",
50 "//components/certificate_reporting:encrypted_cert_logger_proto",
51 "//components/dom_distiller/webui",
52 "//components/invalidation/impl",
53 "//components/omnibox/common",
55 "//components/password_manager/core/browser",
56 "//components/resources",
57 "//components/strings",
58 "//components/toolbar",
59 "//components/update_client",
60 "//content/public/common",
63 "//third_party/cacheinvalidation",
68 "//ui/content_accelerators",
70 "//ui/events:gesture_detection",
73 "//ui/message_center",
81 sources += rebase_path(gypi_values.chrome_browser_ui_non_ios_sources,
84 sources += rebase_path(gypi_values.chrome_browser_ui_toolbar_model_sources,
88 "//chrome/browser/devtools",
89 "//chrome/browser/ui/views",
90 "//chrome/browser/ui/webui/omnibox:mojo_bindings",
91 "//chrome/common/net",
92 "//chrome/installer/util",
93 "//components/autofill/content/browser:risk_proto",
94 "//components/bubble:bubble",
95 "//components/net_log",
96 "//components/page_load_metrics/browser",
98 "//components/suggestions/proto",
99 "//components/url_formatter",
105 "//third_party/WebKit/public:resources",
106 "//third_party/adobe/flash:flapper_version_h",
107 "//third_party/leveldatabase",
108 "//third_party/mojo/src/mojo/edk/system",
109 "//third_party/libjingle",
120 rebase_path(gypi_values.chrome_browser_ui_ios_sources, ".", "//chrome")
124 if (!is_android && !is_ios) {
125 sources += rebase_path(gypi_values.chrome_browser_ui_non_mobile_sources,
129 rebase_path(gypi_values.chrome_browser_ui_omnibox_non_mobile_sources,
133 "//components/copresence",
134 "//components/feedback/proto",
135 "//components/proximity_auth/webui",
136 "//device/bluetooth",
137 "//third_party/libusb",
141 if (enable_basic_printing || enable_print_preview) {
142 deps += [ "//printing" ]
147 rebase_path(gypi_values.chrome_browser_ui_nacl_sources, ".", "//chrome")
148 deps += [ "//native_client/src/trusted/service_runtime:sel" ]
150 if (enable_configuration_policy) {
151 sources += rebase_path(gypi_values.chrome_browser_ui_policy_sources,
154 deps += [ "//components/policy" ]
156 if (enable_plugins) {
157 sources += rebase_path(gypi_values.chrome_browser_ui_plugin_sources,
160 deps += [ "//ppapi/proxy:ipc" ]
162 if (safe_browsing_mode == 1) {
164 "//chrome/browser/safe_browsing:chunk_proto",
165 "//chrome/common/safe_browsing:proto",
166 "//chrome/browser/safe_browsing:report_proto",
170 if (is_chromeos && !is_official_build) {
172 rebase_path(gypi_values.chrome_browser_ui_chromeos_non_official_sources,
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,
186 defines += [ "FRAME_AVATAR_BUTTON=1" ]
189 configs += [ "//printing:cups" ]
193 rebase_path(gypi_values.chrome_browser_ui_ash_sources, ".", "//chrome")
196 "//ash:ash_with_content",
198 "//components/user_manager",
201 sources += rebase_path(gypi_values.chrome_browser_ui_ash_non_chromeos,
206 sources += rebase_path(gypi_values.chrome_browser_ui_non_ash_sources,
211 sources += rebase_path(gypi_values.chrome_browser_ui_views_sources,
214 deps += [ "//components/constrained_window" ]
216 if (enable_extensions) {
217 deps += [ "//extensions/components/native_app_window" ]
220 if (!is_chromeos && (!is_mac || mac_views_browser)) {
222 rebase_path(gypi_values.chrome_browser_ui_views_non_chromeos_sources,
228 rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
231 if (enable_extensions) {
232 sources += rebase_path(
233 gypi_values.chrome_browser_ui_views_extensions_non_mac_sources,
239 sources += rebase_path(gypi_values.chrome_browser_ui_ash_views_sources,
244 if (use_aura && !use_ozone && is_desktop_linux) {
248 # gtk2 is the only component that can interact with gtk2 in our new
250 "//chrome/browser/ui/libgtk2ui",
253 if (is_win || is_mac || is_desktop_linux) {
254 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_sources,
260 rebase_path(gypi_values.chrome_browser_ui_aura_sources, ".", "//chrome")
262 # aura uses some of ash resources.
266 "//ui/keyboard:resources",
270 sources += rebase_path(gypi_values.chrome_browser_ui_aura_non_chromeos,
275 if (ui_compositor_image_transport) {
276 deps += [ "//ui/gl" ]
280 rebase_path(gypi_values.chrome_browser_ui_nss_sources, ".", "//chrome")
282 if (!enable_themes) {
283 sources -= [ "webui/theme_source.cc" ]
285 if (enable_print_preview) {
286 sources += rebase_path(gypi_values.chrome_browser_ui_print_preview_sources,
293 "//chrome/browser:jni_headers",
295 "//components/web_contents_delegate_android",
298 "//chrome/browser/ui/views",
301 sources += rebase_path(gypi_values.chrome_browser_ui_android_sources,
305 defines += [ "CHROME_BUILD_ID=" + android_chrome_build_id ]
310 rebase_path(gypi_values.chrome_browser_ui_mac_sources, ".", "//chrome")
312 ":generate_localizer",
313 "//third_party/apple_sample_code",
314 "//third_party/google_toolbox_for_mac",
315 "//third_party/molokocacao",
316 "//third_party/mozilla",
318 if (mac_views_browser) {
319 sources += rebase_path(
320 gypi_values.chrome_browser_ui_views_mac_experimental_sources,
324 rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
327 sources += rebase_path(
328 gypi_values.chrome_browser_ui_views_extensions_non_mac_sources,
331 deps += [ "//extensions/components/native_app_window" ]
333 sources += rebase_path(gypi_values.chrome_browser_ui_cocoa_sources,
337 include_dirs = [ "$target_gen_dir" ]
338 libs += [ "Quartz.framework" ]
340 [ "//third_party/google_toolbox_for_mac:google_toolbox_for_mac_config" ]
342 sources += rebase_path(gypi_values.chrome_browser_ui_non_mac_sources,
349 rebase_path(gypi_values.chrome_browser_ui_win_sources, ".", "//chrome")
350 sources -= [ "views/frame/taskbar_decorator.cc" ]
353 "//ui/views/controls/webview",
356 "//chrome/browser/metro_utils",
357 "//chrome/installer/util:strings",
360 "//third_party/iaccessible2",
361 "//third_party/isimpledom",
364 if (!is_chrome_branded) {
365 deps -= [ "//google_update" ]
366 sources -= [ "webui/help/version_updater_win.cc" ]
368 "webui/help/version_updater_basic.cc",
369 "webui/help/version_updater_basic.h",
372 } else { # 'OS!="win"
376 "//ui/views/controls/webview",
380 if (is_desktop_linux) {
381 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_linux_sources,
385 if (is_linux) { # Both desktop Linux and ChromeOS.
386 sources += rebase_path(gypi_values.chrome_browser_ui_linux_sources,
390 configs += [ "//build/config/linux:fontconfig" ]
394 sources += rebase_path(gypi_values.chrome_browser_ui_x11_sources,
397 configs += [ "//build/config/linux:x11" ]
398 deps += [ "//ui/events/devices" ]
400 sources -= [ "views/tabs/window_finder_x11.cc" ]
406 deps += [ "//device/udev_linux" ]
409 if (enable_app_list) {
410 sources += rebase_path(gypi_values.chrome_browser_ui_app_list_sources,
413 deps += [ "//ui/app_list" ]
415 sources += rebase_path(gypi_values.chrome_browser_ui_non_app_list_sources,
419 if (enable_autofill_dialog) {
421 rebase_path(gypi_values.chrome_browser_ui_autofill_dialog_sources,
424 if (!is_android && !is_ios) {
425 sources += rebase_path(
426 gypi_values.chrome_browser_ui_autofill_dialog_non_mobile_sources,
430 "//third_party/libaddressinput",
431 "//third_party/libaddressinput:strings",
435 if (enable_extensions) {
437 "//chrome/browser/extensions",
438 "//chrome/common/extensions/api",
439 "//chrome/common/extensions/api:api_registration",
441 sources += rebase_path(gypi_values.chrome_browser_ui_extensions_sources,
445 if (enable_google_now && !is_android) {
446 sources += rebase_path(
447 gypi_values.chrome_browser_ui_google_now_non_android_sources,
451 if (enable_media_router && !is_android && !is_ios) {
452 sources += rebase_path(gypi_values.chrome_browser_ui_media_router_sources,
455 deps += [ "//chrome/browser/media/router" ]
458 sources += rebase_path(gypi_values.chrome_browser_ui_webrtc_sources,
462 if (enable_service_discovery) {
464 rebase_path(gypi_values.chrome_browser_ui_service_discovery_sources,
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/extensions/browser_action_test_util_mac.mm",
497 "cocoa/find_bar/find_bar_host_unittest_util_cocoa.mm",
498 "cocoa/run_loop_testing.h",
499 "cocoa/run_loop_testing.mm",
500 "exclusive_access/fullscreen_controller_state_test.cc",
501 "exclusive_access/fullscreen_controller_state_test.h",
502 "exclusive_access/fullscreen_controller_state_tests.h",
503 "exclusive_access/fullscreen_controller_test.cc",
504 "exclusive_access/fullscreen_controller_test.h",
505 "find_bar/find_bar_host_unittest_util.h",
506 "login/login_prompt_test_utils.cc",
507 "login/login_prompt_test_utils.h",
508 "passwords/manage_passwords_ui_controller_mock.cc",
509 "passwords/manage_passwords_ui_controller_mock.h",
510 "test/test_confirm_bubble_model.cc",
511 "test/test_confirm_bubble_model.h",
512 "toolbar/test_toolbar_action_view_controller.cc",
513 "toolbar/test_toolbar_action_view_controller.h",
514 "website_settings/mock_permission_bubble_request.cc",
515 "website_settings/mock_permission_bubble_request.h",
519 sources += [ "views/find_bar_host_unittest_util_views.cc" ]
521 sources += [ "views/toolbar/browser_action_test_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",