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/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",
33 "//content/public/browser",
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/net:encrypted_cert_logger_proto",
46 "//chrome/browser/ssl:cert_logger_proto",
48 "//chrome/common/net",
49 "//components/app_modal",
50 "//components/auto_login_parser",
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/update_client",
59 "//content/public/common",
62 "//third_party/cacheinvalidation",
64 "//third_party/libxml",
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/installer/util",
92 "//components/autofill/content/browser:risk_proto",
94 "//components/suggestions/proto",
100 "//third_party/WebKit/public:resources",
101 "//third_party/adobe/flash:flapper_version_h",
102 "//third_party/leveldatabase",
103 "//third_party/mojo/src/mojo/edk/system",
104 "//third_party/libjingle",
115 rebase_path(gypi_values.chrome_browser_ui_ios_sources, ".", "//chrome")
119 if (!is_android && !is_ios) {
120 sources += rebase_path(gypi_values.chrome_browser_ui_non_mobile_sources,
124 rebase_path(gypi_values.chrome_browser_ui_omnibox_non_mobile_sources,
128 "//components/copresence",
129 "//components/feedback/proto",
130 "//components/proximity_auth/webui",
131 "//device/bluetooth",
132 "//third_party/libusb",
136 if (enable_basic_printing || enable_print_preview) {
137 deps += [ "//printing" ]
142 rebase_path(gypi_values.chrome_browser_ui_nacl_sources, ".", "//chrome")
143 deps += [ "//native_client/src/trusted/service_runtime:sel" ]
145 if (enable_configuration_policy) {
146 sources += rebase_path(gypi_values.chrome_browser_ui_policy_sources,
149 deps += [ "//components/policy" ]
151 if (enable_plugins) {
152 sources += rebase_path(gypi_values.chrome_browser_ui_plugin_sources,
155 deps += [ "//ppapi/proxy:ipc" ]
157 if (safe_browsing_mode == 1) {
159 "//chrome/browser/safe_browsing:chunk_proto",
160 "//chrome/common/safe_browsing:proto",
161 "//chrome/browser/safe_browsing:report_proto",
165 sources += rebase_path(gypi_values.chrome_browser_ui_chromeos_sources,
168 deps += [ "//chrome/browser/chromeos" ]
170 sources += rebase_path(gypi_values.chrome_browser_ui_non_chromeos_sources,
175 configs += [ "//printing:cups" ]
179 rebase_path(gypi_values.chrome_browser_ui_ash_sources, ".", "//chrome")
182 "//ash:ash_with_content",
184 "//components/user_manager",
187 sources += rebase_path(gypi_values.chrome_browser_ui_ash_non_chromeos,
192 sources += rebase_path(gypi_values.chrome_browser_ui_non_ash_sources,
197 sources += rebase_path(gypi_values.chrome_browser_ui_views_sources,
200 deps += [ "//components/constrained_window" ]
202 if (enable_extensions) {
203 deps += [ "//extensions/components/native_app_window" ]
206 if (!is_chromeos && (!is_mac || mac_views_browser)) {
208 rebase_path(gypi_values.chrome_browser_ui_views_non_chromeos_sources,
214 rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
217 if (enable_extensions) {
218 sources += rebase_path(
219 gypi_values.chrome_browser_ui_views_extensions_non_mac_sources,
224 # TODO(GYP): crbug.com/481629. These files should probably not be
225 # a part of ui_views_non_mac_sources at all.
227 "views/frame/opaque_browser_frame_view.cc",
228 "views/frame/opaque_browser_frame_view.h",
229 "views/frame/opaque_browser_frame_view_linux.cc",
230 "views/frame/opaque_browser_frame_view_linux.h",
235 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",
244 # gtk2 is the only component that can interact with gtk2 in our new
246 "//chrome/browser/ui/libgtk2ui",
249 if (is_win || is_mac || is_desktop_linux) {
250 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_sources,
256 rebase_path(gypi_values.chrome_browser_ui_aura_sources, ".", "//chrome")
258 # aura uses some of ash resources.
262 "//ui/keyboard:resources",
266 sources += rebase_path(gypi_values.chrome_browser_ui_aura_non_chromeos,
271 if (ui_compositor_image_transport) {
272 deps += [ "//ui/gl" ]
276 rebase_path(gypi_values.chrome_browser_ui_nss_sources, ".", "//chrome")
278 if (!enable_themes) {
279 sources -= [ "webui/theme_source.cc" ]
281 if (enable_print_preview) {
282 sources += rebase_path(gypi_values.chrome_browser_ui_print_preview_sources,
289 "//chrome/browser:jni_headers",
291 "//components/web_contents_delegate_android",
294 "//chrome/browser/ui/views",
297 sources += rebase_path(gypi_values.chrome_browser_ui_android_sources,
301 defines += [ "CHROME_BUILD_ID=" + android_chrome_build_id ]
306 rebase_path(gypi_values.chrome_browser_ui_mac_sources, ".", "//chrome")
308 ":generate_localizer",
309 "//third_party/apple_sample_code",
310 "//third_party/google_toolbox_for_mac",
311 "//third_party/molokocacao",
312 "//third_party/mozilla",
314 if (mac_views_browser) {
315 sources += rebase_path(
316 gypi_values.chrome_browser_ui_views_mac_experimental_sources,
320 rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
323 sources += rebase_path(
324 gypi_values.chrome_browser_ui_views_extensions_non_mac_sources,
327 deps += [ "//extensions/components/native_app_window" ]
329 sources += rebase_path(gypi_values.chrome_browser_ui_cocoa_sources,
333 include_dirs = [ "$target_gen_dir" ]
334 libs += [ "Quartz.framework" ]
336 [ "//third_party/google_toolbox_for_mac:google_toolbox_for_mac_config" ]
338 sources += rebase_path(gypi_values.chrome_browser_ui_non_mac_sources,
345 rebase_path(gypi_values.chrome_browser_ui_win_sources, ".", "//chrome")
347 "views/apps/keyboard_hook_handler.cc",
348 "views/frame/taskbar_decorator.cc",
352 "//ui/views/controls/webview",
355 "//chrome/browser/metro_utils",
356 "//chrome/installer/util:strings",
359 "//third_party/iaccessible2",
360 "//third_party/isimpledom",
363 if (!is_chrome_branded) {
364 deps -= [ "//google_update" ]
365 sources -= [ "webui/help/version_updater_win.cc" ]
367 "webui/help/version_updater_basic.cc",
368 "webui/help/version_updater_basic.h",
371 } else { # 'OS!="win"
375 "//ui/views/controls/webview",
379 if (is_desktop_linux) {
380 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_linux_sources,
384 if (is_linux) { # Both desktop Linux and ChromeOS.
385 sources += rebase_path(gypi_values.chrome_browser_ui_linux_sources,
388 deps += [ "//device/udev_linux" ]
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" ]
405 if (enable_app_list) {
406 sources += rebase_path(gypi_values.chrome_browser_ui_app_list_sources,
409 deps += [ "//ui/app_list" ]
411 sources += rebase_path(gypi_values.chrome_browser_ui_non_app_list_sources,
415 if (enable_autofill_dialog) {
417 rebase_path(gypi_values.chrome_browser_ui_autofill_dialog_sources,
420 if (!is_android && !is_ios) {
421 sources += rebase_path(
422 gypi_values.chrome_browser_ui_autofill_dialog_non_mobile_sources,
426 "//third_party/libaddressinput",
427 "//third_party/libaddressinput:strings",
431 if (enable_extensions) {
433 "//chrome/browser/extensions",
434 "//chrome/common/extensions/api",
435 "//chrome/common/extensions/api:api_registration",
437 sources += rebase_path(gypi_values.chrome_browser_ui_extensions_sources,
441 if (enable_google_now && !is_android) {
442 sources += rebase_path(
443 gypi_values.chrome_browser_ui_google_now_non_android_sources,
447 if (enable_media_router && !is_android && !is_ios) {
448 sources += rebase_path(gypi_values.chrome_browser_ui_media_router_sources,
451 deps += [ "//chrome/browser/media/router" ]
454 sources += rebase_path(gypi_values.chrome_browser_ui_webrtc_sources,
458 if (enable_service_discovery) {
460 rebase_path(gypi_values.chrome_browser_ui_service_discovery_sources,
467 nib_gypi_values = exec_script("//build/gypi_to_gn.py",
468 [ rebase_path("../../chrome_nibs.gypi") ],
470 [ "../../chrome_nibs.gypi" ])
472 action("generate_localizer") {
473 script = "//chrome/tools/build/mac/generate_localizer"
475 table_path = "$target_gen_dir/ui_localizer_table.h"
479 args = [ rebase_path(table_path, root_build_dir) ] +
480 rebase_path(nib_gypi_values.mac_translated_xibs,
486 # In GYP this is part of test_support_common.
487 source_set("test_support") {
492 "cocoa/extensions/browser_action_test_util_mac.mm",
493 "cocoa/find_bar/find_bar_host_unittest_util_cocoa.mm",
494 "cocoa/run_loop_testing.h",
495 "cocoa/run_loop_testing.mm",
496 "exclusive_access/fullscreen_controller_state_test.cc",
497 "exclusive_access/fullscreen_controller_state_test.h",
498 "exclusive_access/fullscreen_controller_state_tests.h",
499 "exclusive_access/fullscreen_controller_test.cc",
500 "exclusive_access/fullscreen_controller_test.h",
501 "find_bar/find_bar_host_unittest_util.h",
502 "login/login_prompt_test_utils.cc",
503 "login/login_prompt_test_utils.h",
504 "passwords/manage_passwords_ui_controller_mock.cc",
505 "passwords/manage_passwords_ui_controller_mock.h",
506 "test/test_confirm_bubble_model.cc",
507 "test/test_confirm_bubble_model.h",
508 "toolbar/test_toolbar_action_view_controller.cc",
509 "toolbar/test_toolbar_action_view_controller.h",
510 "website_settings/mock_permission_bubble_request.cc",
511 "website_settings/mock_permission_bubble_request.h",
515 sources += [ "views/find_bar_host_unittest_util_views.cc" ]
517 sources += [ "views/toolbar/browser_action_test_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",