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