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