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",
96 "//components/suggestions/proto",
97 "//components/url_formatter",
103 "//third_party/WebKit/public:resources",
104 "//third_party/adobe/flash:flapper_version_h",
105 "//third_party/leveldatabase",
106 "//third_party/mojo/src/mojo/edk/system",
107 "//third_party/libjingle",
118 rebase_path(gypi_values.chrome_browser_ui_ios_sources, ".", "//chrome")
122 if (!is_android && !is_ios) {
123 sources += rebase_path(gypi_values.chrome_browser_ui_non_mobile_sources,
127 rebase_path(gypi_values.chrome_browser_ui_omnibox_non_mobile_sources,
131 "//components/copresence",
132 "//components/feedback/proto",
133 "//components/proximity_auth/webui",
134 "//device/bluetooth",
135 "//third_party/libusb",
139 if (enable_basic_printing || enable_print_preview) {
140 deps += [ "//printing" ]
145 rebase_path(gypi_values.chrome_browser_ui_nacl_sources, ".", "//chrome")
146 deps += [ "//native_client/src/trusted/service_runtime:sel" ]
148 if (enable_configuration_policy) {
149 sources += rebase_path(gypi_values.chrome_browser_ui_policy_sources,
152 deps += [ "//components/policy" ]
154 if (enable_plugins) {
155 sources += rebase_path(gypi_values.chrome_browser_ui_plugin_sources,
158 deps += [ "//ppapi/proxy:ipc" ]
160 if (safe_browsing_mode == 1) {
162 "//chrome/browser/safe_browsing:chunk_proto",
163 "//chrome/common/safe_browsing:proto",
164 "//chrome/browser/safe_browsing:report_proto",
168 if (is_chromeos && !is_official_build) {
170 rebase_path(gypi_values.chrome_browser_ui_chromeos_non_official_sources,
176 sources += rebase_path(gypi_values.chrome_browser_ui_chromeos_sources,
179 deps += [ "//chrome/browser/chromeos" ]
181 sources += rebase_path(gypi_values.chrome_browser_ui_non_chromeos_sources,
184 defines += [ "FRAME_AVATAR_BUTTON=1" ]
187 configs += [ "//printing:cups" ]
191 rebase_path(gypi_values.chrome_browser_ui_ash_sources, ".", "//chrome")
194 "//ash:ash_with_content",
196 "//components/user_manager",
199 sources += rebase_path(gypi_values.chrome_browser_ui_ash_non_chromeos,
204 sources += rebase_path(gypi_values.chrome_browser_ui_non_ash_sources,
209 sources += rebase_path(gypi_values.chrome_browser_ui_views_sources,
212 deps += [ "//components/constrained_window" ]
214 if (enable_extensions) {
215 deps += [ "//extensions/components/native_app_window" ]
218 if (!is_chromeos && (!is_mac || mac_views_browser)) {
220 rebase_path(gypi_values.chrome_browser_ui_views_non_chromeos_sources,
226 rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
229 if (enable_extensions) {
230 sources += rebase_path(
231 gypi_values.chrome_browser_ui_views_extensions_non_mac_sources,
237 sources += rebase_path(gypi_values.chrome_browser_ui_ash_views_sources,
242 if (use_aura && !use_ozone && is_desktop_linux) {
246 # gtk2 is the only component that can interact with gtk2 in our new
248 "//chrome/browser/ui/libgtk2ui",
251 if (is_win || is_mac || is_desktop_linux) {
252 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_sources,
258 rebase_path(gypi_values.chrome_browser_ui_aura_sources, ".", "//chrome")
260 # aura uses some of ash resources.
264 "//ui/keyboard:resources",
268 sources += rebase_path(gypi_values.chrome_browser_ui_aura_non_chromeos,
273 if (ui_compositor_image_transport) {
274 deps += [ "//ui/gl" ]
278 rebase_path(gypi_values.chrome_browser_ui_nss_sources, ".", "//chrome")
280 if (!enable_themes) {
281 sources -= [ "webui/theme_source.cc" ]
283 if (enable_print_preview) {
284 sources += rebase_path(gypi_values.chrome_browser_ui_print_preview_sources,
291 "//chrome/browser:jni_headers",
293 "//components/web_contents_delegate_android",
296 "//chrome/browser/ui/views",
299 sources += rebase_path(gypi_values.chrome_browser_ui_android_sources,
303 defines += [ "CHROME_BUILD_ID=" + android_chrome_build_id ]
308 rebase_path(gypi_values.chrome_browser_ui_mac_sources, ".", "//chrome")
310 ":generate_localizer",
311 "//third_party/apple_sample_code",
312 "//third_party/google_toolbox_for_mac",
313 "//third_party/molokocacao",
314 "//third_party/mozilla",
316 if (mac_views_browser) {
317 sources += rebase_path(
318 gypi_values.chrome_browser_ui_views_mac_experimental_sources,
322 rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
325 sources += rebase_path(
326 gypi_values.chrome_browser_ui_views_extensions_non_mac_sources,
329 deps += [ "//extensions/components/native_app_window" ]
331 sources += rebase_path(gypi_values.chrome_browser_ui_cocoa_sources,
335 include_dirs = [ "$target_gen_dir" ]
336 libs += [ "Quartz.framework" ]
338 [ "//third_party/google_toolbox_for_mac:google_toolbox_for_mac_config" ]
340 sources += rebase_path(gypi_values.chrome_browser_ui_non_mac_sources,
347 rebase_path(gypi_values.chrome_browser_ui_win_sources, ".", "//chrome")
349 "views/apps/keyboard_hook_handler.cc",
350 "views/frame/taskbar_decorator.cc",
354 "//ui/views/controls/webview",
357 "//chrome/browser/metro_utils",
358 "//chrome/installer/util:strings",
361 "//third_party/iaccessible2",
362 "//third_party/isimpledom",
365 if (!is_chrome_branded) {
366 deps -= [ "//google_update" ]
367 sources -= [ "webui/help/version_updater_win.cc" ]
369 "webui/help/version_updater_basic.cc",
370 "webui/help/version_updater_basic.h",
373 } else { # 'OS!="win"
377 "//ui/views/controls/webview",
381 if (is_desktop_linux) {
382 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_linux_sources,
386 if (is_linux) { # Both desktop Linux and ChromeOS.
387 sources += rebase_path(gypi_values.chrome_browser_ui_linux_sources,
391 configs += [ "//build/config/linux:fontconfig" ]
395 sources += rebase_path(gypi_values.chrome_browser_ui_x11_sources,
398 configs += [ "//build/config/linux:x11" ]
399 deps += [ "//ui/events/devices" ]
401 sources -= [ "views/tabs/window_finder_x11.cc" ]
407 deps += [ "//device/udev_linux" ]
410 if (enable_app_list) {
411 sources += rebase_path(gypi_values.chrome_browser_ui_app_list_sources,
414 deps += [ "//ui/app_list" ]
416 sources += rebase_path(gypi_values.chrome_browser_ui_non_app_list_sources,
420 if (enable_autofill_dialog) {
422 rebase_path(gypi_values.chrome_browser_ui_autofill_dialog_sources,
425 if (!is_android && !is_ios) {
426 sources += rebase_path(
427 gypi_values.chrome_browser_ui_autofill_dialog_non_mobile_sources,
431 "//third_party/libaddressinput",
432 "//third_party/libaddressinput:strings",
436 if (enable_extensions) {
438 "//chrome/browser/extensions",
439 "//chrome/common/extensions/api",
440 "//chrome/common/extensions/api:api_registration",
442 sources += rebase_path(gypi_values.chrome_browser_ui_extensions_sources,
446 if (enable_google_now && !is_android) {
447 sources += rebase_path(
448 gypi_values.chrome_browser_ui_google_now_non_android_sources,
452 if (enable_media_router && !is_android && !is_ios) {
453 sources += rebase_path(gypi_values.chrome_browser_ui_media_router_sources,
456 deps += [ "//chrome/browser/media/router" ]
459 sources += rebase_path(gypi_values.chrome_browser_ui_webrtc_sources,
463 if (enable_service_discovery) {
465 rebase_path(gypi_values.chrome_browser_ui_service_discovery_sources,
472 nib_gypi_values = exec_script("//build/gypi_to_gn.py",
473 [ rebase_path("../../chrome_nibs.gypi") ],
475 [ "../../chrome_nibs.gypi" ])
477 action("generate_localizer") {
478 script = "//chrome/tools/build/mac/generate_localizer"
480 table_path = "$target_gen_dir/ui_localizer_table.h"
484 args = [ rebase_path(table_path, root_build_dir) ] +
485 rebase_path(nib_gypi_values.mac_translated_xibs,
491 # In GYP this is part of test_support_common.
492 source_set("test_support") {
497 "cocoa/extensions/browser_action_test_util_mac.mm",
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 "test/test_confirm_bubble_model.cc",
512 "test/test_confirm_bubble_model.h",
513 "toolbar/test_toolbar_action_view_controller.cc",
514 "toolbar/test_toolbar_action_view_controller.h",
515 "website_settings/mock_permission_bubble_request.cc",
516 "website_settings/mock_permission_bubble_request.h",
520 sources += [ "views/find_bar_host_unittest_util_views.cc" ]
522 sources += [ "views/toolbar/browser_action_test_util_views.cc" ]
530 "//chrome/app/theme:theme_resources",
532 "//content/public/browser",
533 "//content/public/common",
534 "//content/test:test_support",
535 "//net:test_support",