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