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