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