Fix sorting issues in chrome_browser.gypi restructuring
[chromium-blink-merge.git] / chrome / browser / BUILD.gn
blob9c14c8fd425ad9ec096d876b7a9a73ee6428eba2
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")
8 import("//components/nacl/nacl_defines.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(
25     "//build/gypi_to_gn.py",
26     [ rebase_path("../chrome_browser.gypi") ],
27     "scope",
28     [ "../chrome_browser.gypi" ])
30 if (is_desktop_linux) {
31   pkg_config("gnome_keyring") {
32     packages = [ "gnome-keyring-1" ]
33   }
36 static_library("browser") {
37   configs += [
38     "//build/config/compiler:wexit_time_destructors",
39     "//third_party/WebKit/public:debug_devtools",
40   ]
41   defines = []
42   sources = []
43   libs = []
44   ldflags = []
46   # iOS/non-iOS shared deps. New dependencies should generally be added in the
47   # non-iOS deps below.
48   public_deps = [
49     "//components/autofill/core/browser",
50     "//content/public/browser",
51     "//sql",
52     "//sync",
53   ]
54   deps = [
55     "//base/allocator",
56     "//chrome:extra_resources",
57     "//chrome:resources",
58     "//chrome:strings",
59     "//chrome/app:generated_resources_map",
60     "//chrome/app/resources:platform_locale_settings",
61     "//chrome/app/theme:theme_resources",
62     "//chrome/browser/history:in_memory_url_index_cache_proto",
63     "//chrome/browser/net:cert_logger_proto",
64     "//chrome/browser/net:probe_message_proto",
65     "//chrome/browser/ui",
66     "//chrome/common",
67     "//chrome/common/net",
68     "//components/autofill/core/browser",
69     "//components/bookmarks/browser",
70     "//components/captive_portal",
71     "//components/cloud_devices/common",
72     "//components/component_updater",
73     "//components/content_settings/core/browser",
74     "//components/content_settings/core/common",
75     "//components/crx_file",
76     "//components/data_reduction_proxy/core/browser",
77     "//components/domain_reliability",
78     "//components/enhanced_bookmarks",
79     "//components/favicon_base",
80     "//components/favicon/core",
81     "//components/feedback",
82     "//components/gcm_driver",
83     "//components/google/core/browser",
84     "//components/handoff",
85     "//components/history/core/browser",
86     "//components/history/core/common",
87     "//components/infobars/core",
88     "//components/invalidation",
89     "//components/metrics:gpu",
90     "//components/metrics:net",
91     "//components/metrics:profiler",
92     "//components/metrics/proto:proto",
93     "//components/navigation_metrics",
94     "//components/network_time",
95     "//components/omaha_client",
96     "//components/omnibox",
97     "//components/os_crypt",
98     "//components/password_manager/core/browser",
99     "//components/password_manager/core/common",
100     "//components/policy:policy_component",
101     "//components/precache/core",
102     "//components/query_parser",
103     "//components/rappor",
104     "//components/renderer_context_menu",
105     "//components/search",
106     "//components/search_engines",
107     "//components/search_provider_logos",
108     "//components/signin/core/browser",
109     "//components/startup_metric_utils",
110     "//components/strings",
111     "//components/suggestions",
112     "//components/sync_driver",
113     "//components/translate/core/browser",
114     "//components/translate/core/common",
115     "//components/url_fixer",
116     "//components/user_prefs",
117     "//components/variations",
118     "//components/variations/net",
119     "//components/webdata/common",
120     "//content/public/browser",
121     "//content/public/common",
122     "//courgette:courgette_lib",
123     "//crypto",
124     "//google_apis",
125     "//gpu/config",
126     "//jingle:notifier",
127     "//skia",
128     "//sql",
129     "//sync",
130     "//third_party/cacheinvalidation",
131     "//third_party/icu",
132     "//third_party/libxml",
133     "//third_party/libjingle",
134     "//third_party/widevine/cdm:version_h",
135     "//third_party/zlib",
136     "//third_party/zlib:minizip",
137     "//third_party/zlib:zip",
138     "//ui/base",
139     "//ui/events:events_base",
140     "//ui/gfx",
141     "//ui/gfx/geometry",
142     "//ui/message_center",
143     "//ui/shell_dialogs",
144     "//ui/strings",
145     "//ui/resources",
146   ]
148   sources += rebase_path(gypi_values.chrome_browser_undo_sources,
149                          ".", "//chrome")
151   if (!is_ios) {
152     sources += rebase_path(gypi_values.chrome_browser_non_ios_sources,
153                            ".", "//chrome")
154     sources += rebase_path(gypi_values.chrome_browser_autocomplete_sources,
155                            ".", "//chrome")
156     sources += rebase_path(gypi_values.chrome_browser_bookmark_sources,
157                            ".", "//chrome")
158     sources += rebase_path(gypi_values.chrome_browser_favicon_sources,
159                            ".", "//chrome")
160     sources += rebase_path(gypi_values.chrome_browser_google_sources,
161                            ".", "//chrome")
162     sources += rebase_path(gypi_values.chrome_browser_history_sources,
163                            ".", "//chrome")
164     sources += rebase_path(gypi_values.chrome_browser_metrics_sources,
165                            ".", "//chrome")
166     sources += rebase_path(gypi_values.chrome_browser_net_sources,
167                            ".", "//chrome")
168     sources += rebase_path(gypi_values.chrome_browser_password_manager_sources,
169                            ".", "//chrome")
170     sources += rebase_path(gypi_values.chrome_browser_predictor_sources,
171                            ".", "//chrome")
172     sources += rebase_path(gypi_values.chrome_browser_pref_sources,
173                            ".", "//chrome")
174     sources += rebase_path(gypi_values.chrome_browser_profiles_sources,
175                            ".", "//chrome")
176     sources += rebase_path(gypi_values.chrome_browser_search_engines_sources,
177                            ".", "//chrome")
178     sources += rebase_path(gypi_values.chrome_browser_services_sources,
179                            ".", "//chrome")
180     sources += rebase_path(gypi_values.chrome_browser_signin_sources,
181                            ".", "//chrome")
182     sources += rebase_path(gypi_values.chrome_browser_sync_sources,
183                            ".", "//chrome")
184     sources += rebase_path(gypi_values.chrome_browser_web_resource_sources,
185                            ".", "//chrome")
186     #TODO(GYP) Add these sources:
187     #        # These files are generated by GRIT.
188     #        '<(grit_out_dir)/grit/component_extension_resources_map.cc',
189     #        '<(grit_out_dir)/grit/theme_resources_map.cc',
190     #        '<(SHARED_INTERMEDIATE_DIR)/ui/resources/grit/ui_resources_map.cc',
191     #
192     #        # This file is generated by
193     #        # chrome/browser/metrics/variations/generate_resources_map.py
194     #        '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/metrics/variations/generated_resources_map.cc',
196     defines = nacl_defines
198     deps += [
199       "//apps",
200       "//cc",
201       "//chrome/browser/devtools",
202       "//chrome/installer/util",
203       "//components/app_modal_dialogs",
204       "//components/autofill/content/browser",
205       "//components/dom_distiller/content",
206       "//components/keyed_service/content",
207       "//components/navigation_interception",
208       "//components/password_manager/content/browser",
209       "//components/precache/content",
210       "//components/sessions:sessions_content",
211       "//components/storage_monitor",
212       "//components/translate/content/browser",
213       "//components/url_matcher",
214       "//components/visitedlink/browser",
215       "//components/visitedlink/common",
216       "//components/web_cache/browser",
217       "//components/web_modal",
218       "//content/app/resources",
219       "//media",
220       "//media/cast:net",
221       "//mojo/common",
222       "//mojo/edk/system",
223       "//mojo/environment:chromium",
224       "//mojo/public/cpp/bindings",
225       "//mojo/public/js",
226       "//net:extras",
227       "//net:net_with_v8",
228       "//storage/browser",
229       "//storage/common",
230       "//third_party/WebKit/public:resources",
231       "//third_party/expat",
232       "//third_party/leveldatabase",
233       "//third_party/libaddressinput",
234       "//third_party/libyuv",
235       "//third_party/npapi",
236       "//third_party/re2",
237       "//third_party/smhasher:cityhash",
238       "//third_party/webrtc/modules/desktop_capture",
239       "//ui/gl",
240       "//ui/surface",
241       "//ui/web_dialogs",
242       "//v8",
243       ## TODO(tonyg): Remove this dependency (crbug.com/280157).
244       #"../testing/perf/perf_test.gyp:*",  TODO(GYP)
245     ]
246   } else {  # iOS
247     sources += rebase_path(gypi_values.chrome_browser_ios_sources,
248                           ".", "//chrome")
249     sources += rebase_path(gypi_values.chrome_browser_google_sources,
250                           ".", "//chrome")
251     deps += [
252       "//net",
253     ]
254     libs += [
255       "CoreTelephony.framework",
256       "CoreText.framework",
257       "MobileCoreServices.framework",
258       "QuartzCore.framework",
259     ]
260     ldflags += [ "-weak_framework", "CoreImage" ]
261   }
263   if (is_win || is_mac) {
264     sources += rebase_path(gypi_values.chrome_browser_win_mac_sources,
265                            ".", "//chrome")
266   }
267   if (!is_android && !is_ios && !is_chromeos && enable_configuration_policy) {
268     sources += [
269       "net/disk_cache_dir_policy_handler.cc",
270       "net/disk_cache_dir_policy_handler.h",
271     ]
272   }
273   if (!is_android && !is_ios && enable_configuration_policy) {
274     sources += [
275       "download/download_dir_policy_handler.cc",
276       "download/download_dir_policy_handler.h",
277     ]
278   }
279   if (is_mac) {
280     sources += rebase_path(gypi_values.chrome_browser_mac_sources,
281                            ".", "//chrome")
282     deps += [
283       #"app_shim"  TODO(GYP)
284       #"browser_app_shim"  TODO(GYP)
285     ]
286   }
287   if (enable_extensions) {
288     public_deps += [ "//chrome/browser/extensions" ]
289     deps += [
290       "//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto",
291       "//chrome/common/extensions/api",
292       "//chrome/common/extensions/api:api_registration",
293       "//extensions/components/javascript_dialog_extensions_client",
294     ]
295     sources += rebase_path(gypi_values.chrome_browser_extensions_sources,
296                            ".", "//chrome")
297   }
298   if (enable_background) {
299     sources += rebase_path(gypi_values.chrome_browser_background_sources,
300                            ".", "//chrome")
301     if (!use_aura || is_win || is_chromeos) {
302       sources -= [ "background/background_mode_manager_aura.cc" ]
303     }
304     defines += [ "ENABLE_BACKGROUND=1" ]
305   }
306   if (enable_task_manager) {
307     sources += rebase_path(gypi_values.chrome_browser_task_manager_sources,
308                            ".", "//chrome")
309   }
310   if (enable_spellcheck) {
311     sources += rebase_path(gypi_values.chrome_browser_spellchecker_sources,
312                            ".", "//chrome")
313     deps += [ "//third_party/hunspell" ]
314   }
315   if (enable_nacl) {
316     sources += rebase_path(gypi_values.chrome_browser_nacl_sources,
317                            ".", "//chrome")
318     #deps += [ "//components/nacl:nacl_browser" ]  TODO(GYP)
319   }
321   if (enable_configuration_policy) {
322     sources += rebase_path(
323         gypi_values.chrome_browser_policy_shared_with_ios_sources,
324         ".", "//chrome")
325     deps += [
326       "//components/policy",
327       "//components/policy/proto",
328     ]
329     if (!is_ios) {
330       sources += rebase_path(
331           gypi_values.chrome_browser_policy_non_ios_sources,
332           ".", "//chrome")
333     }
334     if (!is_chromeos) {
335       sources += rebase_path(
336           gypi_values.chrome_browser_policy_shared_with_ios_not_chromeos_sources,
337           ".", "//chrome")
338     }
339     if (is_win || is_mac || is_desktop_linux) {
340       sources += rebase_path(gypi_values.chrome_browser_policy_desktop_sources,
341                              ".", "//chrome")
342     }
343     if (is_android || is_ios) {
344       sources += rebase_path(gypi_values.chrome_browser_policy_mobile_sources,
345                              ".", "//chrome")
346     } else {
347       deps += [
348         "//chrome/browser/policy:path_parser",
349       ]
350     }
351   } else {
352     # Configuration policy disabled.
353     sources += rebase_path(gypi_values.chrome_browser_policy_disabled_sources,
354                            ".", "//chrome")
355   }
357   if (enable_plugins) {
358     sources += rebase_path(gypi_values.chrome_browser_plugins_sources,
359                            ".", "//chrome")
360     deps += [
361       "//components/pdf/browser",
362       "//ppapi:ppapi_ipc",
363       "//third_party/adobe/flash:flapper_version_h",
364     ]
365   }
366   if (safe_browsing_mode != 0) {
367     sources += rebase_path(
368         gypi_values.chrome_browser_basic_safe_browsing_sources,
369         ".", "//chrome")
370     deps += [
371       "//chrome/browser/safe_browsing:chunk_proto",
372       "//chrome/browser/safe_browsing:metadata_proto",
373       "//chrome/browser/safe_browsing:report_proto",
374     ]
375     if (safe_browsing_mode == 1) {
376       sources += rebase_path(
377           gypi_values.chrome_browser_full_safe_browsing_sources,
378           ".", "//chrome")
379       defines += [ "FULL_SAFE_BROWSING" ]
380       deps += [
381         "//chrome/common/safe_browsing:proto",
382       ]
383     } else if (safe_browsing_mode == 2) {
384       defines += [ "MOBILE_SAFE_BROWSING" ]
385     }
386   }
388   if (is_linux) {
389     configs += [ "//build/config/linux:udev" ]
390     deps += [ "//device/media_transfer_protocol" ]
391   }
392   if (is_linux && !is_chromeos) {
393     deps += [ "//third_party/speech-dispatcher" ]
394   }
396   if (is_chromeos) {
397     sources += rebase_path(gypi_values.chrome_browser_chromeos_sources,
398                            ".", "//chrome")
399     deps += [
400       "//chrome/browser/chromeos",
401     ]
402   } else {
403     # Non-ChromeOS.
404     sources += rebase_path(gypi_values.chrome_browser_non_chromeos_sources,
405                            ".", "//chrome")
406   }
408   if (is_chromeos || is_ios) {
409     sources -= [
410       "metrics/signin_status_metrics_provider.cc",
411       "metrics/signin_status_metrics_provider.h",
412     ]
413   }
415   if (use_cups) {
416     configs += [ "//printing:cups" ]
417   }
418   if (is_desktop_linux) {
419     sources += rebase_path(gypi_values.chrome_browser_gnome_keyring_sources,
420                            ".", "//chrome")
421     configs += [ ":gnome_keyring" ]
422   }
423   if (use_aura) {
424     sources += rebase_path(gypi_values.chrome_browser_aura_sources,
425                            ".", "//chrome")
426     deps += [
427       "//ui/aura",
428       "//ui/compositor",
429       "//ui/keyboard",
430     ]
431   }
432   if (ui_compositor_image_transport) {
433     deps += [ "//ui/gl" ]
434   }
436   if (use_ash) {
437     sources += rebase_path(gypi_values.chrome_browser_ash_sources,
438                            ".", "//chrome")
439   }
441   if (use_x11) {
442     sources += rebase_path(gypi_values.chrome_browser_x11_sources,
443                            ".", "//chrome")
444     if (!is_chromeos) {
445       configs += [ "//build/config/linux:xscrnsaver" ]
446     }
447   }
448   if (is_posix && !is_mac && !is_ios) {
449     sources += [
450       "//chrome/app/chrome_crash_reporter_client.cc",
451       "//chrome/app/chrome_crash_reporter_client.h",
452     ]
453     deps += [
454       "//components/crash/app",
455       "//components/crash/browser",
456     ]
457   }
458   if (use_nss_certs) {
459     sources += rebase_path(gypi_values.chrome_browser_nss_sources,
460                            ".", "//chrome")
461     if (is_chromeos) {
462       sources -= [ "net/nss_context_linux.cc" ]
463     }
464   }
465   if (enable_notifications) {
466     sources += rebase_path(gypi_values.chrome_browser_notifications_sources,
467                            ".", "//chrome")
468     if (!is_android) {
469       sources += rebase_path(
470           gypi_values.chrome_browser_non_android_notifications_sources,
471           ".", "//chrome")
472     }
473   }
474   if (enable_themes) {
475     sources += rebase_path(gypi_values.chrome_browser_themes_sources,
476                            ".", "//chrome")
477   }
479   if (enable_basic_printing || enable_print_preview) {
480     # Some form of printing support.
481     sources += rebase_path(gypi_values.chrome_browser_basic_printing_sources,
482                            ".", "//chrome")
483     deps += [
484       "//printing",
485     ]
486     if (is_win) {
487       sources += rebase_path(gypi_values.chrome_browser_printing_emf_sources,
488                              ".", "//chrome")
489     }
490     if (enable_print_preview) {
491       # Full printing on top of the above.
492       sources += rebase_path(gypi_values.chrome_browser_full_printing_sources,
493                              ".", "//chrome")
494     } else {
495       # Partial-only printing support.
496       sources += rebase_path(
497           gypi_values.chrome_browser_basic_only_printing_sources,
498           ".", "//chrome")
499     }
500   }
501   if (enable_captive_portal_detection) {
502     sources += rebase_path(gypi_values.chrome_browser_captive_portal_sources,
503                            ".", "//chrome")
504   }
505   if (enable_session_service) {
506     sources += rebase_path(gypi_values.chrome_browser_session_service_sources,
507                            ".", "//chrome")
508   }
510   if (!is_android && !is_ios && !is_chromeos) {
511     sources += rebase_path(gypi_values.chrome_browser_desktop_sources,
512                            ".", "//chrome")
513   }
515   if (is_android || is_ios) {
516     # Mobile.
517     sources += rebase_path(gypi_values.chrome_browser_mobile_sources,
518                            ".", "//chrome")
519   } else {
520     # Non-mobile.
521     sources += rebase_path(gypi_values.chrome_browser_non_mobile_sources,
522                            ".", "//chrome")
523     deps += [
524       "//device/core",
525       "//device/usb",
526     ]
527   }
529   if (is_android) {
530     sources += rebase_path(gypi_values.chrome_browser_android_sources,
531                            ".", "//chrome")
532     deps += [
533       ":jni_headers",
534       "//components/cdm/browser",
535       "//components/enhanced_bookmarks",
536       "//components/history/core/android",
537       "//components/resources:components_resources",
538       "//components/web_contents_delegate_android",
539       "//third_party/android_opengl/etc1",
540     ]
541     deps -= [
542       "//third_party/libaddressinput",
543       "//components/feedback",
544       "//components/storage_monitor",
545       "//components/web_modal",
546     ]
547   } else {
548     sources += rebase_path(gypi_values.chrome_browser_non_android_sources,
549                            ".", "//chrome")
550   }
552   if (is_mac) {
553     deps += [
554       "//third_party/google_toolbox_for_mac",
555       #"../third_party/mozilla/mozilla.gyp:mozilla",  TODO(GYP)
556     ]
557     libs += [
558       "Accelerate.framework",
559       "AddressBook.framework",
560       "AudioUnit.framework",
561       "DiskArbitration.framework",
562       "IOKit.framework",
563       "ImageCaptureCore.framework",
564       "OpenGL.framework",
565       "QuartzCore.framework",
566       "SecurityInterface.framework",
567     ]
568   }
570   if (enable_rlz) {
571     sources += rebase_path(gypi_values.chrome_browser_rlz_sources,
572                            ".", "//chrome")
573     deps += [ "//rlz:rlz_lib" ]
574   }
576   # TODO(GYP)
577   # Temporary fix to break the browser target into smaller chunks so it
578   # will link with goma builds.
579   #["OS=="win" and chromium_win_pch==0", {
580   #  "msvs_shard": 4,
581   #}],
583   if (is_win) {
584     sources += rebase_path(gypi_values.chrome_browser_win_sources,
585                            ".", "//chrome")
586     if (!is_chrome_branded) {
587       sources -= [
588         "google/did_run_updater_win.cc",
589         "google/did_run_updater_win.h",
590       ]
591     }
592     public_deps += [
593       "//ui/views",
594       "//ui/views/controls/webview",
595     ]
596     deps += [
597       "//chrome:version_header",
598       "//chrome/installer/util:strings",
599       "//third_party/iaccessible2",
600       "//third_party/isimpledom",
601       "//third_party/wtl",
602       #"chrome_process_finder",  TODO(GYP)
603       #"../chrome_elf/chrome_elf.gyp:chrome_elf",  TODO(GYP)
604       #"../chrome_elf/chrome_elf.gyp:chrome_elf_constants",  TODO(GYP)
605       #"../chrome_elf/chrome_elf.gyp:dll_hash",  TODO(GYP)
606       #"../google_update/google_update.gyp:google_update",  TODO(GYP)
607       #"../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages",  TODO(GYP)
608       #"../win8/win8.gyp:metro_viewer",  TODO(GYP)
609     ]
610   } else {
611     # Non-Windows.
612     sources += rebase_path(gypi_values.chrome_browser_non_win_sources,
613                            ".", "//chrome")
614     if (toolkit_views) {
615       deps += [
616       "//ui/views",
617       "//ui/views/controls/webview",
618       ]
619       # TODO(GYP) why is this needed? Very susicious.
620       #  "include_dirs": [
621       #    "<(INTERMEDIATE_DIR)/chrome",
622       #  ],
623     }
624   }
626   if (is_linux) {
627     sources += rebase_path(gypi_values.chrome_browser_linux_sources,
628                            ".", "//chrome")
629     if (use_aura) {
630       configs += [
631         "//build/config/linux:dbus",
632         "//build/config/linux:fontconfig",
633       ]
634       deps += [
635         "//dbus",
636       ]
637     }
638     if (use_x11) {
639       configs += [ "//build/config/linux:x11" ]
640       deps += [ "//ui/gfx/x" ]
641     }
642   }
644   if (is_desktop_linux) {
645     sources += rebase_path(gypi_values.chrome_browser_desktop_linux_sources,
646                            ".", "//chrome")
647   }
648   if (enable_plugin_installation) {
649     sources += rebase_path(
650         gypi_values.chrome_browser_plugin_installation_sources,
651         ".", "//chrome")
652   }
653   if (enable_app_list) {
654     deps += [
655       "//ui/app_list",
656     ]
657   }
658   if (enable_managed_users) {
659     sources += rebase_path(
660         gypi_values.chrome_browser_supervised_user_sources,
661         ".", "//chrome")
662   }
663   if (enable_managed_users && enable_themes) {
664     sources += rebase_path(
665         gypi_values.chrome_browser_supervised_user_and_themes_sources,
666         ".", "//chrome")
667   }
668   if (enable_webrtc) {
669     sources += rebase_path(
670         gypi_values.chrome_browser_webrtc_sources,
671         ".", "//chrome")
672   }
673   if (enable_service_discovery) {
674     sources += rebase_path(
675         gypi_values.chrome_browser_service_discovery_sources,
676         ".", "//chrome")
677   }
678   if (enable_mdns) {
679     sources += rebase_path(
680         gypi_values.chrome_browser_mdns_sources,
681         ".", "//chrome")
682   }
683   if (!enable_autofill_dialog || is_android || is_ios) {
684     sources -= [
685       "autofill/validation_rules_storage_factory.cc",
686       "autofill/validation_rules_storage_factory.h",
687     ]
688   }
689   if (enable_wifi_bootstrapping) {
690     sources += rebase_path(
691         gypi_values.chrome_browser_wifi_bootstrapping_sources,
692         ".", "//chrome")
693     if (is_win || is_mac) {
694       # TODO(brettw) as of this writing wifi bootstrapping is set on Windows
695       # and Mac, so this test is meaningless. Can we merge these lists?
696       sources += rebase_path(
697           gypi_values.chrome_browser_win_mac_wifi_bootstrapping_sources,
698           ".", "//chrome")
699     }
700   }
703 if (is_android) {
704   # GYP version: chrome/chrome_browser.gypi:chrome_browser_jni_headers
705   generate_jni("jni_headers") {
706     sources = rebase_path(
707         gypi_values.chrome_browser_jni_sources, ".", "//chrome")
708     jni_package = "chrome"
709   }
712 # GYP version: chrome/chrome_resources.gyp:chrome_resources
713 # (generate_browser_resources action)
714 grit("resources") {
715   source = "browser_resources.grd"
716   output_dir = "$root_gen_dir/chrome"
717   outputs = [
718     "grit/browser_resources.h",
719     "browser_resources.pak",
720   ]
722   omnibox_mojom_file = "$root_gen_dir/chrome/browser/ui/webui/omnibox/omnibox.mojom.js"
724   grit_flags = [
725     "-E", "about_credits_file=" +
726           rebase_path(about_credits_file, root_build_dir),
727     "-E", "additional_modules_list_file=" +
728           rebase_path(additional_modules_list_file, root_build_dir),
729     "-E", "omnibox_mojom_file=" +
730           rebase_path(omnibox_mojom_file, root_build_dir),
731   ]
733   deps = [
734     ":about_credits",
735     ":chrome_internal_resources_gen",
736     "//chrome/browser/ui/webui/omnibox:mojo_bindings",
737     "//mojo/environment:chromium",
738   ]
741 # GYP version: chrome/chrome_resource.gyp:about_credits
742 action("about_credits") {
743   script = "//tools/licenses.py"
745   # TODO(phajdan.jr): input dependencies so this can be regenerated
746   # automatically when one of the credits changes. The way this should work is
747   # that licenses.py should write a .d file listing the input dependencies (see
748   # "depfile" in GN).
749   outputs = [ about_credits_file ]
751   args = [
752     "credits",
753     rebase_path(about_credits_file, root_build_dir),
754   ]
757 # GYP version: chrome/chrome_resource.gyp:chrome_internal_resources_gen
758 if (is_chrome_branded) {
759   action("chrome_internal_resources_gen") {
760     script = "internal/transform_additional_modules_list.py"
761     sources = [ "internal/resources/additional_modules_list.input" ]
762     outputs = [ additional_modules_list_file ]
763     args = rebase_path(sources, root_build_dir) +
764            rebase_path(outputs, root_build_dir)
765   }
766 } else {
767   group("chrome_internal_resources_gen") {
768     # Empty placeholder.
769   }
772 # In GYP this is part of test_support_common.
773 source_set("test_support") {
774   testonly = true
776   # Always include this via the main test support target.
777   visibility = [ "//chrome/test:test_support" ]
779   sources = [
780     "browsing_data/mock_browsing_data_appcache_helper.cc",
781     "browsing_data/mock_browsing_data_appcache_helper.h",
782     "browsing_data/mock_browsing_data_channel_id_helper.cc",
783     "browsing_data/mock_browsing_data_channel_id_helper.h",
784     "browsing_data/mock_browsing_data_cookie_helper.cc",
785     "browsing_data/mock_browsing_data_cookie_helper.h",
786     "browsing_data/mock_browsing_data_database_helper.cc",
787     "browsing_data/mock_browsing_data_database_helper.h",
788     "browsing_data/mock_browsing_data_file_system_helper.cc",
789     "browsing_data/mock_browsing_data_file_system_helper.h",
790     "browsing_data/mock_browsing_data_flash_lso_helper.cc",
791     "browsing_data/mock_browsing_data_flash_lso_helper.h",
792     "browsing_data/mock_browsing_data_indexed_db_helper.cc",
793     "browsing_data/mock_browsing_data_indexed_db_helper.h",
794     "browsing_data/mock_browsing_data_local_storage_helper.cc",
795     "browsing_data/mock_browsing_data_local_storage_helper.h",
796     "browsing_data/mock_browsing_data_quota_helper.cc",
797     "browsing_data/mock_browsing_data_quota_helper.h",
798     "browsing_data/mock_browsing_data_service_worker_helper.cc",
799     "browsing_data/mock_browsing_data_service_worker_helper.h",
800     "download/download_test_file_activity_observer.cc",
801     "download/download_test_file_activity_observer.h",
802     "download/test_download_shelf.cc",
803     "download/test_download_shelf.h",
804     "invalidation/fake_invalidation_service.cc",
805     "invalidation/fake_invalidation_service.h",
806     "media/fake_desktop_media_list.cc",
807     "media/fake_desktop_media_list.h",
808     "net/dns_probe_test_util.cc",
809     "net/dns_probe_test_util.h",
810     "net/url_request_mock_util.cc",
811     "net/url_request_mock_util.h",
812     "notifications/notification_test_util.cc",
813     "notifications/notification_test_util.h",
814     "password_manager/mock_password_store_service.cc",
815     "password_manager/mock_password_store_service.h",
816     "password_manager/null_password_store_service.cc",
817     "password_manager/null_password_store_service.h",
818     "password_manager/test_password_store_service.cc",
819     "password_manager/test_password_store_service.h",
820     "prefs/pref_service_mock_factory.cc",
821     "prefs/pref_service_mock_factory.h",
822     "profile_resetter/profile_resetter_test_base.cc",
823     "profile_resetter/profile_resetter_test_base.h",
824     "search_engines/template_url_service_factory_test_util.cc",
825     "search_engines/template_url_service_factory_test_util.h",
826     "search_engines/template_url_service_test_util.cc",
827     "search_engines/template_url_service_test_util.h",
828     "sessions/session_service_test_helper.cc",
829     "sessions/session_service_test_helper.h",
830     "signin/fake_account_reconcilor.cc",
831     "signin/fake_account_reconcilor.h",
832     "signin/fake_account_tracker_service.cc",
833     "signin/fake_account_tracker_service.h",
834     "signin/fake_profile_oauth2_token_service.cc",
835     "signin/fake_profile_oauth2_token_service.h",
836     "signin/fake_profile_oauth2_token_service_builder.cc",
837     "signin/fake_profile_oauth2_token_service_builder.h",
838     "signin/fake_signin_manager.cc",
839     "signin/fake_signin_manager.h",
840     "ssl/ssl_client_auth_requestor_mock.cc",
841     "ssl/ssl_client_auth_requestor_mock.h",
842     "sync/profile_sync_components_factory_mock.cc",
843     "sync/profile_sync_components_factory_mock.h",
844     "sync/profile_sync_service_mock.cc",
845     "sync/profile_sync_service_mock.h",
846   ]
848   public_deps = [
849     ":browser",
850     "//chrome/browser/ui:test_support",
851   ]
852   deps = [
853     "//base:prefs_test_support",
854     "//chrome/browser",
855     "//chrome/common",
856     "//chrome/common/safe_browsing:proto",
857     "//components/invalidation",
858     "//components/invalidation:test_support",
859     "//components/password_manager/core/browser:test_support",
860     "//components/search_engines:test_support",
861     "//content/test:test_support",
862     "//chrome/app/theme:theme_resources",
863     "//net:test_support",
864     "//skia",
865     "//testing/gmock",
866     "//testing/gtest",
867     "//ui/gfx",
868   ]
870   if (!is_ios) {
871     deps += [
872       "//components/sessions:test_support",
873       "//google_apis:test_support",
874     ]
875   }
877   if (enable_extensions) {
878     sources += [
879       "extensions/extension_action_test_util.cc",
880       "extensions/extension_action_test_util.h",
881     ]
882     deps += [
883       "//extensions:test_support",
884     ]
885   }
887   if (is_chromeos) {
888     sources += [
889       "chromeos/app_mode/fake_cws.cc",
890       "chromeos/app_mode/fake_cws.h",
891       "chromeos/file_manager/fake_disk_mount_manager.cc",
892       "chromeos/file_manager/fake_disk_mount_manager.h",
893       "chromeos/input_method/mock_candidate_window_controller.cc",
894       "chromeos/input_method/mock_candidate_window_controller.h",
895       "chromeos/input_method/mock_input_method_engine.cc",
896       "chromeos/input_method/mock_input_method_engine.h",
897       "chromeos/input_method/mock_input_method_manager.cc",
898       "chromeos/input_method/mock_input_method_manager.h",
899       "chromeos/login/fake_login_utils.cc",
900       "chromeos/login/fake_login_utils.h",
901       "chromeos/login/mock_login_utils.cc",
902       "chromeos/login/mock_login_utils.h",
903       "chromeos/login/users/avatar/mock_user_image_manager.cc",
904       "chromeos/login/users/avatar/mock_user_image_manager.h",
905       "chromeos/login/users/fake_supervised_user_manager.cc",
906       "chromeos/login/users/fake_supervised_user_manager.h",
907       "chromeos/login/users/fake_user_manager.cc",
908       "chromeos/login/users/fake_user_manager.h",
909       "chromeos/login/users/mock_user_manager.cc",
910       "chromeos/login/users/mock_user_manager.h",
911       "chromeos/login/test/oobe_screen_waiter.cc",
912       "chromeos/login/test/oobe_screen_waiter.h",
913       "chromeos/login/test/js_checker.cc",
914       "chromeos/login/test/js_checker.h",
915       "chromeos/login/ui/mock_login_display.cc",
916       "chromeos/login/ui/mock_login_display.h",
917       "chromeos/login/ui/mock_login_display_host.cc",
918       "chromeos/login/ui/mock_login_display_host.h",
919       "chromeos/net/network_portal_detector_test_utils.cc",
920       "chromeos/net/network_portal_detector_test_utils.h",
921       "chromeos/policy/cloud_external_data_manager_base_test_util.cc",
922       "chromeos/policy/cloud_external_data_manager_base_test_util.h",
923       "chromeos/policy/device_policy_builder.cc",
924       "chromeos/policy/device_policy_builder.h",
925       "chromeos/policy/fake_device_cloud_policy_initializer.cc",
926       "chromeos/policy/fake_device_cloud_policy_initializer.h",
927       "chromeos/policy/stub_enterprise_install_attributes.cc",
928       "chromeos/policy/stub_enterprise_install_attributes.h",
929       "chromeos/settings/device_settings_test_helper.cc",
930       "chromeos/settings/device_settings_test_helper.h",
931       "chromeos/system/fake_input_device_settings.cc",
932       "chromeos/system/fake_input_device_settings.h",
933     ]
934     configs += [ "//build/config/linux:dbus" ]
935     deps += [ "//chromeos:test_support" ]
936   }
938   if (enable_configuration_policy) {
939     sources += [
940       "policy/test/local_policy_test_server.cc",
941       "policy/test/local_policy_test_server.h",
942     ]
943     public_deps += [
944       "//components/policy:policy_component_test_support",
945       "//components/policy:test_support",
946     ]
947   }
949   if (safe_browsing_mode == 1) {
950     sources += [
951       "extensions/fake_safe_browsing_database_manager.cc",
952       "extensions/fake_safe_browsing_database_manager.h",
953     ]
954   }
956   if (enable_extensions) {
957     sources += [
958       "drive/dummy_drive_service.cc",
959       "drive/dummy_drive_service.h",
960       "drive/fake_drive_service.cc",
961       "drive/fake_drive_service.h",
962       "drive/test_util.cc",
963       "drive/test_util.h",
964       "extensions/api/messaging/native_messaging_test_util.cc",
965       "extensions/api/messaging/native_messaging_test_util.h",
966       "extensions/extension_notification_observer.cc",
967       "extensions/extension_notification_observer.h",
968       "extensions/mock_extension_special_storage_policy.cc",
969       "extensions/mock_extension_special_storage_policy.h",
970       "extensions/test_blacklist.cc",
971       "extensions/test_blacklist.h",
972       "extensions/test_blacklist_state_fetcher.cc",
973       "extensions/test_blacklist_state_fetcher.h",
974       "extensions/test_extension_environment.cc",
975       "extensions/test_extension_environment.h",
976       "extensions/test_extension_prefs.cc",
977       "extensions/test_extension_prefs.h",
978       "extensions/test_extension_service.cc",
979       "extensions/test_extension_service.h",
980       "extensions/test_extension_system.cc",
981       "extensions/test_extension_system.h",
982       "media_galleries/media_galleries_test_util.cc",
983       "media_galleries/media_galleries_test_util.h",
984     ]
985     deps += [
986       "//components/storage_monitor:test_support",
987     ]
988   }
990   if (enable_mdns) {
991     sources += [
992       "local_discovery/test_service_discovery_client.cc",
993       "local_discovery/test_service_discovery_client.h",
994     ]
995   }
997   if (enable_app_list) {
998     sources += [
999       "ui/app_list/test/chrome_app_list_test_support.cc",
1000       "ui/app_list/test/chrome_app_list_test_support.h",
1001     ]
1002   }
1004   if (enable_wifi_bootstrapping) {
1005     sources += [
1006       "local_discovery/wifi/mock_wifi_manager.cc",
1007       "local_discovery/wifi/mock_wifi_manager.h",
1008     ]
1009   }