Roll PDFium 6f34355..bca779d
[chromium-blink-merge.git] / chrome / BUILD.gn
blob711fc3508cc9b3201de161deeb05b9868b2b5896
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/features.gni")
7 import("//build/config/locales.gni")
8 import("//build/config/ui.gni")
9 import("//build/config/win/manifest.gni")
10 import("//chrome/chrome_repack_locales.gni")
11 import("//chrome/version.gni")
13 if (is_android) {
14   import("//build/config/android/rules.gni")
17 if (!is_android) {
18   # TODO(GYP) bug 512599: for Windows need to the the reorder-imports step
19   # which probably means adding another target and renaming this to
20   # chrome_initial like in GYP.
21   executable("chrome") {
22     # Because the sources list varies so significantly per-platform, generally
23     # each platform lists its own files rather than relying on filtering or
24     # removing unused files.
25     sources = [
26       "app/chrome_exe_resource.h",
27     ]
28     defines = []
29     public_deps = []
30     deps = [
31       "//build/config/sanitizers:deps",
32     ]
34     data = [
35       "$root_out_dir/resources.pak",
36     ]
37     if (is_linux || is_win) {
38       data += [
39         "$root_out_dir/chrome_100_percent.pak",
40         "$root_out_dir/locales/en-US.pak",
41         "$root_out_dir/locales/fr.pak",
42       ]
43     }
44     if (enable_nacl) {
45       if (is_win || (is_linux && target_cpu == "x64")) {
46         data += [
47           # TODO(GYP): Enable this when the IRT is in the right location.
48           # "$root_out_dir/nacl_irt_x86_64.nexe"
49         ]
50       } else if (is_linux && target_cpu == "arm") {
51         data += [
52           # TODO(GYP): same comment
53           # "$root_out_dir/nacl_irt_arm.nexe"
54         ]
55       }
56     }
58     data_deps = []
60     # TODO(GYP) mac_bundle_resources, xcode_settings
62     if (is_win) {
63       sources += [
64         "//content/public/common/content_switches.cc",
65         "//content/public/common/content_switches.h",
66         "app/chrome_crash_reporter_client.cc",
67         "app/chrome_crash_reporter_client.h",
68         "app/chrome_exe.rc",
69         "app/chrome_exe_load_config_win.cc",
70         "app/chrome_exe_main_win.cc",
71         "app/chrome_watcher_client_win.cc",
72         "app/chrome_watcher_client_win.h",
73         "app/chrome_watcher_command_line_win.cc",
74         "app/chrome_watcher_command_line_win.h",
75         "app/client_util.cc",
76         "app/client_util.h",
77         "app/kasko_client.cc",
78         "app/kasko_client.h",
79         "app/signature_validator_win.cc",
80         "app/signature_validator_win.h",
81         "common/crash_keys.cc",
82         "common/crash_keys.h",
83       ]
85       if (is_component_build) {
86         # This is necessary to make content_switches compile without DLL
87         # linkage errors in a component build.
88         defines += [ "COMPILE_CONTENT_STATICALLY" ]
89       }
91       deps += [
92         ":chrome_exe_version",
93         ":image_pre_reader",
94         ":main_dll",
96         # 'chrome_nacl_win64" TODO(GYP) bug 512869
97         # '../win8/delegate_execute/delegate_execute.gyp:*', TODO(GYP) bug 512867
98         # '../win8/metro_driver/metro_driver.gyp:metro_driver', TODO(GYP) bug 512864
99         "//base",
100         "//breakpad:breakpad_handler",
101         "//breakpad:breakpad_sender",
102         "//chrome/app/version_assembly:chrome_exe_manifest",
103         "//chrome/browser:chrome_process_finder",
104         "//chrome/chrome_watcher",
105         "//chrome/chrome_watcher:client",
106         "//chrome/installer/util",
107         "//chrome_elf",
108         "//components/browser_watcher:browser_watcher_client",
109         "//components/crash/content/app",
110         "//components/crash_keys",
111         "//content:startup_helper_win",
112         "//crypto",
113         "//sandbox",
114         "//ui/gfx",
115       ]
116       data_deps = [ "//chrome/app/version_assembly:version_assembly_manifest" ]
118       libs = [
119         "wintrust.lib",
120         "crypt32.lib",
121       ]
122       configs -= [ "//build/config/win:console" ]
123       configs += [ "//build/config/win:windowed" ]
124     } else if (use_aura) {
125       # Non-Windows aura entrypoint.
126       sources += [ "app/chrome_exe_main_aura.cc" ]
127     }
129     if (is_linux) {
130       sources += [
131         "app/chrome_dll_resource.h",
132         "app/chrome_main.cc",
133         "app/chrome_main_delegate.cc",
134         "app/chrome_main_delegate.h",
135       ]
137       deps += [
138         # On Linux, link the dependencies (libraries) that make up actual
139         # Chromium functionality directly into the executable.
140         ":browser_dependencies",
141         ":child_dependencies",
142         ":manpage",
143         "//base/allocator",
145         # Needed to use the master_preferences functions
146         "//chrome/installer/util",
147         "//content/public/app:both",
148       ]
149       public_deps = [
150         ":xdg_mime",  # Needs to be public for installer to consume files.
151       ]
153       # Needed for chrome_main.cc initialization of libraries.
154       configs += [ "//build/config/linux:pangocairo" ]
156       # GYP has this in a 'profiling==0 and linux_disable_pie==0' condition.
157       # but GN doesn't have either of these flags.
158       ldflags = [ "-pie" ]
160       if (use_x11) {
161         configs += [
162           "//build/config/linux:x11",
163           "//build/config/linux:xext",
164         ]
165       }
166     }
168     if (is_mac) {
169       sources += [ "app/chrome_exe_main_mac.cc" ]
170       # TODO(GYP) lots more stuff in the is_mac block.
171     } else {  # Non-Mac.
172       # These files are used by the installer so we need a public dep.
173       public_deps += [
174         ":packed_extra_resources",
175         ":packed_resources",
176       ]
177       deps += [
178         "//components/startup_metric_utils",
180         # Precompiled plugins that need to get copied to the output directory.
181         # On Mac, internal plugins go inside the framework, so these
182         # dependencies are on chrome.dll.
183         "//third_party/adobe/flash:flapper_binaries",
184         "//third_party/widevine/cdm:widevinecdmadapter",
185       ]
186     }
188     if (is_linux && enable_plugins) {
189       deps += [ "//pdf" ]
190     }
192     if (is_multi_dll_chrome) {
193       defines += [ "CHROME_MULTIPLE_DLL" ]
194       data_deps += [ ":chrome_child" ]
195     }
196   }
197 }  # !is_android
199 shared_library("main_dll") {
200   configs += [ "//build/config/compiler:wexit_time_destructors" ]
201   defines = []
203   deps = [
204     ":browser_dependencies",
205     "//base/allocator",
206     "//build/config/sanitizers:deps",
207   ]
208   if (is_win) {
209     output_name = "chrome"
211     sources = [
212       "//base/win/dllmain.cc",
213       "app/chrome_command_ids.h",
214       "app/chrome_dll.rc",
215       "app/chrome_dll_resource.h",
216       "app/chrome_main.cc",
217       "app/chrome_main_delegate.cc",
218       "app/chrome_main_delegate.h",
219       "app/close_handle_hook_win.cc",
220       "app/close_handle_hook_win.h",
221       "app/delay_load_hook_win.cc",
222       "app/delay_load_hook_win.h",
223     ]
225     deps += [
226       ":chrome_dll_manifest",
227       ":chrome_dll_version",
228       "//base/trace_event/etw_manifest:chrome_events_win",
229       "//chrome/app/theme:chrome_unscaled_resources",
230       "//chrome_elf",
231       "//content/app/resources",
232       "//crypto",
233       "//net:net_resources",
234       "//third_party/wtl",
235       "//ui/views",
236     ]
237     if (enable_configuration_policy) {
238       deps += [ "//components/policy" ]
239     }
240     if (current_cpu == "x86") {
241       # TODO(GYP) bug 512861: Lots of VCLinkerTool stuff on Windows.
242       #deps += [ 'chrome_user32_delay_imports' ]  TODO(GYP)
243     }
245     # This is a large module that can't do incremental linking in some cases.
246     configs -= [ "//build/config/win:default_incremental_linking" ]
247     configs += [ "//build/config/win:default_large_module_incremental_linking" ]
249     # TODO(GYP) bug 512851: PGO.
250   }
252   if (use_aura) {
253     deps += [ "//ui/compositor" ]
254   }
256   if (is_multi_dll_chrome) {
257     defines += [ "CHROME_MULTIPLE_DLL_BROWSER" ]
258     deps += [ "//content/public/app:browser" ]
259   } else {
260     deps += [
261       ":child_dependencies",
262       "//content/public/app:both",
263     ]
264   }
266   if (cld_version == 2) {
267     deps += [ "//third_party/cld_2" ]
268   }
270   if (is_mac) {
271     #['OS=="mac" and component!="shared_library"', {  TODO(GYP)
272     #  'includes': [ 'chrome_dll_bundle.gypi' ],
273     #}],
274     # TODO(GYP) Lots of other stuff in the OS=="mac" block.
275   }
277   if (enable_plugins && !is_multi_dll_chrome) {
278     deps += [ "//pdf" ]
279   }
282 if (is_multi_dll_chrome) {
283   # This manifest matches what GYP produces. It may not even be necessary.
284   windows_manifest("chrome_child_manifest") {
285     sources = [
286       as_invoker_manifest,
287     ]
288     type = "dll"
289   }
291   shared_library("chrome_child") {
292     sources = [
293       "app/chrome_main.cc",
294       "app/chrome_main_delegate.cc",
295       "app/chrome_main_delegate.h",
296       "app/close_handle_hook_win.cc",
297       "app/close_handle_hook_win.h",
298     ]
300     configs += [ "//build/config/compiler:wexit_time_destructors" ]
301     defines = [ "CHROME_MULTIPLE_DLL_CHILD" ]
303     deps = [
304       ":child_dependencies",
305       ":chrome_child_manifest",
306       ":chrome_dll_version",
307       "//base/allocator",
308       "//build/config/sanitizers:deps",
309       "//chrome/browser/policy:path_parser",
310       "//content/public/app:child",
311     ]
313     if (is_win) {
314       # TODO(GYP) bug 512851: PGO on Windows.
315       # ['chrome_pgo_phase==1', {
316       #   'msvs_settings': {
317       #     'VCLinkerTool': {
318       #       'LinkTimeCodeGeneration': '2',
319       #     },
320       #   },
321       # }],
322       # ['chrome_pgo_phase==2', {
323       #   'msvs_settings': {
324       #     'VCLinkerTool': {
325       #       'LinkTimeCodeGeneration': '3',
326       #     },
327       #   },
328       # }],
329     }
330     if (enable_plugins) {
331       deps += [ "//pdf" ]
332     }
333   }
336 # GYP version: chromium_browser_dependencies variable in chrome.gyp
337 group("browser_dependencies") {
338   public_deps = [
339     "//chrome/browser",
340     "//chrome/common",
341     "//sync",
342   ]
343   if (!is_ios) {
344     public_deps += [ "//ppapi/host" ]
345   }
347   if (enable_basic_printing || enable_print_preview) {
348     public_deps += [ "//printing" ]
349     if (enable_print_preview) {
350       public_deps += [ "//chrome/service" ]
351     }
352   }
355 # GYP version: chromium_child_dependencies variable in chrome.gyp
356 group("child_dependencies") {
357   public_deps = [
358     "//chrome/common",
359     "//sync",
360   ]
361   if (!is_ios) {
362     public_deps += [
363       "//chrome/browser/devtools",
364       "//chrome/child",
365       "//chrome/plugin",
366       "//chrome/renderer",
367       "//chrome/utility",
368       "//content/public/child",
369       "//third_party/WebKit/public:blink_devtools_frontend_resources",
370     ]
371   }
372   if (cld_version == 2) {
373     public_deps += [ "//third_party/cld_2:cld2_platform_impl" ]
374   }
376   if (enable_nacl) {
377     public_deps += [ "//components/nacl/renderer/plugin:nacl_trusted_plugin" ]
378   }
381 if (is_win) {
382   # TODO(brettw) this duplicates "//chrome/common:version" which applies to
383   # Linux.
384   process_version("version_header") {
385     # TODO(brettW) this should have more reduced visibility, but chrome/browser
386     # currently depends on this.
387     #visibility = [ ":*" ]
389     # This one just uses the custom template and no separate sources.
390     sources = []
391     template_file = "version.h.in"
393     # TODO(brettw) this should move to $target_gen_dir/version.h and
394     # source files including it should reference it via "chrome/version.h"
395     output = "$root_gen_dir/version.h"
396   }
398   process_version("chrome_exe_version") {
399     template_file = chrome_version_rc_template
400     sources = [
401       "app/chrome_exe.ver",
402     ]
403     output = "$target_gen_dir/chrome_exe_version.rc"
404   }
406   process_version("chrome_dll_version") {
407     template_file = chrome_version_rc_template
408     sources = [
409       "app/chrome_dll.ver",
410     ]
411     output = "$target_gen_dir/chrome_dll_version.rc"
412   }
414   # This manifest matches what GYP produces. It may not even be necessary.
415   windows_manifest("chrome_dll_manifest") {
416     sources = [
417       as_invoker_manifest,
418       common_controls_manifest,
419     ]
420     type = "dll"
421   }
423   process_version("nacl64_exe_version") {
424     template_file = chrome_version_rc_template
425     sources = [
426       "app/nacl64_exe.ver",
427     ]
428     output = "$target_gen_dir/nacl64_exe_version.rc"
429   }
431   process_version("other_version") {
432     template_file = chrome_version_rc_template
433     sources = [
434       "app/other.ver",
435     ]
436     output = "$target_gen_dir/other_version.rc"
437   }
439   source_set("image_pre_reader") {
440     sources = [
441       "app/image_pre_reader_win.cc",
442       "app/image_pre_reader_win.h",
443     ]
444     deps = [
445       "//base",
446     ]
447   }
450 # GYP version: chrome/chrome_resources.gyp:chrome_resources
451 group("resources") {
452   public_deps = [
453     # Note: GYP lists some dependencies in addition to these actions. However,
454     # these are just dependencies for the actions themselves, which our actions
455     # list individually when needed.
456     "//chrome/browser:resources",
457     "//chrome/common:resources",
458     "//chrome/renderer:resources",
459   ]
461   if (enable_extensions) {
462     public_deps += [ "//chrome/common:extensions_api_resources" ]
463   }
466 # GYP version: chrome/chrome_resources.gyp:chrome_extra_resources
467 group("extra_resources") {
468   public_deps = [
469     "//chrome/browser/resources:invalidations_resources",
470     "//chrome/browser/resources:memory_internals_resources",
471     "//chrome/browser/resources:net_internals_resources",
472     "//chrome/browser/resources:password_manager_internals_resources",
473     "//chrome/browser/resources:signin_internals_resources",
474     "//chrome/browser/resources:translate_internals_resources",
475   ]
476   if (!is_ios) {
477     public_deps += [
478       "//chrome/browser/resources:component_extension_resources",
479       "//chrome/browser/resources:options_resources",
480       "//chrome/browser/resources:settings_resources",
481     ]
482   }
484   if (is_chromeos) {
485     public_deps += [ "//chrome/browser/resources/chromeos/chromevox" ]
486   }
488   if (enable_extensions) {
489     public_deps += [
490       "//chrome/browser/resources:quota_internals_resources",
491       "//chrome/browser/resources:sync_file_system_internals_resources",
492     ]
493   }
496 if (is_chrome_branded) {
497   copy("default_apps") {
498     visibility = [ ":packed_resources" ]
499     sources = [
500       "browser/resources/default_apps/docs.crx",
501       "browser/resources/default_apps/drive.crx",
502       "browser/resources/default_apps/external_extensions.json",
503       "browser/resources/default_apps/gmail.crx",
504       "browser/resources/default_apps/search.crx",
505       "browser/resources/default_apps/youtube.crx",
506     ]
507     outputs = [
508       "$root_out_dir/default_apps/{{source_file_part}}",
509     ]
511     # Force anybody that depends on this to get the default apps as data files.
512     data = process_file_template(sources, outputs)
513   }
516 group("packed_resources") {
517   public_deps = [
518     ":repack_locales_pack",
519     ":repack_pseudo_locales_pack",
520     ":repack_chrome_100_percent",
521   ]
523   if (is_chrome_branded) {
524     public_deps += [ ":default_apps" ]
525   }
527   if (enable_hidpi) {
528     public_deps += [ ":repack_chrome_200_percent" ]
529   }
531   if (enable_topchrome_md) {
532     public_deps += [ ":repack_chrome_material_100_percent" ]
534     if (enable_hidpi) {
535       public_deps += [ ":repack_chrome_material_200_percent" ]
536     }
537   }
540 repack("packed_extra_resources") {
541   visibility = [ "./*" ]
542   sources = [
543     "$root_gen_dir/chrome/browser_resources.pak",
544     "$root_gen_dir/chrome/chrome_unscaled_resources.pak",
545     "$root_gen_dir/chrome/common_resources.pak",
546     "$root_gen_dir/chrome/invalidations_resources.pak",
547     "$root_gen_dir/chrome/memory_internals_resources.pak",
548     "$root_gen_dir/chrome/net_internals_resources.pak",
549     "$root_gen_dir/chrome/password_manager_internals_resources.pak",
550     "$root_gen_dir/chrome/signin_internals_resources.pak",
551     "$root_gen_dir/chrome/translate_internals_resources.pak",
552     "$root_gen_dir/components/components_resources.pak",
553     "$root_gen_dir/net/net_resources.pak",
554     "$root_gen_dir/ui/resources/webui_resources.pak",
555   ]
556   deps = [
557     "//chrome/browser:resources",
558     "//chrome/app/theme:chrome_unscaled_resources",
559     "//chrome/common:resources",
560     "//chrome/browser/resources:invalidations_resources",
561     "//chrome/browser/resources:memory_internals_resources",
562     "//chrome/browser/resources:net_internals_resources",
563     "//chrome/browser/resources:password_manager_internals_resources",
564     "//chrome/browser/resources:signin_internals_resources",
565     "//chrome/browser/resources:translate_internals_resources",
566     "//components/resources",
567     "//net:net_resources",
568     "//ui/resources",
569   ]
571   if (!is_ios && !is_android) {
572     # New paks should be added here by default.
573     sources += [
574       "$root_gen_dir/blink/devtools_resources.pak",
575       "$root_gen_dir/chrome/component_extension_resources.pak",
576       "$root_gen_dir/chrome/options_resources.pak",
577       "$root_gen_dir/chrome/quota_internals_resources.pak",
578       "$root_gen_dir/chrome/settings_resources.pak",
579       "$root_gen_dir/chrome/sync_file_system_internals_resources.pak",
580       "$root_gen_dir/chrome/webrtc_device_provider_resources.pak",
581     ]
582     deps += [
583       "//chrome/browser/devtools:webrtc_device_provider_resources",
584       "//chrome/browser/resources:component_extension_resources",
585       "//chrome/browser/resources:options_resources",
586       "//chrome/browser/resources:settings_resources",
587       "//chrome/browser/resources:quota_internals_resources",
588       "//chrome/browser/resources:sync_file_system_internals_resources",
589       "//content/browser/devtools:devtools_resources",
590     ]
591   }
592   if (!is_ios) {
593     sources += [
594       "$root_gen_dir/blink/public/resources/blink_resources.pak",
595       "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
596       "$root_gen_dir/content/content_resources.pak",
597     ]
598     deps += [
599       "//content:resources",
600       "//content/browser/tracing:resources",
601       "//third_party/WebKit/public:resources",
602     ]
603   }
604   if (is_chromeos) {
605     sources += [ "$root_gen_dir/ui/file_manager/file_manager_resources.pak" ]
606     deps += [ "//ui/file_manager:resources" ]
607   }
608   if (enable_extensions) {
609     sources += [
610       "$root_gen_dir/chrome/extensions_api_resources.pak",
611       "$root_gen_dir/extensions/extensions_renderer_resources.pak",
612       "$root_gen_dir/extensions/extensions_resources.pak",
613     ]
614     deps += [
615       "//chrome/common:extensions_api_resources",
616       "//extensions:extensions_resources",
617     ]
618   }
620   # GYP outputs the file in the gen/repack directory. On non-Mac/iOS platforms
621   # it them copies it. This skipes the copy step and writes it to the final
622   # location.
623   if (is_mac || is_ios) {
624     output = "$root_gen_dir/repack/resources.pak"
625   } else {
626     output = "$root_out_dir/resources.pak"
627   }
630 # GYP version: chrome/chrome_resources.gyp:browser_tests_pak
631 repack("browser_tests_pak") {
632   sources = [
633     "$root_gen_dir/chrome/options_test_resources.pak",
634     "$root_gen_dir/chrome/webui_test_resources.pak",
635   ]
636   output = "$root_out_dir/browser_tests.pak"
637   deps = [
638     "//chrome/browser/resources:options_test_resources",
639     "//chrome/test/data:webui_test_resources",
640   ]
643 # Collects per-locale grit files from many sources into global per-locale files.
644 chrome_repack_locales("repack_locales_pack") {
645   visibility = [ ":*" ]
647   input_locales = locales
649   if (is_mac) {
650     output_locales = locales_as_mac_outputs
651   } else {
652     output_locales = locales
653   }
656 chrome_repack_locales("repack_pseudo_locales_pack") {
657   visibility = [ ":*" ]
659   input_locales = [ "fake-bidi" ]
661   if (is_mac) {
662     output_locales = [ "fake_bidi" ]  # Mac uses underscores.
663   } else {
664     output_locales = [ "fake-bidi" ]
665   }
668 # Generates a rule to repack a set of resources, substituting a given string
669 # in for the percentage (e.g. "100", "200"). It generates the repacked files in
670 # the "gen" directory, and then introduces a copy rule to copy it to the root
671 # build directory.
673 # It's not clear why this two-step dance is necessary as opposed to just
674 # generating the file in the destination. However, this is what the GYP build
675 # does, and for maintenance purposes, this keeps the same files in the same
676 # place between the two builds when possible.
678 # Argument:
679 #   percent [required]
680 #      String to substitute for the percentage.
681 template("chrome_repack_percent") {
682   percent = invoker.percent
684   repack_name = "${target_name}_repack"
685   repack_output_file = "$root_gen_dir/repack/chrome_${percent}_percent.pak"
687   copy_name = target_name
689   repack(repack_name) {
690     visibility = [ ":$copy_name" ]
692     # All sources should also have deps for completeness.
693     sources = [
694       "$root_gen_dir/chrome/renderer_resources_${percent}_percent.pak",
695       "$root_gen_dir/chrome/theme_resources_${percent}_percent.pak",
696       "$root_gen_dir/components/components_resources_${percent}_percent.pak",
697       "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak",
698     ]
700     deps = [
701       "//chrome/app/theme:theme_resources",
702       "//chrome/renderer:resources",
703       "//components/resources",
704       "//components/strings",
705       "//net:net_resources",
706       "//ui/resources",
707     ]
709     if (!is_ios) {
710       sources += [
711         "$root_gen_dir/blink/public/resources/blink_image_resources_${percent}_percent.pak",
712         "$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak",
713       ]
714       deps += [
715         "//content/app/resources",
716         "//third_party/WebKit/public:image_resources",
717       ]
718     }
719     if (use_ash) {
720       sources +=
721           [ "$root_gen_dir/ash/resources/ash_resources_${percent}_percent.pak" ]
722       deps += [ "//ash/resources" ]
723     }
724     if (toolkit_views) {
725       sources += [ "$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak" ]
726       deps += [ "//ui/views/resources" ]
727     }
728     if (is_chromeos) {
729       sources += [ "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_percent.pak" ]
730       deps += [ "//ui/chromeos/resources" ]
731     }
732     if (enable_extensions) {
733       sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ]
734       deps += [ "//extensions:extensions_browser_resources" ]
735     }
736     if (enable_app_list) {
737       sources += [ "$root_gen_dir/ui/app_list/resources/app_list_resources_${percent}_percent.pak" ]
738       deps += [ "//ui/app_list/resources" ]
739     }
741     output = repack_output_file
742   }
744   copy(copy_name) {
745     visibility = [ ":*" ]
746     deps = [
747       ":$repack_name",
748     ]
749     sources = [
750       repack_output_file,
751     ]
752     outputs = [
753       "$root_build_dir/chrome_${percent}_percent.pak",
754     ]
755   }
758 chrome_repack_percent("repack_chrome_100_percent") {
759   percent = "100"
762 if (enable_hidpi) {
763   chrome_repack_percent("repack_chrome_200_percent") {
764     percent = "200"
765   }
768 # Generates a rule to repack a set of material design resources for the browser
769 # top chrome, substituting a given string in for the percentage (e.g. "100",
770 # "200").
771 template("chrome_repack_material_percent") {
772   percent = invoker.percent
774   repack_name = "${target_name}_repack"
775   repack_output_file =
776       "$root_gen_dir/repack/chrome_material_${percent}_percent.pak"
778   copy_name = target_name
780   repack(repack_name) {
781     visibility = [ ":$copy_name" ]
783     # All sources should also have deps for completeness.
784     sources = [
785       "$root_gen_dir/chrome/theme_resources_material_${percent}_percent.pak",
786       "$root_gen_dir/components/components_resources_material_${percent}_percent.pak",
787     ]
789     deps = [
790       "//chrome/app/theme:theme_resources",
791       "//components/resources",
792     ]
794     output = repack_output_file
795   }
797   copy(copy_name) {
798     visibility = [ ":*" ]
799     deps = [
800       ":$repack_name",
801     ]
802     sources = [
803       repack_output_file,
804     ]
805     outputs = [
806       "$root_build_dir/chrome_material_${percent}_percent.pak",
807     ]
808   }
811 if (enable_topchrome_md) {
812   chrome_repack_material_percent("repack_chrome_material_100_percent") {
813     percent = "100"
814   }
816   if (enable_hidpi) {
817     chrome_repack_material_percent("repack_chrome_material_200_percent") {
818       percent = "200"
819     }
820   }
823 # GYP version: chrome/chrome_resources.gyp:chrome_strings
824 group("strings") {
825   deps = [
826     "//chrome/app:chromium_strings",
827     "//chrome/app:generated_resources",
828     "//chrome/app:google_chrome_strings",
829     "//chrome/app/resources:locale_settings",
830   ]
833 if (is_android) {
834   # GYP: //chrome/chrome.gyp:content_setting_java
835   java_cpp_enum("content_setting_javagen") {
836     sources = [
837       "../components/content_settings/core/common/content_settings.h",
838     ]
839     outputs = [
840       "org/chromium/chrome/browser/ContentSetting.java",
841     ]
842   }
844   # GYP: //chrome/chrome.gyp:content_settings_type_java
845   java_cpp_enum("content_settings_type_javagen") {
846     sources = [
847       "../components/content_settings/core/common/content_settings_types.h",
848     ]
849     outputs = [
850       "org/chromium/chrome/browser/ContentSettingsType.java",
851     ]
852   }
854   # GYP: //chrome/chrome.gyp:page_info_connection_type_java
855   java_cpp_enum("page_info_connection_type_javagen") {
856     sources = [
857       "browser/ui/android/website_settings_popup_android.h",
858     ]
859     outputs = [
860       "org/chromium/chrome/browser/PageInfoConnectionType.java",
861     ]
862   }
864   # GYP: //chrome/chrome_android.gypi:chrome_android_core
865   static_library("chrome_android_core") {
866     sources = [
867       "app/android/chrome_android_initializer.cc",
868       "app/android/chrome_android_initializer.h",
869       "app/android/chrome_jni_onload.cc",
870       "app/android/chrome_jni_onload.h",
871       "app/android/chrome_main_delegate_android.cc",
872       "app/android/chrome_main_delegate_android.h",
873       "app/chrome_main_delegate.cc",
874       "app/chrome_main_delegate.h",
875     ]
877     include_dirs = [ android_ndk_include_dir ]
879     libs = [
880       "android",
881       "jnigraphics",
882     ]
884     deps = [
885       "//chrome/browser",
886       "//chrome/browser/ui",
887       "//chrome/child",
888       "//chrome/plugin",
889       "//chrome/renderer",
890       "//chrome/utility",
891       "//components/enhanced_bookmarks",
892       "//content/public/app:both",
893     ]
894   }
897 if (is_linux) {
898   action("manpage") {
899     if (is_chrome_branded) {
900       name = "Google Chrome"
901       filename = "google-chrome"
902       confdir = "google-chrome"
903     } else {
904       name = "Chromium"
905       filename = "chromium-browser"
906       confdir = "chromium"
907     }
909     script = "//chrome/tools/build/linux/sed.py"
910     infile = "app/resources/manpage.1.in"
911     inputs = [
912       infile,
913     ]
915     outfile = "$root_out_dir/chrome.1"
916     outputs = [
917       outfile,
918     ]
920     args = [
921       rebase_path(infile, root_build_dir),
922       rebase_path(outfile, root_build_dir),
923       "-e s/@@NAME@@/$name/",
924       "-e s/@@FILENAME@@/$filename/",
925       "-e s/@@CONFDIR@@/$confdir/",
926     ]
927   }
929   action("linux_symbols") {
930     script = "//build/linux/dump_app_syms.py"
932     dump_syms_label = "//breakpad:dump_syms($host_toolchain)"
933     dump_syms_binary =
934         get_label_info(dump_syms_label, "root_out_dir") + "/" + "dump_syms"
936     chrome_binary = "$root_out_dir/chrome"
937     if (current_cpu == "x86") {
938       # Use "ia32" instead of "x86" for GYP compat.
939       symbol_file = "$root_out_dir/chrome.breakpad.ia32"
940     } else {
941       symbol_file = "$root_out_dir/chrome.breakpad.$current_cpu"
942     }
944     inputs = [
945       chrome_binary,
946       dump_syms_binary,
947     ]
948     outputs = [
949       symbol_file,
950     ]
952     args = [
953       "./" + rebase_path(dump_syms_binary, root_build_dir),
954       "0",  # TODO(GYP) This is linux_strip_binary if it is needed.
955       rebase_path(chrome_binary, root_build_dir),
956       rebase_path(symbol_file, root_build_dir),
957     ]
959     deps = [
960       ":chrome",
961       dump_syms_label,
962     ]
963   }
965   # Copies some scripts and resources that are used for desktop integration.
966   copy("xdg_mime") {
967     sources = [
968       "//chrome/app/theme/$branding_path_component/product_logo_48.png",
969       "//chrome/tools/build/linux/chrome-wrapper",
970       "//third_party/xdg-utils/scripts/xdg-mime",
971       "//third_party/xdg-utils/scripts/xdg-settings",
972     ]
973     outputs = [
974       "$root_out_dir/{{source_file_part}}",
975     ]
976   }