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