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:cert_logger_proto",
47 "//chrome/common/net",
48 "//components/app_modal",
49 "//components/auto_login_parser",
50 "//components/dom_distiller/webui",
51 "//components/invalidation",
53 "//components/password_manager/core/browser",
54 "//components/resources",
55 "//components/strings",
56 "//components/update_client",
57 "//content/public/common",
60 "//third_party/cacheinvalidation",
62 "//third_party/libxml",
66 "//ui/content_accelerators",
68 "//ui/events:gesture_detection",
71 "//ui/message_center",
79 sources += rebase_path(gypi_values.chrome_browser_ui_non_ios_sources,
82 sources += rebase_path(gypi_values.chrome_browser_ui_toolbar_model_sources,
86 "//chrome/browser/devtools",
87 "//chrome/browser/ui/views",
88 "//chrome/browser/ui/webui/omnibox:mojo_bindings",
89 "//chrome/installer/util",
90 "//components/autofill/content/browser:risk_proto",
92 "//components/suggestions/proto",
98 "//third_party/WebKit/public:resources",
99 "//third_party/adobe/flash:flapper_version_h",
100 "//third_party/expat",
101 "//third_party/leveldatabase",
102 "//third_party/mojo/src/mojo/edk/system",
103 "//third_party/npapi",
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" ]
203 rebase_path(gypi_values.chrome_browser_ui_views_non_chromeos_sources,
209 rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
212 deps += [ "//extensions/components/native_app_window" ]
214 # TODO(GYP): crbug.com/481629. These files should probably not be
215 # a part of ui_views_non_mac_sources at all.
217 "views/frame/opaque_browser_frame_view.cc",
218 "views/frame/opaque_browser_frame_view.h",
219 "views/frame/opaque_browser_frame_view_linux.cc",
220 "views/frame/opaque_browser_frame_view_linux.h",
225 sources += rebase_path(gypi_values.chrome_browser_ui_ash_views_sources,
230 if (use_aura && !use_ozone && is_desktop_linux) {
232 "//build/config/linux:gio",
234 # gtk2 is the only component that can interact with gtk2 in our new
236 "//chrome/browser/ui/libgtk2ui",
239 if (is_win || is_mac || is_desktop_linux) {
240 sources += rebase_path(gypi_values.chrome_browser_ui_desktop_sources,
246 rebase_path(gypi_values.chrome_browser_ui_aura_sources, ".", "//chrome")
248 # aura uses some of ash resources.
252 "//ui/keyboard:resources",
256 sources += rebase_path(gypi_values.chrome_browser_ui_aura_non_chromeos,
261 if (ui_compositor_image_transport) {
262 deps += [ "//ui/gl" ]
266 rebase_path(gypi_values.chrome_browser_ui_nss_sources, ".", "//chrome")
268 if (!enable_themes) {
269 sources -= [ "webui/theme_source.cc" ]
271 if (enable_print_preview) {
272 sources += rebase_path(gypi_values.chrome_browser_ui_print_preview_sources,
279 "//chrome/browser:jni_headers",
281 "//components/web_contents_delegate_android",
284 "//chrome/browser/ui/views",
287 sources += rebase_path(gypi_values.chrome_browser_ui_android_sources,
291 defines += [ "CHROME_BUILD_ID=" + android_chrome_build_id ]
296 rebase_path(gypi_values.chrome_browser_ui_mac_sources, ".", "//chrome")
298 ":generate_localizer",
299 "//third_party/apple_sample_code",
300 "//third_party/google_toolbox_for_mac",
301 "//third_party/molokocacao",
302 "//third_party/mozilla",
304 if (mac_views_browser) {
305 sources += rebase_path(
306 gypi_values.chrome_browser_ui_views_mac_experimental_sources,
310 rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
313 deps += [ "//extensions/components/native_app_window" ]
315 sources += rebase_path(gypi_values.chrome_browser_ui_cocoa_sources,
319 include_dirs = [ "$target_gen_dir" ]
320 libs += [ "Quartz.framework" ]
322 [ "//third_party/google_toolbox_for_mac:google_toolbox_for_mac_config" ]
324 sources += rebase_path(gypi_values.chrome_browser_ui_non_mac_sources,
331 rebase_path(gypi_values.chrome_browser_ui_win_sources, ".", "//chrome")
333 "views/apps/keyboard_hook_handler.cc",
334 "views/frame/taskbar_decorator.cc",
338 "//ui/views/controls/webview",
341 "//chrome/browser/metro_utils",
342 "//chrome/installer/util:strings",
345 "//third_party/iaccessible2",
346 "//third_party/isimpledom",
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,
362 if (is_linux) { # Both desktop Linux and ChromeOS.
363 sources += rebase_path(gypi_values.chrome_browser_ui_linux_sources,
366 deps += [ "//device/udev_linux" ]
368 configs += [ "//build/config/linux:fontconfig" ]
372 sources += rebase_path(gypi_values.chrome_browser_ui_x11_sources,
375 configs += [ "//build/config/linux:x11" ]
376 deps += [ "//ui/events/devices" ]
378 sources -= [ "views/tabs/window_finder_x11.cc" ]
383 if (enable_app_list) {
384 sources += rebase_path(gypi_values.chrome_browser_ui_app_list_sources,
387 deps += [ "//ui/app_list" ]
389 sources += rebase_path(gypi_values.chrome_browser_ui_non_app_list_sources,
393 if (enable_autofill_dialog) {
395 rebase_path(gypi_values.chrome_browser_ui_autofill_dialog_sources,
398 if (!is_android && !is_ios) {
399 sources += rebase_path(
400 gypi_values.chrome_browser_ui_autofill_dialog_non_mobile_sources,
404 "//third_party/libaddressinput",
405 "//third_party/libaddressinput:strings",
409 if (enable_extensions) {
411 "//chrome/browser/extensions",
412 "//chrome/common/extensions/api",
413 "//chrome/common/extensions/api:api_registration",
415 sources += rebase_path(gypi_values.chrome_browser_ui_extensions_sources,
419 if (enable_google_now && !is_android) {
420 sources += rebase_path(
421 gypi_values.chrome_browser_ui_google_now_non_android_sources,
425 if (enable_media_router) {
426 sources += rebase_path(gypi_values.chrome_browser_ui_media_router_sources,
429 deps += [ "//chrome/browser/media/router:router_core" ]
430 defines += [ "ENABLE_MEDIA_ROUTER=1" ]
433 sources += rebase_path(gypi_values.chrome_browser_ui_webrtc_sources,
437 if (enable_service_discovery) {
439 rebase_path(gypi_values.chrome_browser_ui_service_discovery_sources,
446 nib_gypi_values = exec_script("//build/gypi_to_gn.py",
447 [ rebase_path("../../chrome_nibs.gypi") ],
449 [ "../../chrome_nibs.gypi" ])
451 action("generate_localizer") {
452 script = "//chrome/tools/build/mac/generate_localizer"
454 table_path = "$target_gen_dir/ui_localizer_table.h"
458 args = [ rebase_path(table_path, root_build_dir) ] +
459 rebase_path(nib_gypi_values.mac_translated_xibs,
465 # In GYP this is part of test_support_common.
466 source_set("test_support") {
471 "cocoa/extensions/browser_action_test_util_mac.mm",
472 "cocoa/find_bar/find_bar_host_unittest_util_cocoa.mm",
473 "cocoa/run_loop_testing.h",
474 "cocoa/run_loop_testing.mm",
475 "exclusive_access/fullscreen_controller_state_test.cc",
476 "exclusive_access/fullscreen_controller_state_test.h",
477 "exclusive_access/fullscreen_controller_state_tests.h",
478 "exclusive_access/fullscreen_controller_test.cc",
479 "exclusive_access/fullscreen_controller_test.h",
480 "find_bar/find_bar_host_unittest_util.h",
481 "login/login_prompt_test_utils.cc",
482 "login/login_prompt_test_utils.h",
483 "passwords/manage_passwords_ui_controller_mock.cc",
484 "passwords/manage_passwords_ui_controller_mock.h",
485 "test/test_confirm_bubble_model.cc",
486 "test/test_confirm_bubble_model.h",
487 "toolbar/test_toolbar_action_view_controller.cc",
488 "toolbar/test_toolbar_action_view_controller.h",
489 "website_settings/mock_permission_bubble_request.cc",
490 "website_settings/mock_permission_bubble_request.h",
494 sources += [ "views/find_bar_host_unittest_util_views.cc" ]
496 sources += [ "views/toolbar/browser_action_test_util_views.cc" ]
504 "//chrome/app/theme:theme_resources",
506 "//content/public/browser",
507 "//content/public/common",
508 "//content/test:test_support",
509 "//net:test_support",