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",
54 "//components/password_manager/core/browser",
55 "//components/resources",
56 "//components/strings",
57 "//components/update_client",
58 "//content/public/common",
61 "//third_party/cacheinvalidation",
63 "//third_party/libxml",
67 "//ui/content_accelerators",
69 "//ui/events:gesture_detection",
72 "//ui/message_center",
80 sources += rebase_path(gypi_values.chrome_browser_ui_non_ios_sources,
83 sources += rebase_path(gypi_values.chrome_browser_ui_toolbar_model_sources,
87 "//chrome/browser/devtools",
88 "//chrome/browser/ui/views",
89 "//chrome/browser/ui/webui/omnibox:mojo_bindings",
90 "//chrome/installer/util",
91 "//components/autofill/content/browser:risk_proto",
93 "//components/suggestions/proto",
99 "//third_party/WebKit/public:resources",
100 "//third_party/adobe/flash:flapper_version_h",
101 "//third_party/expat",
102 "//third_party/leveldatabase",
103 "//third_party/mojo/src/mojo/edk/system",
104 "//third_party/npapi",
105 "//third_party/libjingle",
116 rebase_path(gypi_values.chrome_browser_ui_ios_sources, ".", "//chrome")
120 if (!is_android && !is_ios) {
121 sources += rebase_path(gypi_values.chrome_browser_ui_non_mobile_sources,
125 rebase_path(gypi_values.chrome_browser_ui_omnibox_non_mobile_sources,
129 "//components/copresence",
130 "//components/feedback/proto",
131 "//components/proximity_auth/webui",
132 "//device/bluetooth",
133 "//third_party/libusb",
137 if (enable_basic_printing || enable_print_preview) {
138 deps += [ "//printing" ]
143 rebase_path(gypi_values.chrome_browser_ui_nacl_sources, ".", "//chrome")
144 deps += [ "//native_client/src/trusted/service_runtime:sel" ]
146 if (enable_configuration_policy) {
147 sources += rebase_path(gypi_values.chrome_browser_ui_policy_sources,
150 deps += [ "//components/policy" ]
152 if (enable_plugins) {
153 sources += rebase_path(gypi_values.chrome_browser_ui_plugin_sources,
156 deps += [ "//ppapi/proxy:ipc" ]
158 if (safe_browsing_mode == 1) {
160 "//chrome/browser/safe_browsing:chunk_proto",
161 "//chrome/common/safe_browsing:proto",
162 "//chrome/browser/safe_browsing:report_proto",
166 sources += rebase_path(gypi_values.chrome_browser_ui_chromeos_sources,
169 deps += [ "//chrome/browser/chromeos" ]
171 sources += rebase_path(gypi_values.chrome_browser_ui_non_chromeos_sources,
176 configs += [ "//printing:cups" ]
180 rebase_path(gypi_values.chrome_browser_ui_ash_sources, ".", "//chrome")
183 "//ash:ash_with_content",
185 "//components/user_manager",
188 sources += rebase_path(gypi_values.chrome_browser_ui_ash_non_chromeos,
193 sources += rebase_path(gypi_values.chrome_browser_ui_non_ash_sources,
198 sources += rebase_path(gypi_values.chrome_browser_ui_views_sources,
201 deps += [ "//components/constrained_window" ]
204 rebase_path(gypi_values.chrome_browser_ui_views_non_chromeos_sources,
210 rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
213 deps += [ "//extensions/components/native_app_window" ]
215 # TODO(GYP): crbug.com/481629. These files should probably not be
216 # a part of ui_views_non_mac_sources at all.
218 "views/frame/opaque_browser_frame_view.cc",
219 "views/frame/opaque_browser_frame_view.h",
220 "views/frame/opaque_browser_frame_view_linux.cc",
221 "views/frame/opaque_browser_frame_view_linux.h",
226 sources += rebase_path(gypi_values.chrome_browser_ui_ash_views_sources,
231 if (use_aura && !use_ozone && is_desktop_linux) {
233 "//build/config/linux:gio",
235 # gtk2 is the only component that can interact with gtk2 in our new
237 "//chrome/browser/ui/libgtk2ui",
240 if (is_win || is_mac || is_desktop_linux) {
241 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_sources,
247 rebase_path(gypi_values.chrome_browser_ui_aura_sources, ".", "//chrome")
249 # aura uses some of ash resources.
253 "//ui/keyboard:resources",
257 sources += rebase_path(gypi_values.chrome_browser_ui_aura_non_chromeos,
262 if (ui_compositor_image_transport) {
263 deps += [ "//ui/gl" ]
267 rebase_path(gypi_values.chrome_browser_ui_nss_sources, ".", "//chrome")
269 if (!enable_themes) {
270 sources -= [ "webui/theme_source.cc" ]
272 if (enable_print_preview) {
273 sources += rebase_path(gypi_values.chrome_browser_ui_print_preview_sources,
280 "//chrome/browser:jni_headers",
282 "//components/web_contents_delegate_android",
285 "//chrome/browser/ui/views",
288 sources += rebase_path(gypi_values.chrome_browser_ui_android_sources,
292 defines += [ "CHROME_BUILD_ID=" + android_chrome_build_id ]
297 rebase_path(gypi_values.chrome_browser_ui_mac_sources, ".", "//chrome")
299 ":generate_localizer",
300 "//third_party/apple_sample_code",
301 "//third_party/google_toolbox_for_mac",
302 "//third_party/molokocacao",
303 "//third_party/mozilla",
305 if (mac_views_browser) {
306 sources += rebase_path(
307 gypi_values.chrome_browser_ui_views_mac_experimental_sources,
311 rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
314 deps += [ "//extensions/components/native_app_window" ]
316 sources += rebase_path(gypi_values.chrome_browser_ui_cocoa_sources,
320 include_dirs = [ "$target_gen_dir" ]
321 libs += [ "Quartz.framework" ]
323 [ "//third_party/google_toolbox_for_mac:google_toolbox_for_mac_config" ]
325 sources += rebase_path(gypi_values.chrome_browser_ui_non_mac_sources,
332 rebase_path(gypi_values.chrome_browser_ui_win_sources, ".", "//chrome")
334 "views/apps/keyboard_hook_handler.cc",
335 "views/frame/taskbar_decorator.cc",
339 "//ui/views/controls/webview",
342 "//chrome/browser/metro_utils",
343 "//chrome/installer/util:strings",
346 "//third_party/iaccessible2",
347 "//third_party/isimpledom",
350 if (!is_chrome_branded) {
351 deps -= [ "//google_update" ]
352 sources -= [ "webui/help/version_updater_win.cc" ]
354 "webui/help/version_updater_basic.cc",
355 "webui/help/version_updater_basic.h",
358 } else { # 'OS!="win"
362 "//ui/views/controls/webview",
366 if (is_desktop_linux) {
367 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_linux_sources,
371 if (is_linux) { # Both desktop Linux and ChromeOS.
372 sources += rebase_path(gypi_values.chrome_browser_ui_linux_sources,
375 deps += [ "//device/udev_linux" ]
377 configs += [ "//build/config/linux:fontconfig" ]
381 sources += rebase_path(gypi_values.chrome_browser_ui_x11_sources,
384 configs += [ "//build/config/linux:x11" ]
385 deps += [ "//ui/events/devices" ]
387 sources -= [ "views/tabs/window_finder_x11.cc" ]
392 if (enable_app_list) {
393 sources += rebase_path(gypi_values.chrome_browser_ui_app_list_sources,
396 deps += [ "//ui/app_list" ]
398 sources += rebase_path(gypi_values.chrome_browser_ui_non_app_list_sources,
402 if (enable_autofill_dialog) {
404 rebase_path(gypi_values.chrome_browser_ui_autofill_dialog_sources,
407 if (!is_android && !is_ios) {
408 sources += rebase_path(
409 gypi_values.chrome_browser_ui_autofill_dialog_non_mobile_sources,
413 "//third_party/libaddressinput",
414 "//third_party/libaddressinput:strings",
418 if (enable_extensions) {
420 "//chrome/browser/extensions",
421 "//chrome/common/extensions/api",
422 "//chrome/common/extensions/api:api_registration",
424 sources += rebase_path(gypi_values.chrome_browser_ui_extensions_sources,
428 if (enable_google_now && !is_android) {
429 sources += rebase_path(
430 gypi_values.chrome_browser_ui_google_now_non_android_sources,
434 if (enable_media_router) {
435 sources += rebase_path(gypi_values.chrome_browser_ui_media_router_sources,
438 deps += [ "//chrome/browser/media/router" ]
441 sources += rebase_path(gypi_values.chrome_browser_ui_webrtc_sources,
445 if (enable_service_discovery) {
447 rebase_path(gypi_values.chrome_browser_ui_service_discovery_sources,
454 nib_gypi_values = exec_script("//build/gypi_to_gn.py",
455 [ rebase_path("../../chrome_nibs.gypi") ],
457 [ "../../chrome_nibs.gypi" ])
459 action("generate_localizer") {
460 script = "//chrome/tools/build/mac/generate_localizer"
462 table_path = "$target_gen_dir/ui_localizer_table.h"
466 args = [ rebase_path(table_path, root_build_dir) ] +
467 rebase_path(nib_gypi_values.mac_translated_xibs,
473 # In GYP this is part of test_support_common.
474 source_set("test_support") {
479 "cocoa/extensions/browser_action_test_util_mac.mm",
480 "cocoa/find_bar/find_bar_host_unittest_util_cocoa.mm",
481 "cocoa/run_loop_testing.h",
482 "cocoa/run_loop_testing.mm",
483 "exclusive_access/fullscreen_controller_state_test.cc",
484 "exclusive_access/fullscreen_controller_state_test.h",
485 "exclusive_access/fullscreen_controller_state_tests.h",
486 "exclusive_access/fullscreen_controller_test.cc",
487 "exclusive_access/fullscreen_controller_test.h",
488 "find_bar/find_bar_host_unittest_util.h",
489 "login/login_prompt_test_utils.cc",
490 "login/login_prompt_test_utils.h",
491 "passwords/manage_passwords_ui_controller_mock.cc",
492 "passwords/manage_passwords_ui_controller_mock.h",
493 "test/test_confirm_bubble_model.cc",
494 "test/test_confirm_bubble_model.h",
495 "toolbar/test_toolbar_action_view_controller.cc",
496 "toolbar/test_toolbar_action_view_controller.h",
497 "website_settings/mock_permission_bubble_request.cc",
498 "website_settings/mock_permission_bubble_request.h",
502 sources += [ "views/find_bar_host_unittest_util_views.cc" ]
504 sources += [ "views/toolbar/browser_action_test_util_views.cc" ]
512 "//chrome/app/theme:theme_resources",
514 "//content/public/browser",
515 "//content/public/common",
516 "//content/test:test_support",
517 "//net:test_support",