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