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