Prevent chrome://net-internals/#export from flickering
[chromium-blink-merge.git] / chrome / browser / BUILD.gn
bloba12ba3091c6f7e8d0f360eea52905f48e939535a
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/captive_portal",
86     "//components/cloud_devices/common",
87     "//components/component_updater",
88     "//components/content_settings/core/browser",
89     "//components/content_settings/core/common",
90     "//components/crx_file",
91     "//components/data_reduction_proxy/core/browser",
92     "//components/device_event_log",
93     "//components/domain_reliability",
94     "//components/enhanced_bookmarks",
95     "//components/favicon_base",
96     "//components/favicon/core",
97     "//components/feedback",
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_predictor_sources,
200                            ".",
201                            "//chrome")
202     sources +=
203         rebase_path(gypi_values.chrome_browser_pref_sources, ".", "//chrome")
204     sources += rebase_path(gypi_values.chrome_browser_profiles_sources,
205                            ".",
206                            "//chrome")
207     sources += rebase_path(gypi_values.chrome_browser_search_engines_sources,
208                            ".",
209                            "//chrome")
210     sources += rebase_path(gypi_values.chrome_browser_services_sources,
211                            ".",
212                            "//chrome")
213     sources +=
214         rebase_path(gypi_values.chrome_browser_session_sources, ".", "//chrome")
215     sources +=
216         rebase_path(gypi_values.chrome_browser_signin_sources, ".", "//chrome")
217     sources +=
218         rebase_path(gypi_values.chrome_browser_ssl_sources, ".", "//chrome")
219     sources +=
220         rebase_path(gypi_values.chrome_browser_sync_sources, ".", "//chrome")
221     sources += rebase_path(gypi_values.chrome_browser_web_resource_sources,
222                            ".",
223                            "//chrome")
225     deps += [
226       "//apps",
227       "//cc",
228       "//chrome/app:generated_resources_map",
229       "//chrome/app/theme:theme_resources",
230       "//chrome/browser/devtools",
231       "//chrome/browser/resources:component_extension_resources",
232       "//chrome/installer/util",
233       "//components/app_modal",
234       "//components/autofill/content/browser",
235       "//components/data_reduction_proxy/content/browser",
236       "//components/dom_distiller/content",
237       "//components/history/content/browser",
238       "//components/keyed_service/content",
239       "//components/navigation_interception",
240       "//components/password_manager/content/browser",
241       "//components/precache/content",
242       "//components/sessions:sessions_content",
243       "//components/storage_monitor",
244       "//components/translate/content/browser",
245       "//components/url_matcher",
246       "//components/visitedlink/browser",
247       "//components/visitedlink/common",
248       "//components/web_cache/browser",
249       "//components/web_modal",
250       "//content/app/resources",
251       "//media",
252       "//mojo/common",
253       "//mojo/environment:chromium",
254       "//net:extras",
255       "//net:net_with_v8",
256       "//storage/browser",
257       "//storage/common",
258       "//third_party/WebKit/public:resources",
259       "//third_party/expat",
260       "//third_party/leveldatabase",
261       "//third_party/libaddressinput",
262       "//third_party/libyuv",
263       "//third_party/mojo/src/mojo/edk/system",
264       "//third_party/mojo/src/mojo/public/cpp/bindings",
265       "//third_party/mojo/src/mojo/public/js",
266       "//third_party/npapi",
267       "//third_party/re2",
268       "//third_party/smhasher:cityhash",
269       "//third_party/webrtc/modules/desktop_capture",
270       "//ui/base/ime",
271       "//ui/gl",
272       "//ui/resources",
273       "//ui/surface",
274       "//ui/web_dialogs",
275       "//v8",
276     ]
277   } else {  # iOS
278     sources +=
279         rebase_path(gypi_values.chrome_browser_ios_sources, ".", "//chrome")
280     sources +=
281         rebase_path(gypi_values.chrome_browser_google_sources, ".", "//chrome")
282     deps += [ "//net" ]
283     libs += [
284       "CoreTelephony.framework",
285       "CoreText.framework",
286       "MobileCoreServices.framework",
287       "QuartzCore.framework",
288     ]
289     ldflags += [
290       "-weak_framework",
291       "CoreImage",
292     ]
293   }
295   if (is_win || is_mac) {
296     sources +=
297         rebase_path(gypi_values.chrome_browser_win_mac_sources, ".", "//chrome")
298   }
299   if (!is_android && !is_ios && !is_chromeos && enable_configuration_policy) {
300     sources += [
301       "net/disk_cache_dir_policy_handler.cc",
302       "net/disk_cache_dir_policy_handler.h",
303     ]
304   }
305   if (!is_android && !is_ios && enable_configuration_policy) {
306     sources += [
307       "download/download_dir_policy_handler.cc",
308       "download/download_dir_policy_handler.h",
309     ]
310   }
311   if (is_mac) {
312     sources +=
313         rebase_path(gypi_values.chrome_browser_mac_sources, ".", "//chrome")
314     deps += [
315       #"app_shim"  TODO(GYP)
316       #"browser_app_shim"  TODO(GYP)
317     ]
318   }
319   if (enable_extensions) {
320     public_deps += [ "//chrome/browser/extensions" ]
321     deps += [
322       "//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto",
323       "//chrome/common/extensions/api",
324       "//chrome/common/extensions/api:api_registration",
325       "//components/proximity_auth/cryptauth",
326       "//extensions/components/javascript_dialog_extensions_client",
327       "//media/cast:net",
328     ]
329     sources += rebase_path(gypi_values.chrome_browser_extensions_sources,
330                            ".",
331                            "//chrome")
332   }
333   if (enable_background) {
334     sources += rebase_path(gypi_values.chrome_browser_background_sources,
335                            ".",
336                            "//chrome")
337     if (!use_aura || is_win || is_chromeos) {
338       sources -= [ "background/background_mode_manager_aura.cc" ]
339     }
340   }
341   if (enable_task_manager) {
342     sources += rebase_path(gypi_values.chrome_browser_task_manager_sources,
343                            ".",
344                            "//chrome")
345   }
346   if (enable_spellcheck) {
347     sources += rebase_path(gypi_values.chrome_browser_spellchecker_sources,
348                            ".",
349                            "//chrome")
350     deps += [ "//third_party/hunspell" ]
351   }
352   if (enable_nacl) {
353     sources +=
354         rebase_path(gypi_values.chrome_browser_nacl_sources, ".", "//chrome")
355     deps += [ "//components/nacl:nacl_browser" ]
356   }
358   if (enable_configuration_policy) {
359     sources +=
360         rebase_path(gypi_values.chrome_browser_policy_shared_with_ios_sources,
361                     ".",
362                     "//chrome")
363     deps += [
364       "//components/policy",
365       "//components/policy/proto",
366     ]
367     if (!is_ios) {
368       sources += rebase_path(gypi_values.chrome_browser_policy_non_ios_sources,
369                              ".",
370                              "//chrome")
371     }
372     if (!is_chromeos) {
373       sources += rebase_path(
374               gypi_values.chrome_browser_policy_shared_with_ios_not_chromeos_sources,
375               ".",
376               "//chrome")
377     }
378     if (is_win || is_mac || is_desktop_linux) {
379       sources += rebase_path(gypi_values.chrome_browser_policy_desktop_sources,
380                              ".",
381                              "//chrome")
382     }
383     if (is_android || is_ios) {
384       sources += rebase_path(gypi_values.chrome_browser_policy_mobile_sources,
385                              ".",
386                              "//chrome")
387     } else {
388       deps += [
389         "//chrome/browser/policy:path_parser",
390         "//net:net_browser_services",
391       ]
392     }
393   } else {
394     # Configuration policy disabled.
395     sources += rebase_path(gypi_values.chrome_browser_policy_disabled_sources,
396                            ".",
397                            "//chrome")
398   }
400   if (enable_plugins) {
401     sources +=
402         rebase_path(gypi_values.chrome_browser_plugins_sources, ".", "//chrome")
403     deps += [
404       "//components/pdf/browser",
405       "//ppapi/proxy:ipc",
406       "//third_party/adobe/flash:flapper_version_h",
407     ]
408   }
409   if (safe_browsing_mode != 0) {
410     sources +=
411         rebase_path(gypi_values.chrome_browser_safe_browsing_basic_sources,
412                     ".",
413                     "//chrome")
414     deps += [
415       "//chrome/browser/safe_browsing:chunk_proto",
416       "//chrome/browser/safe_browsing:metadata_proto",
417       "//chrome/browser/safe_browsing:report_proto",
418     ]
419     if (safe_browsing_mode == 1) {
420       sources +=
421           rebase_path(gypi_values.chrome_browser_safe_browsing_full_sources,
422                       ".",
423                       "//chrome")
424       defines += [ "FULL_SAFE_BROWSING" ]
425       deps += [ "//chrome/common/safe_browsing:proto" ]
426     } else if (safe_browsing_mode == 2) {
427       defines += [ "MOBILE_SAFE_BROWSING" ]
428     }
429   }
431   if (is_linux) {
432     deps += [
433       "//device/media_transfer_protocol",
434       "//device/udev_linux",
435     ]
436   }
437   if (is_linux && !is_chromeos) {
438     deps += [ "//third_party/speech-dispatcher" ]
439   }
441   if (is_chromeos) {
442     sources += rebase_path(gypi_values.chrome_browser_chromeos_sources,
443                            ".",
444                            "//chrome")
445     deps += [ "//chrome/browser/chromeos" ]
446   } else {
447     # Non-ChromeOS.
448     sources += rebase_path(gypi_values.chrome_browser_non_chromeos_sources,
449                            ".",
450                            "//chrome")
451   }
453   if (is_ios) {
454     sources -= [
455       "metrics/signin_status_metrics_provider_base.cc",
456       "metrics/signin_status_metrics_provider_base.h",
457     ]
458   }
460   if (is_chromeos || is_ios) {
461     sources -= [
462       "metrics/signin_status_metrics_provider.cc",
463       "metrics/signin_status_metrics_provider.h",
464     ]
465   }
467   if (use_cups) {
468     configs += [ "//printing:cups" ]
469   }
470   if (is_desktop_linux) {
471     sources += rebase_path(gypi_values.chrome_browser_gnome_keyring_sources,
472                            ".",
473                            "//chrome")
474     configs += [ ":gnome_keyring" ]
475   }
476   if (is_desktop_linux) {
477     sources += rebase_path(gypi_values.chrome_browser_libsecret_sources,
478                            ".",
479                            "//chrome")
480     defines += [ "USE_LIBSECRET" ]
481   }
482   if (use_aura) {
483     sources +=
484         rebase_path(gypi_values.chrome_browser_aura_sources, ".", "//chrome")
485     deps += [
486       "//ui/aura",
487       "//ui/compositor",
488       "//ui/keyboard",
489     ]
490   }
491   if (ui_compositor_image_transport) {
492     deps += [ "//ui/gl" ]
493   }
495   if (use_ash) {
496     sources +=
497         rebase_path(gypi_values.chrome_browser_ash_sources, ".", "//chrome")
498   }
500   if (use_x11) {
501     sources +=
502         rebase_path(gypi_values.chrome_browser_x11_sources, ".", "//chrome")
503   } else {
504     sources -= [ "password_manager/password_store_x.cc" ]
505   }
506   if (is_posix && !is_mac && !is_ios) {
507     sources += [
508       "//chrome/app/chrome_crash_reporter_client.cc",
509       "//chrome/app/chrome_crash_reporter_client.h",
510     ]
511     deps += [
512       "//components/crash/app",
513       "//components/crash/browser",
514     ]
515   }
516   if (use_nss_certs) {
517     sources +=
518         rebase_path(gypi_values.chrome_browser_nss_sources, ".", "//chrome")
519     if (is_chromeos) {
520       sources -= [ "net/nss_context_linux.cc" ]
521     }
522   }
523   if (enable_notifications) {
524     sources += rebase_path(gypi_values.chrome_browser_notifications_sources,
525                            ".",
526                            "//chrome")
527     if (!is_android) {
528       sources += rebase_path(
529               gypi_values.chrome_browser_notifications_non_android_sources,
530               ".",
531               "//chrome")
532     }
533   }
534   if (enable_themes) {
535     sources +=
536         rebase_path(gypi_values.chrome_browser_themes_sources, ".", "//chrome")
537   }
539   if (enable_basic_printing || enable_print_preview) {
540     # Some form of printing support.
541     sources += rebase_path(gypi_values.chrome_browser_printing_basic_sources,
542                            ".",
543                            "//chrome")
544     deps += [ "//printing" ]
545     if (is_win) {
546       sources += rebase_path(gypi_values.chrome_browser_printing_emf_sources,
547                              ".",
548                              "//chrome")
549     }
550     if (enable_print_preview) {
551       # Full printing on top of the above.
552       sources += rebase_path(gypi_values.chrome_browser_printing_full_sources,
553                              ".",
554                              "//chrome")
555     } else {
556       # Partial-only printing support.
557       sources +=
558           rebase_path(gypi_values.chrome_browser_printing_basic_only_sources,
559                       ".",
560                       "//chrome")
561     }
562   }
563   if (enable_captive_portal_detection) {
564     sources += rebase_path(gypi_values.chrome_browser_captive_portal_sources,
565                            ".",
566                            "//chrome")
567   }
568   if (enable_session_service) {
569     sources += rebase_path(gypi_values.chrome_browser_session_service_sources,
570                            ".",
571                            "//chrome")
572   }
574   if (!is_android && !is_ios && !is_chromeos) {
575     sources +=
576         rebase_path(gypi_values.chrome_browser_desktop_sources, ".", "//chrome")
577   }
579   if (is_android || is_ios) {
580     # Mobile.
581     sources +=
582         rebase_path(gypi_values.chrome_browser_mobile_sources, ".", "//chrome")
583   } else {
584     # Non-mobile.
585     sources += rebase_path(gypi_values.chrome_browser_non_mobile_sources,
586                            ".",
587                            "//chrome")
588     deps += [
589       "//device/core",
590       "//device/usb",
591     ]
592   }
594   if (is_android) {
595     sources +=
596         rebase_path(gypi_values.chrome_browser_android_sources, ".", "//chrome")
597     deps += [
598       ":jni_headers",
599       "//components/cdm/browser",
600       "//components/enhanced_bookmarks",
601       "//components/resources:components_resources",
602       "//components/web_contents_delegate_android",
603       "//third_party/android_opengl/etc1",
604       "//third_party/libaddressinput:util",
605     ]
606     deps -= [
607       "//third_party/libaddressinput",
608       "//components/feedback",
609       "//components/storage_monitor",
610       "//components/web_modal",
611     ]
612     defines += [ "ENABLE_DATA_REDUCTION_PROXY_DEBUGGING" ]
613   }
615   if (is_mac) {
616     deps += [
617       "//third_party/google_toolbox_for_mac",
618       "//third_party/mozilla",
619     ]
620     libs += [
621       "Accelerate.framework",
622       "AddressBook.framework",
623       "AudioUnit.framework",
624       "DiskArbitration.framework",
625       "IOKit.framework",
626       "ImageCaptureCore.framework",
627       "OpenGL.framework",
628       "QuartzCore.framework",
629       "SecurityInterface.framework",
630     ]
631   }
633   if (enable_rlz) {
634     sources +=
635         rebase_path(gypi_values.chrome_browser_rlz_sources, ".", "//chrome")
636     deps += [ "//rlz:rlz_lib" ]
637   }
639   # TODO(GYP)
640   # Temporary fix to break the browser target into smaller chunks so it
641   # will link with goma builds.
642   #["OS=="win" and chromium_win_pch==0", {
643   #  "msvs_shard": 4,
644   #}],
646   if (is_win) {
647     sources +=
648         rebase_path(gypi_values.chrome_browser_win_sources, ".", "//chrome")
649     if (!is_chrome_branded) {
650       sources -= [
651         "google/did_run_updater_win.cc",
652         "google/did_run_updater_win.h",
653       ]
654     }
655     public_deps += [
656       "//ui/views",
657       "//ui/views/controls/webview",
658     ]
659     deps += [
660       ":chrome_process_finder",
661       "//chrome:version_header",
662       "//chrome/installer/util:strings",
663       "//chrome_elf",
664       "//chrome_elf:constants",
665       "//chrome_elf:dll_hash",
666       "//components/browser_watcher",
667       "//components/browser_watcher:browser_watcher_client",
668       "//google_update",
669       "//third_party/iaccessible2",
670       "//third_party/isimpledom",
671       "//third_party/wtl",
672       "//ui/metro_viewer",
673       "//win8:metro_viewer",
674     ]
675     libs += [ "credui.lib" ]
676   } else {
677     # Non-Windows.
678     sources +=
679         rebase_path(gypi_values.chrome_browser_non_win_sources, ".", "//chrome")
680     if (toolkit_views) {
681       deps += [
682         "//ui/views",
683         "//ui/views/controls/webview",
684       ]
685     }
686   }
688   if (is_linux) {
689     sources +=
690         rebase_path(gypi_values.chrome_browser_linux_sources, ".", "//chrome")
691     if (use_aura) {
692       configs += [
693         "//build/config/linux:dbus",
694         "//build/config/linux:fontconfig",
695       ]
696       deps += [ "//dbus" ]
697     }
698     if (use_x11) {
699       configs += [ "//build/config/linux:x11" ]
700       deps += [ "//ui/gfx/x" ]
701     }
702   }
704   if (is_desktop_linux) {
705     sources += rebase_path(gypi_values.chrome_browser_linux_desktop_sources,
706                            ".",
707                            "//chrome")
708   }
709   if (enable_plugin_installation) {
710     sources +=
711         rebase_path(gypi_values.chrome_browser_plugin_installation_sources,
712                     ".",
713                     "//chrome")
714   }
715   if (enable_app_list) {
716     deps += [ "//ui/app_list" ]
717   }
718   if (enable_supervised_users) {
719     sources += rebase_path(gypi_values.chrome_browser_supervised_user_sources,
720                            ".",
721                            "//chrome")
722   }
723   if (enable_supervised_users && enable_themes) {
724     sources += rebase_path(
725             gypi_values.chrome_browser_supervised_user_and_themes_sources,
726             ".",
727             "//chrome")
728   }
729   if (enable_webrtc) {
730     sources +=
731         rebase_path(gypi_values.chrome_browser_webrtc_sources, ".", "//chrome")
732   }
733   if (enable_service_discovery) {
734     sources += rebase_path(gypi_values.chrome_browser_service_discovery_sources,
735                            ".",
736                            "//chrome")
737   }
738   if (enable_mdns) {
739     sources +=
740         rebase_path(gypi_values.chrome_browser_mdns_sources, ".", "//chrome")
741   }
742   if (!enable_autofill_dialog || is_android || is_ios) {
743     sources -= [
744       "autofill/validation_rules_storage_factory.cc",
745       "autofill/validation_rules_storage_factory.h",
746     ]
747   }
748   if (enable_wifi_bootstrapping) {
749     sources +=
750         rebase_path(gypi_values.chrome_browser_wifi_bootstrapping_sources,
751                     ".",
752                     "//chrome")
753     if (is_win || is_mac) {
754       # TODO(brettw) as of this writing wifi bootstrapping is set on Windows
755       # and Mac, so this test is meaningless. Can we merge these lists?
756       sources += rebase_path(
757               gypi_values.chrome_browser_wifi_bootstrapping_win_mac_sources,
758               ".",
759               "//chrome")
760     }
761   }
764 if (is_android) {
765   # GYP version: chrome/chrome_browser.gypi:chrome_browser_jni_headers
766   generate_jni("jni_headers") {
767     sources =
768         rebase_path(gypi_values.chrome_browser_jni_sources, ".", "//chrome")
769     jni_package = "chrome"
770   }
773 if (is_win) {
774   source_set("chrome_process_finder") {
775     sources = [
776       "chrome_process_finder_win.cc",
777       "chrome_process_finder_win.h",
778     ]
779     deps = [
780       "//base",
781       "//chrome/browser/metro_utils",
782       "//chrome/common:constants",
783     ]
784     if (enable_configuration_policy) {
785       deps += [ "//chrome/browser/policy:path_parser" ]
786     }
787   }
790 # GYP version: chrome/chrome_resources.gyp:chrome_resources
791 # (generate_browser_resources action)
792 grit("resources") {
793   source = "browser_resources.grd"
794   output_dir = "$root_gen_dir/chrome"
795   outputs = [
796     "grit/browser_resources.h",
797     "browser_resources.pak",
798   ]
800   omnibox_mojom_file =
801       "$root_gen_dir/chrome/browser/ui/webui/omnibox/omnibox.mojom.js"
803   grit_flags = [
804     "-E",
805     "about_credits_file=" + rebase_path(about_credits_file, root_build_dir),
806     "-E",
807     "additional_modules_list_file=" +
808         rebase_path(additional_modules_list_file, root_build_dir),
809     "-E",
810     "omnibox_mojom_file=" + rebase_path(omnibox_mojom_file, root_build_dir),
811   ]
813   deps = [
814     ":about_credits",
815     ":chrome_internal_resources_gen",
816   ]
817   inputs = [
818     omnibox_mojom_file,
819   ]
822 # GYP version: chrome/chrome_resource.gyp:about_credits
823 action("about_credits") {
824   script = "//tools/licenses.py"
826   inputs = [
827     # This is not a complete list. TODO(phajdan.jr, dbeam): licenses.py needs to
828     # generate a .d file with all the licenses/credits that about:credits uses.
829     # Then about:credits will automatically rebuild when one of them changes.
830     # See: depfile in gn's documentation (gn help depfile).
831     "resources/about_credits.tmpl",
832     "resources/about_credits_entry.tmpl",
833   ]
835   outputs = [
836     about_credits_file,
837   ]
839   args = [
840     "credits",
841     rebase_path(about_credits_file, root_build_dir),
842   ]
845 # GYP version: chrome/chrome_resource.gyp:chrome_internal_resources_gen
846 if (is_chrome_branded) {
847   action("chrome_internal_resources_gen") {
848     script = "internal/transform_additional_modules_list.py"
849     sources = [
850       "internal/resources/additional_modules_list.input",
851     ]
852     outputs = [
853       additional_modules_list_file,
854     ]
855     args = rebase_path(sources, root_build_dir) +
856            rebase_path(outputs, root_build_dir)
857   }
858 } else {
859   group("chrome_internal_resources_gen") {
860     # Empty placeholder.
861   }
864 # In GYP this is part of test_support_common.
865 source_set("test_support") {
866   testonly = true
868   # Always include this via the main test support target.
869   visibility = [ "//chrome/test:test_support" ]
871   sources = [
872     "browsing_data/mock_browsing_data_appcache_helper.cc",
873     "browsing_data/mock_browsing_data_appcache_helper.h",
874     "browsing_data/mock_browsing_data_channel_id_helper.cc",
875     "browsing_data/mock_browsing_data_channel_id_helper.h",
876     "browsing_data/mock_browsing_data_cookie_helper.cc",
877     "browsing_data/mock_browsing_data_cookie_helper.h",
878     "browsing_data/mock_browsing_data_database_helper.cc",
879     "browsing_data/mock_browsing_data_database_helper.h",
880     "browsing_data/mock_browsing_data_file_system_helper.cc",
881     "browsing_data/mock_browsing_data_file_system_helper.h",
882     "browsing_data/mock_browsing_data_flash_lso_helper.cc",
883     "browsing_data/mock_browsing_data_flash_lso_helper.h",
884     "browsing_data/mock_browsing_data_indexed_db_helper.cc",
885     "browsing_data/mock_browsing_data_indexed_db_helper.h",
886     "browsing_data/mock_browsing_data_local_storage_helper.cc",
887     "browsing_data/mock_browsing_data_local_storage_helper.h",
888     "browsing_data/mock_browsing_data_quota_helper.cc",
889     "browsing_data/mock_browsing_data_quota_helper.h",
890     "browsing_data/mock_browsing_data_service_worker_helper.cc",
891     "browsing_data/mock_browsing_data_service_worker_helper.h",
892     "download/download_test_file_activity_observer.cc",
893     "download/download_test_file_activity_observer.h",
894     "download/test_download_shelf.cc",
895     "download/test_download_shelf.h",
896     "invalidation/fake_invalidation_service.cc",
897     "invalidation/fake_invalidation_service.h",
898     "media/fake_desktop_media_list.cc",
899     "media/fake_desktop_media_list.h",
900     "net/dns_probe_test_util.cc",
901     "net/dns_probe_test_util.h",
902     "net/url_request_mock_util.cc",
903     "net/url_request_mock_util.h",
904     "notifications/notification_test_util.cc",
905     "notifications/notification_test_util.h",
906     "password_manager/mock_password_store_service.cc",
907     "password_manager/mock_password_store_service.h",
908     "password_manager/null_password_store_service.cc",
909     "password_manager/null_password_store_service.h",
910     "password_manager/test_password_store_service.cc",
911     "password_manager/test_password_store_service.h",
912     "prefs/pref_service_mock_factory.cc",
913     "prefs/pref_service_mock_factory.h",
914     "profile_resetter/profile_resetter_test_base.cc",
915     "profile_resetter/profile_resetter_test_base.h",
916     "search_engines/template_url_service_factory_test_util.cc",
917     "search_engines/template_url_service_factory_test_util.h",
918     "search_engines/template_url_service_test_util.cc",
919     "search_engines/template_url_service_test_util.h",
920     "sessions/session_restore_test_helper.cc",
921     "sessions/session_restore_test_helper.h",
922     "sessions/session_service_test_helper.cc",
923     "sessions/session_service_test_helper.h",
924     "signin/fake_account_reconcilor.cc",
925     "signin/fake_account_reconcilor.h",
926     "signin/fake_account_tracker_service.cc",
927     "signin/fake_account_tracker_service.h",
928     "signin/fake_profile_oauth2_token_service.cc",
929     "signin/fake_profile_oauth2_token_service.h",
930     "signin/fake_profile_oauth2_token_service_builder.cc",
931     "signin/fake_profile_oauth2_token_service_builder.h",
932     "signin/fake_signin_manager.cc",
933     "signin/fake_signin_manager.h",
934     "ssl/ssl_client_auth_requestor_mock.cc",
935     "ssl/ssl_client_auth_requestor_mock.h",
936     "sync/profile_sync_components_factory_mock.cc",
937     "sync/profile_sync_components_factory_mock.h",
938     "sync/profile_sync_service_mock.cc",
939     "sync/profile_sync_service_mock.h",
940     "ui/webui/signin/login_ui_test_utils.cc",
941     "ui/webui/signin/login_ui_test_utils.h",
942   ]
944   public_deps = [
945     ":browser",
946     "//chrome/browser/ui:test_support",
947   ]
948   deps = [
949     "//base:prefs_test_support",
950     "//chrome/browser",
951     "//chrome/common",
952     "//chrome/common/safe_browsing:proto",
953     "//components/invalidation",
954     "//components/invalidation:test_support",
955     "//components/password_manager/core/browser:test_support",
956     "//components/search_engines:test_support",
957     "//content/test:test_support",
958     "//chrome/app/theme:theme_resources",
959     "//net:test_support",
960     "//skia",
961     "//testing/gmock",
962     "//testing/gtest",
963     "//ui/gfx",
964   ]
966   if (!is_ios) {
967     deps += [
968       "//components/sessions:test_support",
969       "//google_apis:test_support",
970     ]
971   }
973   if (enable_extensions) {
974     sources += [
975       "extensions/extension_action_test_util.cc",
976       "extensions/extension_action_test_util.h",
977     ]
978     deps += [ "//extensions:test_support" ]
979   }
981   if (is_chromeos) {
982     sources += [
983       "chromeos/app_mode/fake_cws.cc",
984       "chromeos/app_mode/fake_cws.h",
985       "chromeos/file_manager/fake_disk_mount_manager.cc",
986       "chromeos/file_manager/fake_disk_mount_manager.h",
987       "chromeos/input_method/mock_candidate_window_controller.cc",
988       "chromeos/input_method/mock_candidate_window_controller.h",
989       "chromeos/input_method/mock_input_method_engine.cc",
990       "chromeos/input_method/mock_input_method_engine.h",
991       "chromeos/input_method/mock_input_method_manager.cc",
992       "chromeos/input_method/mock_input_method_manager.h",
993       "chromeos/login/screens/mock_device_disabled_screen_actor.cc",
994       "chromeos/login/screens/mock_device_disabled_screen_actor.h",
995       "chromeos/login/session/user_session_manager_test_api.cc",
996       "chromeos/login/session/user_session_manager_test_api.h",
997       "chromeos/login/test/js_checker.cc",
998       "chromeos/login/test/js_checker.h",
999       "chromeos/login/test/oobe_screen_waiter.cc",
1000       "chromeos/login/test/oobe_screen_waiter.h",
1001       "chromeos/login/ui/mock_login_display.cc",
1002       "chromeos/login/ui/mock_login_display.h",
1003       "chromeos/login/ui/mock_login_display_host.cc",
1004       "chromeos/login/ui/mock_login_display_host.h",
1005       "chromeos/login/users/avatar/mock_user_image_manager.cc",
1006       "chromeos/login/users/avatar/mock_user_image_manager.h",
1007       "chromeos/login/users/fake_chrome_user_manager.cc",
1008       "chromeos/login/users/fake_chrome_user_manager.h",
1009       "chromeos/login/users/fake_supervised_user_manager.cc",
1010       "chromeos/login/users/fake_supervised_user_manager.h",
1011       "chromeos/login/users/mock_user_manager.cc",
1012       "chromeos/login/users/mock_user_manager.h",
1013       "chromeos/net/network_portal_detector_test_utils.cc",
1014       "chromeos/net/network_portal_detector_test_utils.h",
1015       "chromeos/policy/cloud_external_data_manager_base_test_util.cc",
1016       "chromeos/policy/cloud_external_data_manager_base_test_util.h",
1017       "chromeos/policy/device_policy_builder.cc",
1018       "chromeos/policy/device_policy_builder.h",
1019       "chromeos/policy/fake_consumer_management_service.cc",
1020       "chromeos/policy/fake_consumer_management_service.h",
1021       "chromeos/policy/fake_device_cloud_policy_initializer.cc",
1022       "chromeos/policy/fake_device_cloud_policy_initializer.h",
1023       "chromeos/policy/fake_device_cloud_policy_manager.cc",
1024       "chromeos/policy/fake_device_cloud_policy_manager.h",
1025       "chromeos/policy/stub_enterprise_install_attributes.cc",
1026       "chromeos/policy/stub_enterprise_install_attributes.h",
1027       "chromeos/settings/device_settings_test_helper.cc",
1028       "chromeos/settings/device_settings_test_helper.h",
1029       "chromeos/system/fake_input_device_settings.cc",
1030       "chromeos/system/fake_input_device_settings.h",
1031     ]
1032     configs += [ "//build/config/linux:dbus" ]
1033     deps += [ "//chromeos:test_support" ]
1034   }
1036   if (enable_configuration_policy) {
1037     sources += [
1038       "policy/test/local_policy_test_server.cc",
1039       "policy/test/local_policy_test_server.h",
1040     ]
1041     public_deps += [
1042       "//components/policy:policy_component_test_support",
1043       "//components/policy:test_support",
1044     ]
1045   }
1047   if (safe_browsing_mode == 1) {
1048     sources += [
1049       "extensions/fake_safe_browsing_database_manager.cc",
1050       "extensions/fake_safe_browsing_database_manager.h",
1051     ]
1052   }
1054   if (enable_extensions) {
1055     sources += [
1056       "drive/dummy_drive_service.cc",
1057       "drive/dummy_drive_service.h",
1058       "drive/fake_drive_service.cc",
1059       "drive/fake_drive_service.h",
1060       "drive/test_util.cc",
1061       "drive/test_util.h",
1062       "extensions/api/messaging/native_messaging_test_util.cc",
1063       "extensions/api/messaging/native_messaging_test_util.h",
1064       "extensions/extension_notification_observer.cc",
1065       "extensions/extension_notification_observer.h",
1066       "extensions/mock_extension_special_storage_policy.cc",
1067       "extensions/mock_extension_special_storage_policy.h",
1068       "extensions/test_blacklist.cc",
1069       "extensions/test_blacklist.h",
1070       "extensions/test_blacklist_state_fetcher.cc",
1071       "extensions/test_blacklist_state_fetcher.h",
1072       "extensions/test_extension_dir.cc",
1073       "extensions/test_extension_dir.h",
1074       "extensions/test_extension_environment.cc",
1075       "extensions/test_extension_environment.h",
1076       "extensions/test_extension_prefs.cc",
1077       "extensions/test_extension_prefs.h",
1078       "extensions/test_extension_service.cc",
1079       "extensions/test_extension_service.h",
1080       "extensions/test_extension_system.cc",
1081       "extensions/test_extension_system.h",
1082       "media_galleries/media_galleries_test_util.cc",
1083       "media_galleries/media_galleries_test_util.h",
1084     ]
1085     deps += [ "//components/storage_monitor:test_support" ]
1086   }
1088   if (enable_mdns) {
1089     sources += [
1090       "local_discovery/test_service_discovery_client.cc",
1091       "local_discovery/test_service_discovery_client.h",
1092     ]
1093   }
1095   if (enable_app_list) {
1096     sources += [
1097       "ui/app_list/test/chrome_app_list_test_support.cc",
1098       "ui/app_list/test/chrome_app_list_test_support.h",
1099       "ui/app_list/test/test_app_list_controller_delegate.cc",
1100       "ui/app_list/test/test_app_list_controller_delegate.h",
1101     ]
1102   }
1104   if (enable_wifi_bootstrapping) {
1105     sources += [
1106       "local_discovery/wifi/mock_wifi_manager.cc",
1107       "local_discovery/wifi/mock_wifi_manager.h",
1108     ]
1109   }