cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / browser / ui / BUILD.gn
blobc876981de6ea8676356300143b15d303348b5d1c
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") ],
11                           "scope",
12                           [ "../../chrome_browser_ui.gypi" ])
14 source_set("ui") {
15   output_name = "browser_ui"
17   sources = []
18   defines = []
19   libs = []
21   configs += [
22     "//build/config:precompiled_headers",
23     "//build/config/compiler:wexit_time_destructors",
24     "//third_party/WebKit/public:debug_devtools",
25   ]
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.
32   public_deps = [
33     "//components/dom_distiller/core",
34     "//content/public/browser",
35     "//sync",
36   ]
37   deps = [
38     # NOTE: New dependencies should generally be added in the OS!="ios"
39     # dependencies block below, rather than here.
40     "//base/allocator",
41     "//chrome:extra_resources",
42     "//chrome:resources",
43     "//chrome:strings",
44     "//chrome/app/resources:platform_locale_settings",
45     "//chrome/app/theme:theme_resources",
46     "//chrome/common",
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",
54     "//components/onc",
55     "//components/password_manager/core/browser",
56     "//components/resources",
57     "//components/strings",
58     "//components/toolbar",
59     "//components/update_client",
60     "//content/public/common",
61     "//crypto",
62     "//skia",
63     "//third_party/cacheinvalidation",
64     "//third_party/icu",
65     "//third_party/zlib",
66     "//ui/accessibility",
67     "//ui/base",
68     "//ui/content_accelerators",
69     "//ui/events",
70     "//ui/events:gesture_detection",
71     "//ui/gfx",
72     "//ui/gfx/geometry",
73     "//ui/message_center",
74     "//ui/native_theme",
75     "//ui/resources",
76     "//ui/snapshot",
77     "//ui/strings",
78   ]
80   if (!is_ios) {
81     sources += rebase_path(gypi_values.chrome_browser_ui_non_ios_sources,
82                            ".",
83                            "//chrome")
84     sources += rebase_path(gypi_values.chrome_browser_ui_toolbar_model_sources,
85                            ".",
86                            "//chrome")
87     deps += [
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/power",
96       "//components/suggestions/proto",
97       "//components/url_formatter",
98       "//device/nfc",
99       "//media",
100       "//net:net_with_v8",
101       "//storage/browser",
102       "//storage/common",
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",
108       "//third_party/re2",
109       "//ui/base/ime",
110       "//ui/compositor",
111       "//ui/surface",
112       "//ui/web_dialogs",
113       "//v8",
114     ]
115   } else {
116     # iOS.
117     sources +=
118         rebase_path(gypi_values.chrome_browser_ui_ios_sources, ".", "//chrome")
119     deps += [ "//net" ]
120   }
122   if (!is_android && !is_ios) {
123     sources += rebase_path(gypi_values.chrome_browser_ui_non_mobile_sources,
124                            ".",
125                            "//chrome")
126     sources +=
127         rebase_path(gypi_values.chrome_browser_ui_omnibox_non_mobile_sources,
128                     ".",
129                     "//chrome")
130     deps += [
131       "//components/copresence",
132       "//components/feedback/proto",
133       "//components/proximity_auth/webui",
134       "//device/bluetooth",
135       "//third_party/libusb",
136     ]
137   }
139   if (enable_basic_printing || enable_print_preview) {
140     deps += [ "//printing" ]
141   }
143   if (enable_nacl) {
144     sources +=
145         rebase_path(gypi_values.chrome_browser_ui_nacl_sources, ".", "//chrome")
146     deps += [ "//native_client/src/trusted/service_runtime:sel" ]
147   }
148   if (enable_configuration_policy) {
149     sources += rebase_path(gypi_values.chrome_browser_ui_policy_sources,
150                            ".",
151                            "//chrome")
152     deps += [ "//components/policy" ]
153   }
154   if (enable_plugins) {
155     sources += rebase_path(gypi_values.chrome_browser_ui_plugin_sources,
156                            ".",
157                            "//chrome")
158     deps += [ "//ppapi/proxy:ipc" ]
159   }
160   if (safe_browsing_mode == 1) {
161     deps += [
162       "//chrome/browser/safe_browsing:chunk_proto",
163       "//chrome/common/safe_browsing:proto",
164       "//chrome/browser/safe_browsing:report_proto",
165     ]
166   }
168   if (is_chromeos && !is_official_build) {
169     sources +=
170         rebase_path(gypi_values.chrome_browser_ui_chromeos_non_official_sources,
171                     ".",
172                     "//chrome")
173   }
175   if (is_chromeos) {
176     sources += rebase_path(gypi_values.chrome_browser_ui_chromeos_sources,
177                            ".",
178                            "//chrome")
179     deps += [ "//chrome/browser/chromeos" ]
180   } else {
181     sources += rebase_path(gypi_values.chrome_browser_ui_non_chromeos_sources,
182                            ".",
183                            "//chrome")
184     defines += [ "FRAME_AVATAR_BUTTON=1" ]
185   }
186   if (use_cups) {
187     configs += [ "//printing:cups" ]
188   }
189   if (use_ash) {
190     sources +=
191         rebase_path(gypi_values.chrome_browser_ui_ash_sources, ".", "//chrome")
192     deps += [
193       "//ash",
194       "//ash:ash_with_content",
195       "//ash/strings",
196       "//components/user_manager",
197     ]
198     if (!is_chromeos) {
199       sources += rebase_path(gypi_values.chrome_browser_ui_ash_non_chromeos,
200                              ".",
201                              "//chrome")
202     }
203   } else {  # Not ash.
204     sources += rebase_path(gypi_values.chrome_browser_ui_non_ash_sources,
205                            ".",
206                            "//chrome")
207   }
208   if (toolkit_views) {
209     sources += rebase_path(gypi_values.chrome_browser_ui_views_sources,
210                            ".",
211                            "//chrome")
212     deps += [ "//components/constrained_window" ]
214     if (enable_extensions) {
215       deps += [ "//extensions/components/native_app_window" ]
216     }
218     if (!is_chromeos && (!is_mac || mac_views_browser)) {
219       sources +=
220           rebase_path(gypi_values.chrome_browser_ui_views_non_chromeos_sources,
221                       ".",
222                       "//chrome")
223     }
224     if (!is_mac) {
225       sources +=
226           rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
227                       ".",
228                       "//chrome")
229       if (enable_extensions) {
230         sources += rebase_path(
231                 gypi_values.chrome_browser_ui_views_extensions_non_mac_sources,
232                 ".",
233                 "//chrome")
234       }
235     }
236     if (use_ash) {
237       sources += rebase_path(gypi_values.chrome_browser_ui_ash_views_sources,
238                              ".",
239                              "//chrome")
240     }
241   }
242   if (use_aura && !use_ozone && is_desktop_linux) {
243     deps += [
244       "//build/linux:gio",
246       # gtk2 is the only component that can interact with gtk2 in our new
247       # world.
248       "//chrome/browser/ui/libgtk2ui",
249     ]
250   }
251   if (is_win || is_mac || is_desktop_linux) {
252     sources += rebase_path(gypi_values.chrome_browser_ui_desktop_sources,
253                            ".",
254                            "//chrome")
255   }
256   if (use_aura) {
257     sources +=
258         rebase_path(gypi_values.chrome_browser_ui_aura_sources, ".", "//chrome")
259     deps += [
260       # aura uses some of ash resources.
261       "//ash/resources",
262       "//ui/aura",
263       "//ui/keyboard",
264       "//ui/keyboard:resources",
265       "//ui/wm",
266     ]
267     if (!is_chromeos) {
268       sources += rebase_path(gypi_values.chrome_browser_ui_aura_non_chromeos,
269                              ".",
270                              "//chrome")
271     }
272   }
273   if (ui_compositor_image_transport) {
274     deps += [ "//ui/gl" ]
275   }
276   if (use_nss_certs) {
277     sources +=
278         rebase_path(gypi_values.chrome_browser_ui_nss_sources, ".", "//chrome")
279   }
280   if (!enable_themes) {
281     sources -= [ "webui/theme_source.cc" ]
282   }
283   if (enable_print_preview) {
284     sources += rebase_path(gypi_values.chrome_browser_ui_print_preview_sources,
285                            ".",
286                            "//chrome")
287   }
289   if (is_android) {
290     deps += [
291       "//chrome/browser:jni_headers",
292       "//crypto:platform",
293       "//components/web_contents_delegate_android",
294     ]
295     deps -= [
296       "//chrome/browser/ui/views",
297       "//ui/events",
298     ]
299     sources += rebase_path(gypi_values.chrome_browser_ui_android_sources,
300                            ".",
301                            "//chrome")
303     defines += [ "CHROME_BUILD_ID=" + android_chrome_build_id ]
304   }
306   if (is_mac) {
307     sources +=
308         rebase_path(gypi_values.chrome_browser_ui_mac_sources, ".", "//chrome")
309     deps += [
310       ":generate_localizer",
311       "//third_party/apple_sample_code",
312       "//third_party/google_toolbox_for_mac",
313       "//third_party/molokocacao",
314       "//third_party/mozilla",
315     ]
316     if (mac_views_browser) {
317       sources += rebase_path(
318               gypi_values.chrome_browser_ui_views_mac_experimental_sources,
319               ".",
320               "//chrome")
321       sources +=
322           rebase_path(gypi_values.chrome_browser_ui_views_non_mac_sources,
323                       ".",
324                       "//chrome")
325       sources += rebase_path(
326               gypi_values.chrome_browser_ui_views_extensions_non_mac_sources,
327               ".",
328               "//chrome")
329       deps += [ "//extensions/components/native_app_window" ]
330     } else {
331       sources += rebase_path(gypi_values.chrome_browser_ui_cocoa_sources,
332                              ".",
333                              "//chrome")
334     }
335     include_dirs = [ "$target_gen_dir" ]
336     libs += [ "Quartz.framework" ]
337     configs +=
338         [ "//third_party/google_toolbox_for_mac:google_toolbox_for_mac_config" ]
339   } else {  # non-Mac.
340     sources += rebase_path(gypi_values.chrome_browser_ui_non_mac_sources,
341                            ".",
342                            "//chrome")
343   }
345   if (is_win) {
346     sources +=
347         rebase_path(gypi_values.chrome_browser_ui_win_sources, ".", "//chrome")
348     sources -= [
349       "views/apps/keyboard_hook_handler.cc",
350       "views/frame/taskbar_decorator.cc",
351     ]
352     public_deps += [
353       "//ui/views",
354       "//ui/views/controls/webview",
355     ]
356     deps += [
357       "//chrome/browser/metro_utils",
358       "//chrome/installer/util:strings",
359       "//google_update",
360       "//third_party/wtl",
361       "//third_party/iaccessible2",
362       "//third_party/isimpledom",
363       "//ui/app_list",
364     ]
365     if (!is_chrome_branded) {
366       deps -= [ "//google_update" ]
367       sources -= [ "webui/help/version_updater_win.cc" ]
368       sources += [
369         "webui/help/version_updater_basic.cc",
370         "webui/help/version_updater_basic.h",
371       ]
372     }
373   } else {  # 'OS!="win"
374     if (toolkit_views) {
375       public_deps += [
376         "//ui/views",
377         "//ui/views/controls/webview",
378       ]
379     }
380   }
381   if (is_desktop_linux) {
382     sources += rebase_path(gypi_values.chrome_browser_ui_desktop_linux_sources,
383                            ".",
384                            "//chrome")
385   }
386   if (is_linux) {  # Both desktop Linux and ChromeOS.
387     sources += rebase_path(gypi_values.chrome_browser_ui_linux_sources,
388                            ".",
389                            "//chrome")
390     if (use_aura) {
391       configs += [ "//build/config/linux:fontconfig" ]
392       deps += [ "//dbus" ]
393     }
394     if (use_x11) {
395       sources += rebase_path(gypi_values.chrome_browser_ui_x11_sources,
396                              ".",
397                              "//chrome")
398       configs += [ "//build/config/linux:x11" ]
399       deps += [ "//ui/events/devices" ]
400       if (is_chromeos) {
401         sources -= [ "views/tabs/window_finder_x11.cc" ]
402       }
403     }
404   }
406   if (use_udev) {
407     deps += [ "//device/udev_linux" ]
408   }
410   if (enable_app_list) {
411     sources += rebase_path(gypi_values.chrome_browser_ui_app_list_sources,
412                            ".",
413                            "//chrome")
414     deps += [ "//ui/app_list" ]
415   } else {
416     sources += rebase_path(gypi_values.chrome_browser_ui_non_app_list_sources,
417                            ".",
418                            "//chrome")
419   }
420   if (enable_autofill_dialog) {
421     sources +=
422         rebase_path(gypi_values.chrome_browser_ui_autofill_dialog_sources,
423                     ".",
424                     "//chrome")
425     if (!is_android && !is_ios) {
426       sources += rebase_path(
427               gypi_values.chrome_browser_ui_autofill_dialog_non_mobile_sources,
428               ".",
429               "//chrome")
430       deps += [
431         "//third_party/libaddressinput",
432         "//third_party/libaddressinput:strings",
433       ]
434     }
435   }
436   if (enable_extensions) {
437     deps += [
438       "//chrome/browser/extensions",
439       "//chrome/common/extensions/api",
440       "//chrome/common/extensions/api:api_registration",
441     ]
442     sources += rebase_path(gypi_values.chrome_browser_ui_extensions_sources,
443                            ".",
444                            "//chrome")
445   }
446   if (enable_google_now && !is_android) {
447     sources += rebase_path(
448             gypi_values.chrome_browser_ui_google_now_non_android_sources,
449             ".",
450             "//chrome")
451   }
452   if (enable_media_router && !is_android && !is_ios) {
453     sources += rebase_path(gypi_values.chrome_browser_ui_media_router_sources,
454                            ".",
455                            "//chrome")
456     deps += [ "//chrome/browser/media/router" ]
457   }
458   if (enable_webrtc) {
459     sources += rebase_path(gypi_values.chrome_browser_ui_webrtc_sources,
460                            ".",
461                            "//chrome")
462   }
463   if (enable_service_discovery) {
464     sources +=
465         rebase_path(gypi_values.chrome_browser_ui_service_discovery_sources,
466                     ".",
467                     "//chrome")
468   }
471 if (is_mac) {
472   nib_gypi_values = exec_script("//build/gypi_to_gn.py",
473                                 [ rebase_path("../../chrome_nibs.gypi") ],
474                                 "scope",
475                                 [ "../../chrome_nibs.gypi" ])
477   action("generate_localizer") {
478     script = "//chrome/tools/build/mac/generate_localizer"
479     sources = []
480     table_path = "$target_gen_dir/ui_localizer_table.h"
481     outputs = [
482       table_path,
483     ]
484     args = [ rebase_path(table_path, root_build_dir) ] +
485            rebase_path(nib_gypi_values.mac_translated_xibs,
486                        root_build_dir,
487                        "//chrome")
488   }
491 # In GYP this is part of test_support_common.
492 source_set("test_support") {
493   testonly = true
495   sources = [
496     "browser.h",
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",
517   ]
519   if (toolkit_views) {
520     sources += [ "views/find_bar_host_unittest_util_views.cc" ]
521     if (!is_mac) {
522       sources += [ "views/toolbar/browser_action_test_util_views.cc" ]
523     }
524   }
526   public_deps = [
527     ":ui",
528   ]
529   deps = [
530     "//chrome/app/theme:theme_resources",
531     "//chrome/browser",
532     "//content/public/browser",
533     "//content/public/common",
534     "//content/test:test_support",
535     "//net:test_support",
536     "//skia",
537     "//testing/gtest",
538     "//ui/base",
539   ]