Rename GetIconID to GetIconId
[chromium-blink-merge.git] / chrome / BUILD.gn
blobb412904dc885295cfbf536da14539ebed3e52d66
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/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   deps = [
339     "//chrome/browser",
340     "//chrome/common",
341     "//sync",
342   ]
343   if (!is_ios) {
344     deps += [ "//ppapi/host" ]
345   }
347   if (enable_basic_printing || enable_print_preview) {
348     deps += [ "//printing" ]
349     if (enable_print_preview) {
350       deps += [ "//chrome/service" ]
351     }
352   }
355 # GYP version: chromium_child_dependencies variable in chrome.gyp
356 group("child_dependencies") {
357   deps = [
358     "//chrome/common",
359     "//sync",
360   ]
361   if (!is_ios) {
362     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     deps += [ "//third_party/cld_2:cld2_platform_impl" ]
374   }
376   if (enable_nacl) {
377     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   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     deps += [ "//chrome/common:extensions_api_resources" ]
463   }
466 # GYP version: chrome/chrome_resources.gyp:chrome_extra_resources
467 group("extra_resources") {
468   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:sync_internals_resources",
475     "//chrome/browser/resources:translate_internals_resources",
476   ]
477   if (!is_ios) {
478     deps += [
479       "//chrome/browser/resources:component_extension_resources",
480       "//chrome/browser/resources:options_resources",
481       "//chrome/browser/resources:settings_resources",
482     ]
483   }
485   if (is_chromeos) {
486     deps += [ "//chrome/browser/resources/chromeos/chromevox" ]
487   }
489   if (enable_extensions) {
490     deps += [
491       "//chrome/browser/resources:quota_internals_resources",
492       "//chrome/browser/resources:sync_file_system_internals_resources",
493     ]
494   }
497 if (is_chrome_branded) {
498   copy("default_apps") {
499     visibility = [ ":packed_resources" ]
500     sources = [
501       "browser/resources/default_apps/docs.crx",
502       "browser/resources/default_apps/drive.crx",
503       "browser/resources/default_apps/external_extensions.json",
504       "browser/resources/default_apps/gmail.crx",
505       "browser/resources/default_apps/search.crx",
506       "browser/resources/default_apps/youtube.crx",
507     ]
508     outputs = [
509       "$root_out_dir/default_apps/{{source_file_part}}",
510     ]
512     # Force anybody that depends on this to get the default apps as data files.
513     data = process_file_template(sources, outputs)
514   }
517 group("packed_resources") {
518   public_deps = [
519     ":repack_locales_pack",
520     ":repack_pseudo_locales_pack",
521     ":repack_chrome_100_percent",
522   ]
524   if (is_chrome_branded) {
525     public_deps += [ ":default_apps" ]
526   }
528   if (enable_hidpi) {
529     public_deps += [ ":repack_chrome_200_percent" ]
530   }
532   if (enable_topchrome_md) {
533     public_deps += [ ":repack_chrome_material_100_percent" ]
535     if (enable_hidpi) {
536       public_deps += [ ":repack_chrome_material_200_percent" ]
537     }
538   }
541 repack("packed_extra_resources") {
542   visibility = [ "./*" ]
543   sources = [
544     "$root_gen_dir/chrome/browser_resources.pak",
545     "$root_gen_dir/chrome/chrome_unscaled_resources.pak",
546     "$root_gen_dir/chrome/common_resources.pak",
547     "$root_gen_dir/chrome/invalidations_resources.pak",
548     "$root_gen_dir/chrome/memory_internals_resources.pak",
549     "$root_gen_dir/chrome/net_internals_resources.pak",
550     "$root_gen_dir/chrome/password_manager_internals_resources.pak",
551     "$root_gen_dir/chrome/signin_internals_resources.pak",
552     "$root_gen_dir/chrome/sync_internals_resources.pak",
553     "$root_gen_dir/chrome/translate_internals_resources.pak",
554     "$root_gen_dir/components/components_resources.pak",
555     "$root_gen_dir/net/net_resources.pak",
556     "$root_gen_dir/ui/resources/webui_resources.pak",
557   ]
558   deps = [
559     "//chrome/browser:resources",
560     "//chrome/app/theme:chrome_unscaled_resources",
561     "//chrome/common:resources",
562     "//chrome/browser/resources:invalidations_resources",
563     "//chrome/browser/resources:memory_internals_resources",
564     "//chrome/browser/resources:net_internals_resources",
565     "//chrome/browser/resources:password_manager_internals_resources",
566     "//chrome/browser/resources:signin_internals_resources",
567     "//chrome/browser/resources:sync_internals_resources",
568     "//chrome/browser/resources:translate_internals_resources",
569     "//components/resources",
570     "//net:net_resources",
571     "//ui/resources",
572   ]
574   if (!is_ios && !is_android) {
575     # New paks should be added here by default.
576     sources += [
577       "$root_gen_dir/blink/devtools_resources.pak",
578       "$root_gen_dir/chrome/component_extension_resources.pak",
579       "$root_gen_dir/chrome/options_resources.pak",
580       "$root_gen_dir/chrome/quota_internals_resources.pak",
581       "$root_gen_dir/chrome/settings_resources.pak",
582       "$root_gen_dir/chrome/sync_file_system_internals_resources.pak",
583       "$root_gen_dir/chrome/webrtc_device_provider_resources.pak",
584     ]
585     deps += [
586       "//chrome/browser/devtools:webrtc_device_provider_resources",
587       "//chrome/browser/resources:component_extension_resources",
588       "//chrome/browser/resources:options_resources",
589       "//chrome/browser/resources:settings_resources",
590       "//chrome/browser/resources:quota_internals_resources",
591       "//chrome/browser/resources:sync_file_system_internals_resources",
592       "//content/browser/devtools:devtools_resources",
593     ]
594   }
595   if (!is_ios) {
596     sources += [
597       "$root_gen_dir/blink/public/resources/blink_resources.pak",
598       "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
599       "$root_gen_dir/content/content_resources.pak",
600     ]
601     deps += [
602       "//content:resources",
603       "//content/browser/tracing:resources",
604       "//third_party/WebKit/public:resources",
605     ]
606   }
607   if (is_chromeos) {
608     sources += [ "$root_gen_dir/ui/file_manager/file_manager_resources.pak" ]
609     deps += [ "//ui/file_manager:resources" ]
610   }
611   if (enable_extensions) {
612     sources += [
613       "$root_gen_dir/chrome/extensions_api_resources.pak",
614       "$root_gen_dir/extensions/extensions_renderer_resources.pak",
615       "$root_gen_dir/extensions/extensions_resources.pak",
616     ]
617     deps += [
618       "//chrome/common:extensions_api_resources",
619       "//extensions:extensions_resources",
620     ]
621   }
623   # GYP outputs the file in the gen/repack directory. On non-Mac/iOS platforms
624   # it them copies it. This skipes the copy step and writes it to the final
625   # location.
626   if (is_mac || is_ios) {
627     output = "$root_gen_dir/repack/resources.pak"
628   } else {
629     output = "$root_out_dir/resources.pak"
630   }
633 # GYP version: chrome/chrome_resources.gyp:browser_tests_pak
634 repack("browser_tests_pak") {
635   sources = [
636     "$root_gen_dir/chrome/options_test_resources.pak",
637     "$root_gen_dir/chrome/webui_test_resources.pak",
638   ]
639   output = "$root_out_dir/browser_tests.pak"
640   deps = [
641     "//chrome/browser/resources:options_test_resources",
642     "//chrome/test/data:webui_test_resources",
643   ]
646 # Collects per-locale grit files from many sources into global per-locale files.
647 chrome_repack_locales("repack_locales_pack") {
648   visibility = [ ":*" ]
650   input_locales = locales
652   if (is_mac) {
653     output_locales = locales_as_mac_outputs
654   } else {
655     output_locales = locales
656   }
659 chrome_repack_locales("repack_pseudo_locales_pack") {
660   visibility = [ ":*" ]
662   input_locales = [ "fake-bidi" ]
664   if (is_mac) {
665     output_locales = [ "fake_bidi" ]  # Mac uses underscores.
666   } else {
667     output_locales = [ "fake-bidi" ]
668   }
671 # Generates a rule to repack a set of resources, substituting a given string
672 # in for the percentage (e.g. "100", "200"). It generates the repacked files in
673 # the "gen" directory, and then introduces a copy rule to copy it to the root
674 # build directory.
676 # It's not clear why this two-step dance is necessary as opposed to just
677 # generating the file in the destination. However, this is what the GYP build
678 # does, and for maintenance purposes, this keeps the same files in the same
679 # place between the two builds when possible.
681 # Argument:
682 #   percent [required]
683 #      String to substitute for the percentage.
684 template("chrome_repack_percent") {
685   percent = invoker.percent
687   repack_name = "${target_name}_repack"
688   repack_output_file = "$root_gen_dir/repack/chrome_${percent}_percent.pak"
690   copy_name = target_name
692   repack(repack_name) {
693     visibility = [ ":$copy_name" ]
695     # All sources should also have deps for completeness.
696     sources = [
697       "$root_gen_dir/chrome/renderer_resources_${percent}_percent.pak",
698       "$root_gen_dir/chrome/theme_resources_${percent}_percent.pak",
699       "$root_gen_dir/components/components_resources_${percent}_percent.pak",
700       "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak",
701     ]
703     deps = [
704       "//chrome/app/theme:theme_resources",
705       "//chrome/renderer:resources",
706       "//components/resources",
707       "//components/strings",
708       "//net:net_resources",
709       "//ui/resources",
710     ]
712     if (!is_ios) {
713       sources += [
714         "$root_gen_dir/blink/public/resources/blink_image_resources_${percent}_percent.pak",
715         "$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak",
716       ]
717       deps += [
718         "//content/app/resources",
719         "//third_party/WebKit/public:image_resources",
720       ]
721     }
722     if (use_ash) {
723       sources +=
724           [ "$root_gen_dir/ash/resources/ash_resources_${percent}_percent.pak" ]
725       deps += [ "//ash/resources" ]
726     }
727     if (toolkit_views) {
728       sources += [ "$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak" ]
729       deps += [ "//ui/views/resources" ]
730     }
731     if (is_chromeos) {
732       sources += [ "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_percent.pak" ]
733       deps += [ "//ui/chromeos/resources" ]
734     }
735     if (enable_extensions) {
736       sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ]
737       deps += [ "//extensions:extensions_browser_resources" ]
738     }
739     if (enable_app_list) {
740       sources += [ "$root_gen_dir/ui/app_list/resources/app_list_resources_${percent}_percent.pak" ]
741       deps += [ "//ui/app_list/resources" ]
742     }
744     output = repack_output_file
745   }
747   copy(copy_name) {
748     visibility = [ ":*" ]
749     deps = [
750       ":$repack_name",
751     ]
752     sources = [
753       repack_output_file,
754     ]
755     outputs = [
756       "$root_build_dir/chrome_${percent}_percent.pak",
757     ]
758   }
761 chrome_repack_percent("repack_chrome_100_percent") {
762   percent = "100"
765 if (enable_hidpi) {
766   chrome_repack_percent("repack_chrome_200_percent") {
767     percent = "200"
768   }
771 # Generates a rule to repack a set of material design resources for the browser
772 # top chrome, substituting a given string in for the percentage (e.g. "100",
773 # "200").
774 template("chrome_repack_material_percent") {
775   percent = invoker.percent
777   repack_name = "${target_name}_repack"
778   repack_output_file =
779       "$root_gen_dir/repack/chrome_material_${percent}_percent.pak"
781   copy_name = target_name
783   repack(repack_name) {
784     visibility = [ ":$copy_name" ]
786     # All sources should also have deps for completeness.
787     sources = [
788       "$root_gen_dir/chrome/theme_resources_material_${percent}_percent.pak",
789       "$root_gen_dir/components/components_resources_material_${percent}_percent.pak",
790     ]
792     deps = [
793       "//chrome/app/theme:theme_resources",
794       "//components/resources",
795     ]
797     output = repack_output_file
798   }
800   copy(copy_name) {
801     visibility = [ ":*" ]
802     deps = [
803       ":$repack_name",
804     ]
805     sources = [
806       repack_output_file,
807     ]
808     outputs = [
809       "$root_build_dir/chrome_material_${percent}_percent.pak",
810     ]
811   }
814 if (enable_topchrome_md) {
815   chrome_repack_material_percent("repack_chrome_material_100_percent") {
816     percent = "100"
817   }
819   if (enable_hidpi) {
820     chrome_repack_material_percent("repack_chrome_material_200_percent") {
821       percent = "200"
822     }
823   }
826 # GYP version: chrome/chrome_resources.gyp:chrome_strings
827 group("strings") {
828   deps = [
829     "//chrome/app:chromium_strings",
830     "//chrome/app:generated_resources",
831     "//chrome/app:google_chrome_strings",
832     "//chrome/app/resources:locale_settings",
833   ]
836 if (is_android) {
837   # GYP: //chrome/chrome.gyp:content_setting_java
838   java_cpp_enum("content_setting_javagen") {
839     sources = [
840       "../components/content_settings/core/common/content_settings.h",
841     ]
842     outputs = [
843       "org/chromium/chrome/browser/ContentSetting.java",
844     ]
845   }
847   # GYP: //chrome/chrome.gyp:content_settings_type_java
848   java_cpp_enum("content_settings_type_javagen") {
849     sources = [
850       "../components/content_settings/core/common/content_settings_types.h",
851     ]
852     outputs = [
853       "org/chromium/chrome/browser/ContentSettingsType.java",
854     ]
855   }
857   # GYP: //chrome/chrome.gyp:page_info_connection_type_java
858   java_cpp_enum("page_info_connection_type_javagen") {
859     sources = [
860       "browser/ui/android/website_settings_popup_android.h",
861     ]
862     outputs = [
863       "org/chromium/chrome/browser/PageInfoConnectionType.java",
864     ]
865   }
867   # GYP: //chrome/chrome_android.gypi:chrome_android_core
868   static_library("chrome_android_core") {
869     sources = [
870       "app/android/chrome_android_initializer.cc",
871       "app/android/chrome_android_initializer.h",
872       "app/android/chrome_jni_onload.cc",
873       "app/android/chrome_jni_onload.h",
874       "app/android/chrome_main_delegate_android.cc",
875       "app/android/chrome_main_delegate_android.h",
876       "app/chrome_main_delegate.cc",
877       "app/chrome_main_delegate.h",
878     ]
880     include_dirs = [ android_ndk_include_dir ]
882     libs = [
883       "android",
884       "jnigraphics",
885     ]
887     deps = [
888       "//chrome/browser",
889       "//chrome/browser/ui",
890       "//chrome/child",
891       "//chrome/plugin",
892       "//chrome/renderer",
893       "//chrome/utility",
894       "//components/enhanced_bookmarks",
895       "//content/public/app:both",
896     ]
897   }
900 if (is_linux) {
901   action("manpage") {
902     if (is_chrome_branded) {
903       name = "Google Chrome"
904       filename = "google-chrome"
905       confdir = "google-chrome"
906     } else {
907       name = "Chromium"
908       filename = "chromium-browser"
909       confdir = "chromium"
910     }
912     script = "//chrome/tools/build/linux/sed.py"
913     infile = "app/resources/manpage.1.in"
914     inputs = [
915       infile,
916     ]
918     outfile = "$root_out_dir/chrome.1"
919     outputs = [
920       outfile,
921     ]
923     args = [
924       rebase_path(infile, root_build_dir),
925       rebase_path(outfile, root_build_dir),
926       "-e s/@@NAME@@/$name/",
927       "-e s/@@FILENAME@@/$filename/",
928       "-e s/@@CONFDIR@@/$confdir/",
929     ]
930   }
932   action("linux_symbols") {
933     script = "//build/linux/dump_app_syms.py"
935     dump_syms_label = "//breakpad:dump_syms($host_toolchain)"
936     dump_syms_binary =
937         get_label_info(dump_syms_label, "root_out_dir") + "/" + "dump_syms"
939     chrome_binary = "$root_out_dir/chrome"
940     if (current_cpu == "x86") {
941       # Use "ia32" instead of "x86" for GYP compat.
942       symbol_file = "$root_out_dir/chrome.breakpad.ia32"
943     } else {
944       symbol_file = "$root_out_dir/chrome.breakpad.$current_cpu"
945     }
947     inputs = [
948       chrome_binary,
949       dump_syms_binary,
950     ]
951     outputs = [
952       symbol_file,
953     ]
955     args = [
956       "./" + rebase_path(dump_syms_binary, root_build_dir),
957       "0",  # TODO(GYP) This is linux_strip_binary if it is needed.
958       rebase_path(chrome_binary, root_build_dir),
959       rebase_path(symbol_file, root_build_dir),
960     ]
962     deps = [
963       ":chrome",
964       dump_syms_label,
965     ]
966   }
968   # Copies some scripts and resources that are used for desktop integration.
969   copy("xdg_mime") {
970     sources = [
971       "//chrome/app/theme/$branding_path_component/product_logo_48.png",
972       "//chrome/tools/build/linux/chrome-wrapper",
973       "//third_party/xdg-utils/scripts/xdg-mime",
974       "//third_party/xdg-utils/scripts/xdg-settings",
975     ]
976     outputs = [
977       "$root_out_dir/{{source_file_part}}",
978     ]
979   }