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