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