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