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