Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / BUILD.gn
blob348cebcbf181ba0806b2c1241e8eb020c0eba96e
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 # //build/config/android/rules.gni imports //tools/grit/grit_rule.gni, which
10 # produces a conflict for the "grit" template so we have to only include one.
11 if (is_android) {
12   import("//build/config/android/rules.gni")
13 } else {
14   import("//tools/grit/grit_rule.gni")
16 if (is_desktop_linux) {
17   import("//build/config/linux/pkg_config.gni")
20 about_credits_file = "$target_gen_dir/about_credits.html"
21 additional_modules_list_file =
22     "$root_gen_dir/chrome/browser/internal/additional_modules_list.txt"
24 gypi_values = exec_script("//build/gypi_to_gn.py",
25                           [ rebase_path("../chrome_browser.gypi") ],
26                           "scope",
27                           [ "../chrome_browser.gypi" ])
29 if (is_desktop_linux) {
30   # Gnome-keyring is normally dynamically loaded. The gnome_keyring config
31   # will set this up.
32   pkg_config("gnome_keyring") {
33     packages = [ "gnome-keyring-1" ]
34     defines = [
35       "USE_GNOME_KEYRING",
36       "DLOPEN_GNOME_KEYRING",
37     ]
38     ignore_libs = true
39   }
41   # If you want to link gnome-keyring directly (use only for unit tests)
42   # ADDITIONALLY add this config on top of ":gnome_keyring". pkg-config is a
43   # bit slow, so prefer not to run it again. In practice, gnome-keyring's libs
44   # are just itself and common gnome ones we link already, so we can get away
45   # with additionally just coding the library name here.
46   config("gnome_keyring_direct") {
47     libs = [ "gnome-keyring" ]
48   }
51 static_library("browser") {
52   configs += [
53     "//build/config/compiler:wexit_time_destructors",
54     "//third_party/WebKit/public:debug_devtools",
55   ]
56   defines = []
57   sources = []
58   libs = []
59   ldflags = []
61   # iOS/non-iOS shared deps. New dependencies should generally be added in the
62   # non-iOS deps below.
63   public_deps = [
64     "//components/autofill/core/browser",
65     "//content/public/browser",
66     "//sql",
67     "//sync",
68   ]
69   deps = [
70     "//base/allocator",
71     "//chrome:extra_resources",
72     "//chrome:resources",
73     "//chrome:strings",
74     "//chrome/app:generated_resources_map",
75     "//chrome/app/resources:platform_locale_settings",
76     "//chrome/app/theme:theme_resources",
77     "//chrome/browser/autocomplete:in_memory_url_index_cache_proto",
78     "//chrome/browser/net:cert_logger_proto",
79     "//chrome/browser/net:probe_message_proto",
80     "//chrome/browser/ui",
81     "//chrome/common",
82     "//chrome/common/net",
83     "//components/autofill/core/browser",
84     "//components/bookmarks/browser",
85     "//components/bookmarks/managed",
86     "//components/captive_portal",
87     "//components/cloud_devices/common",
88     "//components/component_updater",
89     "//components/content_settings/core/browser",
90     "//components/content_settings/core/common",
91     "//components/crx_file",
92     "//components/data_reduction_proxy/core/browser",
93     "//components/device_event_log",
94     "//components/domain_reliability",
95     "//components/enhanced_bookmarks",
96     "//components/favicon/core",
97     "//components/favicon_base",
98     "//components/gcm_driver",
99     "//components/google/core/browser",
100     "//components/handoff",
101     "//components/history/core/browser",
102     "//components/history/core/common",
103     "//components/infobars/core",
104     "//components/invalidation",
105     "//components/metrics:gpu",
106     "//components/metrics:net",
107     "//components/metrics:profiler",
108     "//components/metrics/proto:proto",
109     "//components/navigation_metrics",
110     "//components/network_time",
111     "//components/omnibox",
112     "//components/os_crypt",
113     "//components/packed_ct_ev_whitelist",
114     "//components/password_manager/core/browser",
115     "//components/password_manager/core/common",
116     "//components/policy:policy_component",
117     "//components/precache/core",
118     "//components/query_parser",
119     "//components/rappor",
120     "//components/renderer_context_menu",
121     "//components/search",
122     "//components/search_engines",
123     "//components/search_provider_logos",
124     "//components/signin/core/browser",
125     "//components/startup_metric_utils",
126     "//components/strings",
127     "//components/suggestions",
128     "//components/sync_driver",
129     "//components/translate/core/browser",
130     "//components/translate/core/common",
131     "//components/ui/zoom:ui_zoom",
132     "//components/update_client",
133     "//components/url_fixer",
134     "//components/user_prefs",
135     "//components/variations",
136     "//components/variations/net",
137     "//components/webdata/common",
138     "//components/webdata_services",
139     "//components/web_resource",
140     "//content/public/browser",
141     "//content/public/common",
142     "//courgette:courgette_lib",
143     "//crypto",
144     "//google_apis",
145     "//gpu/config",
146     "//jingle:notifier",
147     "//skia",
148     "//sql",
149     "//sync",
150     "//third_party/cacheinvalidation",
151     "//third_party/icu",
152     "//third_party/libxml",
153     "//third_party/libjingle",
154     "//third_party/widevine/cdm:version_h",
155     "//third_party/zlib",
156     "//third_party/zlib:minizip",
157     "//third_party/zlib:zip",
158     "//ui/base",
159     "//ui/events:events_base",
160     "//ui/gfx",
161     "//ui/gfx/geometry",
162     "//ui/message_center",
163     "//ui/shell_dialogs",
164     "//ui/strings",
165     "//ui/resources",
166   ]
168   sources +=
169       rebase_path(gypi_values.chrome_browser_undo_sources, ".", "//chrome")
171   if (!is_ios) {
172     sources +=
173         rebase_path(gypi_values.chrome_browser_non_ios_sources, ".", "//chrome")
174     sources += rebase_path(gypi_values.chrome_browser_autocomplete_sources,
175                            ".",
176                            "//chrome")
177     sources += rebase_path(gypi_values.chrome_browser_bookmark_sources,
178                            ".",
179                            "//chrome")
180     sources += rebase_path(gypi_values.chrome_browser_browser_process_sources,
181                            ".",
182                            "//chrome")
183     sources += rebase_path(gypi_values.chrome_browser_content_settings_sources,
184                            ".",
185                            "//chrome")
186     sources +=
187         rebase_path(gypi_values.chrome_browser_favicon_sources, ".", "//chrome")
188     sources +=
189         rebase_path(gypi_values.chrome_browser_google_sources, ".", "//chrome")
190     sources +=
191         rebase_path(gypi_values.chrome_browser_history_sources, ".", "//chrome")
192     sources +=
193         rebase_path(gypi_values.chrome_browser_metrics_sources, ".", "//chrome")
194     sources +=
195         rebase_path(gypi_values.chrome_browser_net_sources, ".", "//chrome")
196     sources += rebase_path(gypi_values.chrome_browser_password_manager_sources,
197                            ".",
198                            "//chrome")
199     sources += rebase_path(gypi_values.chrome_browser_permissions_sources,
200                            ".",
201                            "//chrome")
202     sources += rebase_path(gypi_values.chrome_browser_predictor_sources,
203                            ".",
204                            "//chrome")
205     sources +=
206         rebase_path(gypi_values.chrome_browser_pref_sources, ".", "//chrome")
207     sources += rebase_path(gypi_values.chrome_browser_profiles_sources,
208                            ".",
209                            "//chrome")
210     sources += rebase_path(gypi_values.chrome_browser_search_engines_sources,
211                            ".",
212                            "//chrome")
213     sources += rebase_path(gypi_values.chrome_browser_services_sources,
214                            ".",
215                            "//chrome")
216     sources +=
217         rebase_path(gypi_values.chrome_browser_session_sources, ".", "//chrome")
218     sources +=
219         rebase_path(gypi_values.chrome_browser_signin_sources, ".", "//chrome")
220     sources +=
221         rebase_path(gypi_values.chrome_browser_ssl_sources, ".", "//chrome")
222     sources +=
223         rebase_path(gypi_values.chrome_browser_sync_sources, ".", "//chrome")
224     sources += rebase_path(gypi_values.chrome_browser_web_resource_sources,
225                            ".",
226                            "//chrome")
228     deps += [
229       "//apps",
230       "//cc",
231       "//chrome/app:generated_resources_map",
232       "//chrome/app/theme:theme_resources",
233       "//chrome/browser/devtools",
234       "//chrome/browser/resources:component_extension_resources",
235       "//chrome/installer/util",
236       "//components/app_modal",
237       "//components/autofill/content/browser",
238       "//components/browsing_data",
239       "//components/data_reduction_proxy/content/browser",
240       "//components/dom_distiller/content",
241       "//components/favicon/content",
242       "//components/history/content/browser",
243       "//components/keyed_service/content",
244       "//components/navigation_interception",
245       "//components/password_manager/content/browser",
246       "//components/precache/content",
247       "//components/sessions:sessions_content",
248       "//components/storage_monitor",
249       "//components/translate/content/browser",
250       "//components/url_matcher",
251       "//components/visitedlink/browser",
252       "//components/visitedlink/common",
253       "//components/web_cache/browser",
254       "//components/web_modal",
255       "//content/app/resources",
256       "//media",
257       "//mojo/common",
258       "//mojo/environment:chromium",
259       "//net:extras",
260       "//net:net_with_v8",
261       "//storage/browser",
262       "//storage/common",
263       "//third_party/WebKit/public:resources",
264       "//third_party/expat",
265       "//third_party/leveldatabase",
266       "//third_party/libaddressinput",
267       "//third_party/libyuv",
268       "//third_party/mojo/src/mojo/edk/system",
269       "//third_party/mojo/src/mojo/public/cpp/bindings",
270       "//third_party/mojo/src/mojo/public/js",
271       "//third_party/npapi",
272       "//third_party/re2",
273       "//third_party/smhasher:cityhash",
274       "//third_party/webrtc/modules/desktop_capture",
275       "//ui/base/ime",
276       "//ui/gl",
277       "//ui/resources",
278       "//ui/surface",
279       "//ui/web_dialogs",
280       "//v8",
281     ]
282   } else {  # iOS
283     sources +=
284         rebase_path(gypi_values.chrome_browser_ios_sources, ".", "//chrome")
285     sources +=
286         rebase_path(gypi_values.chrome_browser_google_sources, ".", "//chrome")
287     deps += [ "//net" ]
288     libs += [
289       "CoreTelephony.framework",
290       "CoreText.framework",
291       "MobileCoreServices.framework",
292       "QuartzCore.framework",
293     ]
294     ldflags += [
295       "-weak_framework",
296       "CoreImage",
297     ]
298   }
300   if (is_win || is_mac) {
301     sources +=
302         rebase_path(gypi_values.chrome_browser_win_mac_sources, ".", "//chrome")
303   }
304   if (!is_android && !is_ios && !is_chromeos && enable_configuration_policy) {
305     sources += [
306       "net/disk_cache_dir_policy_handler.cc",
307       "net/disk_cache_dir_policy_handler.h",
308     ]
309   }
310   if (!is_android && !is_ios && enable_configuration_policy) {
311     sources += [
312       "download/download_dir_policy_handler.cc",
313       "download/download_dir_policy_handler.h",
314     ]
315   }
316   if (is_mac) {
317     sources +=
318         rebase_path(gypi_values.chrome_browser_mac_sources, ".", "//chrome")
319     deps += [
320       #"app_shim"  TODO(GYP)
321       #"browser_app_shim"  TODO(GYP)
322     ]
323   }
324   if (enable_extensions) {
325     public_deps += [ "//chrome/browser/extensions" ]
326     deps += [
327       "//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto",
328       "//chrome/common/extensions/api",
329       "//chrome/common/extensions/api:api_registration",
330       "//components/proximity_auth/cryptauth",
331       "//extensions/components/javascript_dialog_extensions_client",
332       "//media/cast:net",
333     ]
334     sources += rebase_path(gypi_values.chrome_browser_extensions_sources,
335                            ".",
336                            "//chrome")
337   }
338   if (enable_background) {
339     sources += rebase_path(gypi_values.chrome_browser_background_sources,
340                            ".",
341                            "//chrome")
342     if (!use_aura || is_win || is_chromeos) {
343       sources -= [ "background/background_mode_manager_aura.cc" ]
344     }
345   }
346   if (enable_task_manager) {
347     sources += rebase_path(gypi_values.chrome_browser_task_manager_sources,
348                            ".",
349                            "//chrome")
350   }
351   if (enable_spellcheck) {
352     sources += rebase_path(gypi_values.chrome_browser_spellchecker_sources,
353                            ".",
354                            "//chrome")
355     deps += [ "//third_party/hunspell" ]
356   }
357   if (enable_nacl) {
358     sources +=
359         rebase_path(gypi_values.chrome_browser_nacl_sources, ".", "//chrome")
360     deps += [ "//components/nacl:nacl_browser" ]
361   }
363   if (enable_configuration_policy) {
364     sources +=
365         rebase_path(gypi_values.chrome_browser_policy_shared_with_ios_sources,
366                     ".",
367                     "//chrome")
368     deps += [
369       "//components/policy",
370       "//components/policy/proto",
371     ]
372     if (!is_ios) {
373       sources += rebase_path(gypi_values.chrome_browser_policy_non_ios_sources,
374                              ".",
375                              "//chrome")
376     }
377     if (!is_chromeos) {
378       sources += rebase_path(
379               gypi_values.chrome_browser_policy_shared_with_ios_not_chromeos_sources,
380               ".",
381               "//chrome")
382     }
383     if (is_win || is_mac || is_desktop_linux) {
384       sources += rebase_path(gypi_values.chrome_browser_policy_desktop_sources,
385                              ".",
386                              "//chrome")
387     }
388     if (is_android || is_ios) {
389       sources += rebase_path(gypi_values.chrome_browser_policy_mobile_sources,
390                              ".",
391                              "//chrome")
392     } else {
393       deps += [
394         "//chrome/browser/policy:path_parser",
395         "//net:net_browser_services",
396       ]
397     }
398   } else {
399     # Configuration policy disabled.
400     sources += rebase_path(gypi_values.chrome_browser_policy_disabled_sources,
401                            ".",
402                            "//chrome")
403   }
405   if (enable_plugins) {
406     sources +=
407         rebase_path(gypi_values.chrome_browser_plugins_sources, ".", "//chrome")
408     deps += [
409       "//components/pdf/browser",
410       "//ppapi/proxy:ipc",
411       "//third_party/adobe/flash:flapper_version_h",
412     ]
413   }
414   if (safe_browsing_mode != 0) {
415     sources +=
416         rebase_path(gypi_values.chrome_browser_safe_browsing_basic_sources,
417                     ".",
418                     "//chrome")
419     deps += [
420       "//chrome/browser/safe_browsing:chunk_proto",
421       "//chrome/browser/safe_browsing:metadata_proto",
422       "//chrome/browser/safe_browsing:report_proto",
423     ]
424     if (safe_browsing_mode == 1) {
425       sources +=
426           rebase_path(gypi_values.chrome_browser_safe_browsing_full_sources,
427                       ".",
428                       "//chrome")
429       defines += [ "FULL_SAFE_BROWSING" ]
430       deps += [ "//chrome/common/safe_browsing:proto" ]
431     } else if (safe_browsing_mode == 2) {
432       defines += [ "MOBILE_SAFE_BROWSING" ]
433     }
434   }
436   if (is_linux) {
437     deps += [
438       "//device/media_transfer_protocol",
439       "//device/udev_linux",
440     ]
441   }
442   if (is_linux && !is_chromeos) {
443     deps += [ "//third_party/speech-dispatcher" ]
444   }
446   if (is_chromeos) {
447     sources += rebase_path(gypi_values.chrome_browser_chromeos_sources,
448                            ".",
449                            "//chrome")
450     deps += [ "//chrome/browser/chromeos" ]
451   } else {
452     # Non-ChromeOS.
453     sources += rebase_path(gypi_values.chrome_browser_non_chromeos_sources,
454                            ".",
455                            "//chrome")
456   }
458   if (is_ios) {
459     sources -= [
460       "metrics/signin_status_metrics_provider_base.cc",
461       "metrics/signin_status_metrics_provider_base.h",
462     ]
463   }
465   if (is_chromeos || is_ios) {
466     sources -= [
467       "metrics/signin_status_metrics_provider.cc",
468       "metrics/signin_status_metrics_provider.h",
469     ]
470   }
472   if (use_cups) {
473     configs += [ "//printing:cups" ]
474   }
475   if (is_desktop_linux) {
476     sources += rebase_path(gypi_values.chrome_browser_gnome_keyring_sources,
477                            ".",
478                            "//chrome")
479     configs += [ ":gnome_keyring" ]
480   }
481   if (is_desktop_linux) {
482     sources += rebase_path(gypi_values.chrome_browser_libsecret_sources,
483                            ".",
484                            "//chrome")
485     defines += [ "USE_LIBSECRET" ]
486   }
487   if (use_aura) {
488     sources +=
489         rebase_path(gypi_values.chrome_browser_aura_sources, ".", "//chrome")
490     deps += [
491       "//ui/aura",
492       "//ui/compositor",
493       "//ui/keyboard",
494     ]
495   }
496   if (ui_compositor_image_transport) {
497     deps += [ "//ui/gl" ]
498   }
500   if (use_ash) {
501     sources +=
502         rebase_path(gypi_values.chrome_browser_ash_sources, ".", "//chrome")
503   }
505   if (use_x11) {
506     sources +=
507         rebase_path(gypi_values.chrome_browser_x11_sources, ".", "//chrome")
508   } else {
509     sources -= [ "password_manager/password_store_x.cc" ]
510   }
511   if (is_posix && !is_mac && !is_ios) {
512     sources += [
513       "//chrome/app/chrome_crash_reporter_client.cc",
514       "//chrome/app/chrome_crash_reporter_client.h",
515     ]
516     deps += [
517       "//components/crash/app",
518       "//components/crash/browser",
519     ]
520   }
521   if (use_nss_certs) {
522     sources +=
523         rebase_path(gypi_values.chrome_browser_nss_sources, ".", "//chrome")
524     if (is_chromeos) {
525       sources -= [ "net/nss_context_linux.cc" ]
526     }
527   }
528   if (enable_notifications) {
529     sources += rebase_path(gypi_values.chrome_browser_notifications_sources,
530                            ".",
531                            "//chrome")
532     if (!is_android) {
533       sources += rebase_path(
534               gypi_values.chrome_browser_notifications_non_android_sources,
535               ".",
536               "//chrome")
537     }
538   }
539   if (enable_themes) {
540     sources +=
541         rebase_path(gypi_values.chrome_browser_themes_sources, ".", "//chrome")
542   }
544   if (enable_basic_printing || enable_print_preview) {
545     # Some form of printing support.
546     sources += rebase_path(gypi_values.chrome_browser_printing_basic_sources,
547                            ".",
548                            "//chrome")
549     deps += [ "//printing" ]
550     if (is_win) {
551       sources += rebase_path(gypi_values.chrome_browser_printing_emf_sources,
552                              ".",
553                              "//chrome")
554     }
555     if (enable_print_preview) {
556       # Full printing on top of the above.
557       sources += rebase_path(gypi_values.chrome_browser_printing_full_sources,
558                              ".",
559                              "//chrome")
560     } else {
561       # Partial-only printing support.
562       sources +=
563           rebase_path(gypi_values.chrome_browser_printing_basic_only_sources,
564                       ".",
565                       "//chrome")
566     }
567   }
568   if (enable_captive_portal_detection) {
569     sources += rebase_path(gypi_values.chrome_browser_captive_portal_sources,
570                            ".",
571                            "//chrome")
572   }
573   if (enable_session_service) {
574     sources += rebase_path(gypi_values.chrome_browser_session_service_sources,
575                            ".",
576                            "//chrome")
577   }
579   if (!is_android && !is_ios && !is_chromeos) {
580     sources +=
581         rebase_path(gypi_values.chrome_browser_desktop_sources, ".", "//chrome")
582   }
584   if (is_android || is_ios) {
585     # Mobile.
586     sources +=
587         rebase_path(gypi_values.chrome_browser_mobile_sources, ".", "//chrome")
588   } else {
589     # Non-mobile.
590     sources += rebase_path(gypi_values.chrome_browser_non_mobile_sources,
591                            ".",
592                            "//chrome")
593     deps += [
594       "//components/feedback",
595       "//device/core",
596       "//device/usb",
597     ]
598   }
600   if (is_android) {
601     sources +=
602         rebase_path(gypi_values.chrome_browser_android_sources, ".", "//chrome")
603     deps += [
604       ":jni_headers",
605       "//components/cdm/browser",
606       "//components/enhanced_bookmarks",
607       "//components/resources:components_resources",
608       "//components/web_contents_delegate_android",
609       "//third_party/android_opengl/etc1",
610       "//third_party/libaddressinput:util",
611     ]
612     deps -= [
613       "//third_party/libaddressinput",
614       "//components/storage_monitor",
615       "//components/web_modal",
616     ]
617     defines += [ "ENABLE_DATA_REDUCTION_PROXY_DEBUGGING" ]
619     if (use_seccomp_bpf) {
620       defines += [ "USE_SECCOMP_BPF" ]
621     }
622   }
624   if (is_mac) {
625     deps += [
626       "//third_party/google_toolbox_for_mac",
627       "//third_party/mozilla",
628     ]
629     libs += [
630       "Accelerate.framework",
631       "AddressBook.framework",
632       "AudioUnit.framework",
633       "DiskArbitration.framework",
634       "IOKit.framework",
635       "ImageCaptureCore.framework",
636       "OpenGL.framework",
637       "QuartzCore.framework",
638       "SecurityInterface.framework",
639     ]
640   }
642   if (enable_rlz) {
643     sources +=
644         rebase_path(gypi_values.chrome_browser_rlz_sources, ".", "//chrome")
645     deps += [ "//rlz:rlz_lib" ]
646   }
648   # TODO(GYP)
649   # Temporary fix to break the browser target into smaller chunks so it
650   # will link with goma builds.
651   #["OS=="win" and chromium_win_pch==0", {
652   #  "msvs_shard": 4,
653   #}],
655   if (is_win) {
656     sources +=
657         rebase_path(gypi_values.chrome_browser_win_sources, ".", "//chrome")
658     if (!is_chrome_branded) {
659       sources -= [
660         "google/did_run_updater_win.cc",
661         "google/did_run_updater_win.h",
662       ]
663     }
664     public_deps += [
665       "//ui/views",
666       "//ui/views/controls/webview",
667     ]
668     deps += [
669       ":chrome_process_finder",
670       "//chrome:version_header",
671       "//chrome/installer/util:strings",
672       "//chrome_elf",
673       "//chrome_elf:constants",
674       "//chrome_elf:dll_hash",
675       "//components/browser_watcher",
676       "//components/browser_watcher:browser_watcher_client",
677       "//google_update",
678       "//third_party/iaccessible2",
679       "//third_party/isimpledom",
680       "//third_party/wtl",
681       "//ui/metro_viewer",
682       "//win8:metro_viewer",
683     ]
684     libs += [ "credui.lib" ]
685   } else {
686     # Non-Windows.
687     sources +=
688         rebase_path(gypi_values.chrome_browser_non_win_sources, ".", "//chrome")
689     if (toolkit_views) {
690       deps += [
691         "//ui/views",
692         "//ui/views/controls/webview",
693       ]
694     }
695   }
697   if (is_linux) {
698     sources +=
699         rebase_path(gypi_values.chrome_browser_linux_sources, ".", "//chrome")
700     if (use_aura) {
701       configs += [
702         "//build/config/linux:dbus",
703         "//build/config/linux:fontconfig",
704       ]
705       deps += [ "//dbus" ]
706     }
707     if (use_x11) {
708       configs += [ "//build/config/linux:x11" ]
709       deps += [ "//ui/gfx/x" ]
710     }
711   }
713   if (is_desktop_linux) {
714     sources += rebase_path(gypi_values.chrome_browser_linux_desktop_sources,
715                            ".",
716                            "//chrome")
717   }
718   if (enable_plugin_installation) {
719     sources +=
720         rebase_path(gypi_values.chrome_browser_plugin_installation_sources,
721                     ".",
722                     "//chrome")
723   }
724   if (enable_app_list) {
725     deps += [ "//ui/app_list" ]
726   }
727   if (enable_supervised_users) {
728     sources += rebase_path(gypi_values.chrome_browser_supervised_user_sources,
729                            ".",
730                            "//chrome")
731   }
732   if (enable_supervised_users && enable_themes) {
733     sources += rebase_path(
734             gypi_values.chrome_browser_supervised_user_and_themes_sources,
735             ".",
736             "//chrome")
737   }
738   if (enable_webrtc) {
739     sources +=
740         rebase_path(gypi_values.chrome_browser_webrtc_sources, ".", "//chrome")
741   }
742   if (enable_service_discovery) {
743     sources += rebase_path(gypi_values.chrome_browser_service_discovery_sources,
744                            ".",
745                            "//chrome")
746   }
747   if (enable_mdns) {
748     sources +=
749         rebase_path(gypi_values.chrome_browser_mdns_sources, ".", "//chrome")
750   }
751   if (!enable_autofill_dialog || is_android || is_ios) {
752     sources -= [
753       "autofill/validation_rules_storage_factory.cc",
754       "autofill/validation_rules_storage_factory.h",
755     ]
756   }
757   if (enable_wifi_bootstrapping) {
758     sources +=
759         rebase_path(gypi_values.chrome_browser_wifi_bootstrapping_sources,
760                     ".",
761                     "//chrome")
762     if (is_win || is_mac) {
763       # TODO(brettw) as of this writing wifi bootstrapping is set on Windows
764       # and Mac, so this test is meaningless. Can we merge these lists?
765       sources += rebase_path(
766               gypi_values.chrome_browser_wifi_bootstrapping_win_mac_sources,
767               ".",
768               "//chrome")
769     }
770   }
773 if (is_android) {
774   # GYP version: chrome/chrome_browser.gypi:chrome_browser_jni_headers
775   generate_jni("jni_headers") {
776     sources =
777         rebase_path(gypi_values.chrome_browser_jni_sources, ".", "//chrome")
778     jni_package = "chrome"
779   }
782 if (is_win) {
783   source_set("chrome_process_finder") {
784     sources = [
785       "chrome_process_finder_win.cc",
786       "chrome_process_finder_win.h",
787     ]
788     deps = [
789       "//base",
790       "//chrome/browser/metro_utils",
791       "//chrome/common:constants",
792     ]
793     if (enable_configuration_policy) {
794       deps += [ "//chrome/browser/policy:path_parser" ]
795     }
796   }
799 # GYP version: chrome/chrome_resources.gyp:chrome_resources
800 # (generate_browser_resources action)
801 grit("resources") {
802   source = "browser_resources.grd"
803   output_dir = "$root_gen_dir/chrome"
804   outputs = [
805     "grit/browser_resources.h",
806     "browser_resources.pak",
807   ]
809   omnibox_mojom_file =
810       "$root_gen_dir/chrome/browser/ui/webui/omnibox/omnibox.mojom.js"
812   grit_flags = [
813     "-E",
814     "about_credits_file=" + rebase_path(about_credits_file, root_build_dir),
815     "-E",
816     "additional_modules_list_file=" +
817         rebase_path(additional_modules_list_file, root_build_dir),
818     "-E",
819     "omnibox_mojom_file=" + rebase_path(omnibox_mojom_file, root_build_dir),
820   ]
822   deps = [
823     ":about_credits",
824     ":chrome_internal_resources_gen",
825   ]
826   inputs = [
827     omnibox_mojom_file,
828   ]
831 # GYP version: chrome/chrome_resource.gyp:about_credits
832 action("about_credits") {
833   script = "//tools/licenses.py"
835   inputs = [
836     # This is not a complete list. TODO(phajdan.jr, dbeam): licenses.py needs to
837     # generate a .d file with all the licenses/credits that about:credits uses.
838     # Then about:credits will automatically rebuild when one of them changes.
839     # See: depfile in gn's documentation (gn help depfile).
840     "resources/about_credits.tmpl",
841     "resources/about_credits_entry.tmpl",
842   ]
844   outputs = [
845     about_credits_file,
846   ]
848   args = [
849     "credits",
850     rebase_path(about_credits_file, root_build_dir),
851   ]
854 # GYP version: chrome/chrome_resource.gyp:chrome_internal_resources_gen
855 if (is_chrome_branded) {
856   action("chrome_internal_resources_gen") {
857     script = "internal/transform_additional_modules_list.py"
858     sources = [
859       "internal/resources/additional_modules_list.input",
860     ]
861     outputs = [
862       additional_modules_list_file,
863     ]
864     args = rebase_path(sources, root_build_dir) +
865            rebase_path(outputs, root_build_dir)
866   }
867 } else {
868   group("chrome_internal_resources_gen") {
869     # Empty placeholder.
870   }
873 # In GYP this is part of test_support_common.
874 source_set("test_support") {
875   testonly = true
877   # Always include this via the main test support target.
878   visibility = [ "//chrome/test:test_support" ]
880   sources = [
881     "browsing_data/mock_browsing_data_appcache_helper.cc",
882     "browsing_data/mock_browsing_data_appcache_helper.h",
883     "browsing_data/mock_browsing_data_channel_id_helper.cc",
884     "browsing_data/mock_browsing_data_channel_id_helper.h",
885     "browsing_data/mock_browsing_data_cookie_helper.cc",
886     "browsing_data/mock_browsing_data_cookie_helper.h",
887     "browsing_data/mock_browsing_data_database_helper.cc",
888     "browsing_data/mock_browsing_data_database_helper.h",
889     "browsing_data/mock_browsing_data_file_system_helper.cc",
890     "browsing_data/mock_browsing_data_file_system_helper.h",
891     "browsing_data/mock_browsing_data_flash_lso_helper.cc",
892     "browsing_data/mock_browsing_data_flash_lso_helper.h",
893     "browsing_data/mock_browsing_data_indexed_db_helper.cc",
894     "browsing_data/mock_browsing_data_indexed_db_helper.h",
895     "browsing_data/mock_browsing_data_local_storage_helper.cc",
896     "browsing_data/mock_browsing_data_local_storage_helper.h",
897     "browsing_data/mock_browsing_data_quota_helper.cc",
898     "browsing_data/mock_browsing_data_quota_helper.h",
899     "browsing_data/mock_browsing_data_service_worker_helper.cc",
900     "browsing_data/mock_browsing_data_service_worker_helper.h",
901     "download/download_test_file_activity_observer.cc",
902     "download/download_test_file_activity_observer.h",
903     "download/test_download_shelf.cc",
904     "download/test_download_shelf.h",
905     "invalidation/fake_invalidation_service.cc",
906     "invalidation/fake_invalidation_service.h",
907     "media/fake_desktop_media_list.cc",
908     "media/fake_desktop_media_list.h",
909     "net/dns_probe_test_util.cc",
910     "net/dns_probe_test_util.h",
911     "net/url_request_mock_util.cc",
912     "net/url_request_mock_util.h",
913     "notifications/notification_test_util.cc",
914     "notifications/notification_test_util.h",
915     "password_manager/mock_password_store_service.cc",
916     "password_manager/mock_password_store_service.h",
917     "password_manager/null_password_store_service.cc",
918     "password_manager/null_password_store_service.h",
919     "password_manager/test_password_store_service.cc",
920     "password_manager/test_password_store_service.h",
921     "prefs/pref_service_mock_factory.cc",
922     "prefs/pref_service_mock_factory.h",
923     "profile_resetter/profile_resetter_test_base.cc",
924     "profile_resetter/profile_resetter_test_base.h",
925     "search_engines/template_url_service_factory_test_util.cc",
926     "search_engines/template_url_service_factory_test_util.h",
927     "search_engines/template_url_service_test_util.cc",
928     "search_engines/template_url_service_test_util.h",
929     "sessions/session_restore_test_helper.cc",
930     "sessions/session_restore_test_helper.h",
931     "sessions/session_service_test_helper.cc",
932     "sessions/session_service_test_helper.h",
933     "signin/fake_account_reconcilor.cc",
934     "signin/fake_account_reconcilor.h",
935     "signin/fake_account_tracker_service.cc",
936     "signin/fake_account_tracker_service.h",
937     "signin/fake_profile_oauth2_token_service.cc",
938     "signin/fake_profile_oauth2_token_service.h",
939     "signin/fake_profile_oauth2_token_service_builder.cc",
940     "signin/fake_profile_oauth2_token_service_builder.h",
941     "signin/fake_signin_manager.cc",
942     "signin/fake_signin_manager.h",
943     "ssl/ssl_client_auth_requestor_mock.cc",
944     "ssl/ssl_client_auth_requestor_mock.h",
945     "sync/profile_sync_components_factory_mock.cc",
946     "sync/profile_sync_components_factory_mock.h",
947     "sync/profile_sync_service_mock.cc",
948     "sync/profile_sync_service_mock.h",
949     "ui/webui/signin/login_ui_test_utils.cc",
950     "ui/webui/signin/login_ui_test_utils.h",
951   ]
953   public_deps = [
954     ":browser",
955     "//chrome/browser/ui:test_support",
956   ]
957   deps = [
958     "//base:prefs_test_support",
959     "//chrome/browser",
960     "//chrome/common",
961     "//chrome/common/safe_browsing:proto",
962     "//components/invalidation",
963     "//components/invalidation:test_support",
964     "//components/password_manager/core/browser:test_support",
965     "//components/search_engines:test_support",
966     "//content/test:test_support",
967     "//chrome/app/theme:theme_resources",
968     "//net:test_support",
969     "//skia",
970     "//testing/gmock",
971     "//testing/gtest",
972     "//ui/gfx",
973   ]
975   if (!is_ios) {
976     deps += [
977       "//components/sessions:test_support",
978       "//google_apis:test_support",
979     ]
980   }
982   if (enable_extensions) {
983     sources += [
984       "extensions/extension_action_test_util.cc",
985       "extensions/extension_action_test_util.h",
986     ]
987     deps += [ "//extensions:test_support" ]
988   }
990   if (is_chromeos) {
991     sources += [
992       "chromeos/app_mode/fake_cws.cc",
993       "chromeos/app_mode/fake_cws.h",
994       "chromeos/file_manager/fake_disk_mount_manager.cc",
995       "chromeos/file_manager/fake_disk_mount_manager.h",
996       "chromeos/input_method/mock_candidate_window_controller.cc",
997       "chromeos/input_method/mock_candidate_window_controller.h",
998       "chromeos/input_method/mock_input_method_engine.cc",
999       "chromeos/input_method/mock_input_method_engine.h",
1000       "chromeos/input_method/mock_input_method_manager.cc",
1001       "chromeos/input_method/mock_input_method_manager.h",
1002       "chromeos/login/screens/mock_device_disabled_screen_actor.cc",
1003       "chromeos/login/screens/mock_device_disabled_screen_actor.h",
1004       "chromeos/login/session/user_session_manager_test_api.cc",
1005       "chromeos/login/session/user_session_manager_test_api.h",
1006       "chromeos/login/test/js_checker.cc",
1007       "chromeos/login/test/js_checker.h",
1008       "chromeos/login/test/oobe_screen_waiter.cc",
1009       "chromeos/login/test/oobe_screen_waiter.h",
1010       "chromeos/login/ui/mock_login_display.cc",
1011       "chromeos/login/ui/mock_login_display.h",
1012       "chromeos/login/ui/mock_login_display_host.cc",
1013       "chromeos/login/ui/mock_login_display_host.h",
1014       "chromeos/login/users/avatar/mock_user_image_manager.cc",
1015       "chromeos/login/users/avatar/mock_user_image_manager.h",
1016       "chromeos/login/users/fake_chrome_user_manager.cc",
1017       "chromeos/login/users/fake_chrome_user_manager.h",
1018       "chromeos/login/users/fake_supervised_user_manager.cc",
1019       "chromeos/login/users/fake_supervised_user_manager.h",
1020       "chromeos/login/users/mock_user_manager.cc",
1021       "chromeos/login/users/mock_user_manager.h",
1022       "chromeos/net/network_portal_detector_test_utils.cc",
1023       "chromeos/net/network_portal_detector_test_utils.h",
1024       "chromeos/policy/cloud_external_data_manager_base_test_util.cc",
1025       "chromeos/policy/cloud_external_data_manager_base_test_util.h",
1026       "chromeos/policy/device_policy_builder.cc",
1027       "chromeos/policy/device_policy_builder.h",
1028       "chromeos/policy/fake_consumer_management_service.cc",
1029       "chromeos/policy/fake_consumer_management_service.h",
1030       "chromeos/policy/fake_device_cloud_policy_initializer.cc",
1031       "chromeos/policy/fake_device_cloud_policy_initializer.h",
1032       "chromeos/policy/fake_device_cloud_policy_manager.cc",
1033       "chromeos/policy/fake_device_cloud_policy_manager.h",
1034       "chromeos/policy/stub_enterprise_install_attributes.cc",
1035       "chromeos/policy/stub_enterprise_install_attributes.h",
1036       "chromeos/settings/device_settings_test_helper.cc",
1037       "chromeos/settings/device_settings_test_helper.h",
1038       "chromeos/system/fake_input_device_settings.cc",
1039       "chromeos/system/fake_input_device_settings.h",
1040     ]
1041     configs += [ "//build/config/linux:dbus" ]
1042     deps += [ "//chromeos:test_support" ]
1043   }
1045   if (enable_configuration_policy) {
1046     sources += [
1047       "policy/test/local_policy_test_server.cc",
1048       "policy/test/local_policy_test_server.h",
1049     ]
1050     public_deps += [
1051       "//components/policy:policy_component_test_support",
1052       "//components/policy:test_support",
1053     ]
1054   }
1056   if (safe_browsing_mode == 1) {
1057     sources += [
1058       "extensions/fake_safe_browsing_database_manager.cc",
1059       "extensions/fake_safe_browsing_database_manager.h",
1060     ]
1061   }
1063   if (enable_extensions) {
1064     sources += [
1065       "drive/dummy_drive_service.cc",
1066       "drive/dummy_drive_service.h",
1067       "drive/fake_drive_service.cc",
1068       "drive/fake_drive_service.h",
1069       "drive/test_util.cc",
1070       "drive/test_util.h",
1071       "extensions/api/messaging/native_messaging_test_util.cc",
1072       "extensions/api/messaging/native_messaging_test_util.h",
1073       "extensions/extension_notification_observer.cc",
1074       "extensions/extension_notification_observer.h",
1075       "extensions/mock_extension_special_storage_policy.cc",
1076       "extensions/mock_extension_special_storage_policy.h",
1077       "extensions/test_blacklist.cc",
1078       "extensions/test_blacklist.h",
1079       "extensions/test_blacklist_state_fetcher.cc",
1080       "extensions/test_blacklist_state_fetcher.h",
1081       "extensions/test_extension_dir.cc",
1082       "extensions/test_extension_dir.h",
1083       "extensions/test_extension_environment.cc",
1084       "extensions/test_extension_environment.h",
1085       "extensions/test_extension_prefs.cc",
1086       "extensions/test_extension_prefs.h",
1087       "extensions/test_extension_service.cc",
1088       "extensions/test_extension_service.h",
1089       "extensions/test_extension_system.cc",
1090       "extensions/test_extension_system.h",
1091       "media_galleries/media_galleries_test_util.cc",
1092       "media_galleries/media_galleries_test_util.h",
1093     ]
1094     deps += [ "//components/storage_monitor:test_support" ]
1095   }
1097   if (enable_mdns) {
1098     sources += [
1099       "local_discovery/test_service_discovery_client.cc",
1100       "local_discovery/test_service_discovery_client.h",
1101     ]
1102   }
1104   if (enable_app_list) {
1105     sources += [
1106       "ui/app_list/test/chrome_app_list_test_support.cc",
1107       "ui/app_list/test/chrome_app_list_test_support.h",
1108       "ui/app_list/test/test_app_list_controller_delegate.cc",
1109       "ui/app_list/test/test_app_list_controller_delegate.h",
1110     ]
1111   }
1113   if (enable_wifi_bootstrapping) {
1114     sources += [
1115       "local_discovery/wifi/mock_wifi_manager.cc",
1116       "local_discovery/wifi/mock_wifi_manager.h",
1117     ]
1118   }