[Extensions] Report metrics for the source of a user-visible uninstallation
[chromium-blink-merge.git] / chrome / BUILD.gn
blob9972fdb071693aa27e8707571f65b8fbfe422410
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("//chrome/chrome_repack_locales.gni")
10 import("//chrome/version.gni")
12 if (is_android) {
13   import("//build/config/android/rules.gni")
16 if (!is_android) {
17   # TODO(GYP) for Windows need to the the reorder-imports step which probably
18   # means adding another target and renaming this to chrome_initial like in GYP.
19   executable("chrome") {
20     # Because the sources list varies so significantly per-platform, generally
21     # each platform lists its own files rather than relying on filtering or
22     # removing unused files.
23     sources = [
24       "app/chrome_exe_resource.h",
25     ]
26     defines = []
27     deps = []
28     data_deps = []
30     # TODO(GYP) mac_bundle_resources, xcode_settings
32     # TODO(GYP) order_profiling, order_text_section
34     if (is_win) {
35       sources += [
36         "//content/public/common/content_switches.cc",
37         "//content/public/common/content_switches.h",
38         "app/chrome_crash_reporter_client.cc",
39         "app/chrome_crash_reporter_client.h",
40         "app/chrome_exe.rc",
41         "app/chrome_exe_load_config_win.cc",
42         "app/chrome_exe_main_win.cc",
43         "app/chrome_watcher_client_win.cc",
44         "app/chrome_watcher_client_win.h",
45         "app/chrome_watcher_command_line_win.cc",
46         "app/chrome_watcher_command_line_win.h",
47         "app/client_util.cc",
48         "app/client_util.h",
49         "app/kasko_client.cc",
50         "app/kasko_client.h",
51         "app/signature_validator_win.cc",
52         "app/signature_validator_win.h",
53         "common/crash_keys.cc",
54         "common/crash_keys.h",
55       ]
57       if (is_component_build) {
58         # This is necessary to make content_switches compile without DLL
59         # linkage errors in a component build.
60         defines += [ "COMPILE_CONTENT_STATICALLY" ]
61       }
63       deps += [
64         ":chrome_exe_version",
65         ":image_pre_reader",
66         ":main_dll",
68         # 'chrome_nacl_win64" TODO(GYP)
69         # '../win8/delegate_execute/delegate_execute.gyp:*', TODO(GYP)
70         # '../win8/metro_driver/metro_driver.gyp:metro_driver', TODO(GYP)
71         "//base",
72         "//breakpad:breakpad_handler",
73         "//breakpad:breakpad_sender",
74         "//chrome/browser:chrome_process_finder",
75         "//chrome/chrome_watcher",
76         "//chrome/chrome_watcher:client",
77         "//chrome/installer/util",
78         "//chrome_elf",
79         "//components/browser_watcher:browser_watcher_client",
80         "//components/crash/app",
81         "//content:startup_helper_win",
82         "//crypto",
83         "//sandbox",
84         "//ui/gfx",
85       ]
86       libs = [
87         "wintrust.lib",
88         "crypt32.lib",
89       ]
90       configs -= [ "//build/config/win:console" ]
91       configs += [ "//build/config/win:windowed" ]
92     } else if (use_aura) {
93       # Non-Windows aura entrypoint.
94       sources += [ "app/chrome_exe_main_aura.cc" ]
95     }
97     if (is_linux) {
98       sources += [
99         "app/chrome_dll_resource.h",
100         "app/chrome_main.cc",
101         "app/chrome_main_delegate.cc",
102         "app/chrome_main_delegate.h",
103       ]
105       deps += [
106         # On Linux, link the dependencies (libraries) that make up actual
107         # Chromium functionality directly into the executable.
108         ":browser_dependencies",
109         ":child_dependencies",
110         ":manpage",
111         "//base/allocator",
113         # Needed to use the master_preferences functions
114         "//chrome/installer/util",
115         "//content/public/app:both",
116       ]
118       # Needed for chrome_main.cc initialization of libraries.
119       configs += [ "//build/config/linux:pangocairo" ]
121       # GYP has this in a 'profiling==0 and linux_disable_pie==0' condition.
122       # but GN doesn't have either of these flags.
123       ldflags = [ "-pie" ]
125       if (use_x11) {
126         configs += [
127           "//build/config/linux:x11",
128           "//build/config/linux:xext",
129         ]
130       }
131     }
133     if (is_mac) {
134       sources += [ "app/chrome_exe_main_mac.cc" ]
135       # TODO(GYP) lots more stuff in the is_mac block.
136     } else {  # Non-Mac.
137       deps += [
138         ":packed_extra_resources",
139         ":packed_resources",
140         "//components/startup_metric_utils",
142         # Precompiled plugins that need to get copied to the output directory.
143         # On Mac, internal plugins go inside the framework, so these
144         # dependencies are on chrome.dll.
145         "//third_party/adobe/flash:flapper_binaries",
146         "//third_party/widevine/cdm:widevinecdmadapter",
147       ]
148     }
150     if (is_linux && enable_plugins) {
151       deps += [ "//pdf" ]
152     }
154     if (is_multi_dll_chrome) {
155       defines += [ "CHROME_MULTIPLE_DLL" ]
156       data_deps += [ ":chrome_child" ]
157     }
158   }
159 }  # !is_android
161 shared_library("main_dll") {
162   configs += [ "//build/config/compiler:wexit_time_destructors" ]
163   defines = []
165   deps = [
166     ":browser_dependencies",
167     "//base/allocator",
168   ]
169   if (is_win) {
170     output_name = "chrome"
172     sources = [
173       "//base/win/dllmain.cc",
174       "app/chrome_command_ids.h",
175       "app/chrome_dll.rc",
176       "app/chrome_dll_resource.h",
177       "app/chrome_main.cc",
178       "app/chrome_main_delegate.cc",
179       "app/chrome_main_delegate.h",
180       "app/close_handle_hook_win.cc",
181       "app/close_handle_hook_win.h",
182       "app/delay_load_hook_win.cc",
183       "app/delay_load_hook_win.h",
184     ]
186     deps += [
187       ":chrome_dll_version",
188       "//base/trace_event/etw_manifest:chrome_events_win",
189       "//chrome/app/theme:chrome_unscaled_resources",
190       "//chrome_elf",
191       "//content/app/resources",
192       "//crypto",
193       "//net:net_resources",
194       "//third_party/wtl",
195       "//ui/views",
196     ]
197     if (enable_configuration_policy) {
198       deps += [ "//components/policy" ]
199     }
200     if (current_cpu == "x86") {
201       # Add a dependency to custom import library for user32 delay imports only
202       # in x86 builds.
203       #deps += [ 'chrome_user32_delay_imports' ]  TODO(GYP)
204     }
206     # This is a large module that can't do incremental linking in some cases.
207     configs -= [ "//build/config/win:default_incremental_linking" ]
208     configs += [ "//build/config/win:default_large_module_incremental_linking" ]
210     # TODO(GYP) Lots of VCLinkerTool stuff on Windows.
212     # TODO(GYP) chrome_pgo_phase on Windows.
213   }
215   if (use_aura) {
216     deps += [ "//ui/compositor" ]
217   }
219   if (is_multi_dll_chrome) {
220     defines += [ "CHROME_MULTIPLE_DLL_BROWSER" ]
221     deps += [ "//content/public/app:browser" ]
222   } else {
223     deps += [
224       ":child_dependencies",
225       "//content/public/app:both",
226     ]
227   }
229   if (cld_version == 0 || cld_version == 2) {
230     deps += [ "//third_party/cld_2" ]
231   }
233   if (is_mac) {
234     #['OS=="mac" and component!="shared_library"', {  TODO(GYP)
235     #  'includes': [ 'chrome_dll_bundle.gypi' ],
236     #}],
237     # TODO(GYP) Lots of other stuff in the OS=="mac" block.
238   }
240   if (enable_plugins && !is_multi_dll_chrome) {
241     deps += [ "//pdf" ]
242   }
245 if (is_multi_dll_chrome) {
246   shared_library("chrome_child") {
247     sources = [
248       "app/chrome_main.cc",
249       "app/chrome_main_delegate.cc",
250       "app/chrome_main_delegate.h",
251       "app/close_handle_hook_win.cc",
252       "app/close_handle_hook_win.h",
253     ]
255     configs += [ "//build/config/compiler:wexit_time_destructors" ]
256     defines = [ "CHROME_MULTIPLE_DLL_CHILD" ]
258     deps = [
259       ":child_dependencies",
260       ":chrome_dll_version",
261       "//chrome/browser/policy:path_parser",
262       "//content/public/app:child",
263     ]
265     if (is_win) {
266       # TODO(GYP): PGO on Windows.
267       # ['chrome_pgo_phase==1', {
268       #   'msvs_settings': {
269       #     'VCLinkerTool': {
270       #       'LinkTimeCodeGeneration': '2',
271       #     },
272       #   },
273       # }],
274       # ['chrome_pgo_phase==2', {
275       #   'msvs_settings': {
276       #     'VCLinkerTool': {
277       #       'LinkTimeCodeGeneration': '3',
278       #     },
279       #   },
280       # }],
281     }
282     if (enable_plugins) {
283       deps += [ "//pdf" ]
284     }
285   }
288 # GYP version: chromium_browser_dependencies variable in chrome.gyp
289 group("browser_dependencies") {
290   deps = [
291     "//chrome/browser",
292     "//chrome/common",
293     "//sync",
294   ]
295   if (!is_ios) {
296     deps += [ "//ppapi/host" ]
297   }
299   if (enable_basic_printing || enable_print_preview) {
300     deps += [ "//printing" ]
301     if (enable_print_preview) {
302       deps += [ "//chrome/service" ]
303     }
304   }
307 # GYP version: chromium_child_dependencies variable in chrome.gyp
308 group("child_dependencies") {
309   deps = [
310     "//chrome/common",
311     "//sync",
312   ]
313   if (!is_ios) {
314     deps += [
315       "//chrome/browser/devtools",
316       "//chrome/child",
317       "//chrome/plugin",
318       "//chrome/renderer",
319       "//chrome/utility",
320       "//content/public/child",
321       "//third_party/WebKit/public:blink_devtools_frontend_resources",
322     ]
323   }
324   if (cld_version == 0 || cld_version == 2) {
325     deps += [ "//third_party/cld_2:cld2_platform_impl" ]
326   }
328   if (enable_nacl) {
329     deps += [ "//components/nacl/renderer/plugin:nacl_trusted_plugin" ]
330   }
331   if (enable_remoting) {
332     deps += [ "//remoting/client/plugin" ]
333   }
336 if (is_win) {
337   # TODO(brettw) this duplicates "//chrome/common:version" which applies to
338   # Linux.
339   process_version("version_header") {
340     # TODO(brettW) this should have more reduced visibility, but chrome/browser
341     # currently depends on this.
342     #visibility = [ ":*" ]
344     # This one just uses the custom template and no separate sources.
345     sources = []
346     template_file = "version.h.in"
348     # TODO(brettw) this should move to $target_gen_dir/version.h and
349     # source files including it should reference it via "chrome/version.h"
350     output = "$root_gen_dir/version.h"
351   }
353   process_version("chrome_exe_version") {
354     sources = [
355       "app/chrome_exe.ver",
356     ]
357     output = "$target_gen_dir/chrome_exe_version.rc"
358   }
360   process_version("chrome_dll_version") {
361     sources = [
362       "app/chrome_dll.ver",
363     ]
364     output = "$target_gen_dir/chrome_dll_version.rc"
365   }
367   process_version("nacl64_exe_version") {
368     sources = [
369       "app/nacl64_exe.ver",
370     ]
371     output = "$target_gen_dir/nacl64_exe_version.rc"
372   }
374   process_version("other_version") {
375     sources = [
376       "app/other.ver",
377     ]
378     output = "$target_gen_dir/other_version.rc"
379   }
381   source_set("image_pre_reader") {
382     sources = [
383       "app/image_pre_reader_win.cc",
384       "app/image_pre_reader_win.h",
385     ]
386     deps = [
387       "//base",
388     ]
389   }
392 # GYP version: chrome/chrome_resources.gyp:chrome_resources
393 group("resources") {
394   deps = [
395     # Note: GYP lists some dependencies in addition to these actions. However,
396     # these are just dependencies for the actions themselves, which our actions
397     # list individually when needed.
398     "//chrome/browser:resources",
399     "//chrome/common:resources",
400     "//chrome/renderer:resources",
401   ]
403   if (enable_extensions) {
404     deps += [ "//chrome/common:extensions_api_resources" ]
405   }
408 # GYP version: chrome/chrome_resources.gyp:chrome_extra_resources
409 group("extra_resources") {
410   deps = [
411     "//chrome/browser/resources:invalidations_resources",
412     "//chrome/browser/resources:memory_internals_resources",
413     "//chrome/browser/resources:net_internals_resources",
414     "//chrome/browser/resources:password_manager_internals_resources",
415     "//chrome/browser/resources:signin_internals_resources",
416     "//chrome/browser/resources:sync_internals_resources",
417     "//chrome/browser/resources:translate_internals_resources",
418   ]
419   if (!is_ios) {
420     deps += [
421       "//chrome/browser/resources:component_extension_resources",
422       "//chrome/browser/resources:options_resources",
423       "//chrome/browser/resources:settings_resources",
424     ]
425   }
427   if (is_chromeos) {
428     deps += [ "//chrome/browser/resources/chromeos/chromevox" ]
429   }
431   if (enable_extensions) {
432     deps += [
433       "//chrome/browser/resources:quota_internals_resources",
434       "//chrome/browser/resources:sync_file_system_internals_resources",
435     ]
436   }
439 if (is_chrome_branded) {
440   copy("default_apps") {
441     visibility = [ ":packed_resources" ]
442     sources = [
443       "browser/resources/default_apps/docs.crx",
444       "browser/resources/default_apps/drive.crx",
445       "browser/resources/default_apps/external_extensions.json",
446       "browser/resources/default_apps/gmail.crx",
447       "browser/resources/default_apps/search.crx",
448       "browser/resources/default_apps/youtube.crx",
449     ]
450     outputs = [
451       "$root_out_dir/default_apps/{{source_file_part}}",
452     ]
453   }
456 group("packed_resources") {
457   deps = [
458     ":repack_locales_pack",
459     ":repack_pseudo_locales_pack",
460     ":repack_chrome_100_percent",
461   ]
463   if (is_chrome_branded) {
464     deps += [ ":default_apps" ]
465   }
467   if (enable_hidpi) {
468     deps += [ ":repack_chrome_200_percent" ]
469   }
471   if (enable_topchrome_md) {
472     deps += [ ":repack_chrome_material_100_percent" ]
474     if (enable_hidpi) {
475       deps += [ ":repack_chrome_material_200_percent" ]
476     }
477   }
480 repack("packed_extra_resources") {
481   visibility = [ "./*" ]
482   sources = [
483     "$root_gen_dir/chrome/browser_resources.pak",
484     "$root_gen_dir/chrome/chrome_unscaled_resources.pak",
485     "$root_gen_dir/chrome/common_resources.pak",
486     "$root_gen_dir/chrome/invalidations_resources.pak",
487     "$root_gen_dir/chrome/memory_internals_resources.pak",
488     "$root_gen_dir/chrome/net_internals_resources.pak",
489     "$root_gen_dir/chrome/password_manager_internals_resources.pak",
490     "$root_gen_dir/chrome/signin_internals_resources.pak",
491     "$root_gen_dir/chrome/sync_internals_resources.pak",
492     "$root_gen_dir/chrome/translate_internals_resources.pak",
493     "$root_gen_dir/components/components_resources.pak",
494     "$root_gen_dir/net/net_resources.pak",
495     "$root_gen_dir/ui/resources/webui_resources.pak",
496   ]
497   deps = [
498     "//chrome/browser:resources",
499     "//chrome/app/theme:chrome_unscaled_resources",
500     "//chrome/common:resources",
501     "//chrome/browser/resources:invalidations_resources",
502     "//chrome/browser/resources:memory_internals_resources",
503     "//chrome/browser/resources:net_internals_resources",
504     "//chrome/browser/resources:password_manager_internals_resources",
505     "//chrome/browser/resources:signin_internals_resources",
506     "//chrome/browser/resources:sync_internals_resources",
507     "//chrome/browser/resources:translate_internals_resources",
508     "//components/resources",
509     "//net:net_resources",
510     "//ui/resources",
511   ]
513   if (!is_ios && !is_android) {
514     # New paks should be added here by default.
515     sources += [
516       "$root_gen_dir/blink/devtools_resources.pak",
517       "$root_gen_dir/chrome/component_extension_resources.pak",
518       "$root_gen_dir/chrome/options_resources.pak",
519       "$root_gen_dir/chrome/quota_internals_resources.pak",
520       "$root_gen_dir/chrome/settings_resources.pak",
521       "$root_gen_dir/chrome/sync_file_system_internals_resources.pak",
522       "$root_gen_dir/chrome/webrtc_device_provider_resources.pak",
523     ]
524     deps += [
525       "//chrome/browser/devtools:webrtc_device_provider_resources",
526       "//chrome/browser/resources:component_extension_resources",
527       "//chrome/browser/resources:options_resources",
528       "//chrome/browser/resources:settings_resources",
529       "//chrome/browser/resources:quota_internals_resources",
530       "//chrome/browser/resources:sync_file_system_internals_resources",
531       "//content/browser/devtools:devtools_resources",
532     ]
533   }
534   if (!is_ios) {
535     sources += [
536       "$root_gen_dir/blink/public/resources/blink_resources.pak",
537       "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
538       "$root_gen_dir/content/content_resources.pak",
539     ]
540     deps += [
541       "//content:resources",
542       "//content/browser/tracing:resources",
543       "//third_party/WebKit/public:resources",
544     ]
545   }
546   if (is_chromeos) {
547     sources += [ "$root_gen_dir/ui/file_manager/file_manager_resources.pak" ]
548     deps += [ "//ui/file_manager:resources" ]
549   }
550   if (enable_extensions) {
551     sources += [
552       "$root_gen_dir/chrome/extensions_api_resources.pak",
553       "$root_gen_dir/extensions/extensions_renderer_resources.pak",
554       "$root_gen_dir/extensions/extensions_resources.pak",
555     ]
556     deps += [
557       "//chrome/common:extensions_api_resources",
558       "//extensions:extensions_resources",
559     ]
560   }
562   # GYP outputs the file in the gen/repack directory. On non-Mac/iOS platforms
563   # it them copies it. This skipes the copy step and writes it to the final
564   # location.
565   if (is_mac || is_ios) {
566     output = "$root_gen_dir/repack/resources.pak"
567   } else {
568     output = "$root_out_dir/resources.pak"
569   }
572 # GYP version: chrome/chrome_resources.gyp:browser_tests_pak
573 repack("browser_tests_pak") {
574   sources = [
575     "$root_gen_dir/chrome/options_test_resources.pak",
576   ]
577   output = "$root_out_dir/browser_tests.pak"
578   deps = [
579     "//chrome/browser/resources:options_test_resources",
580   ]
583 # Collects per-locale grit files from many sources into global per-locale files.
584 chrome_repack_locales("repack_locales_pack") {
585   visibility = [ ":*" ]
587   input_locales = locales
589   if (is_mac) {
590     output_locales = locales_as_mac_outputs
591   } else {
592     output_locales = locales
593   }
596 chrome_repack_locales("repack_pseudo_locales_pack") {
597   visibility = [ ":*" ]
599   input_locales = [ "fake-bidi" ]
601   if (is_mac) {
602     output_locales = [ "fake_bidi" ]  # Mac uses underscores.
603   } else {
604     output_locales = [ "fake-bidi" ]
605   }
608 # Generates a rule to repack a set of resources, substituting a given string
609 # in for the percentage (e.g. "100", "200"). It generates the repacked files in
610 # the "gen" directory, and then introduces a copy rule to copy it to the root
611 # build directory.
613 # It's not clear why this two-step dance is necessary as opposed to just
614 # generating the file in the destination. However, this is what the GYP build
615 # does, and for maintenance purposes, this keeps the same files in the same
616 # place between the two builds when possible.
618 # Argument:
619 #   percent [required]
620 #      String to substitute for the percentage.
621 template("chrome_repack_percent") {
622   percent = invoker.percent
624   repack_name = "${target_name}_repack"
625   repack_output_file = "$root_gen_dir/repack/chrome_${percent}_percent.pak"
627   copy_name = target_name
629   repack(repack_name) {
630     visibility = [ ":$copy_name" ]
632     # All sources should also have deps for completeness.
633     sources = [
634       "$root_gen_dir/chrome/renderer_resources_${percent}_percent.pak",
635       "$root_gen_dir/chrome/theme_resources_${percent}_percent.pak",
636       "$root_gen_dir/components/components_resources_${percent}_percent.pak",
637       "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak",
638     ]
640     deps = [
641       "//chrome/app/theme:theme_resources",
642       "//chrome/renderer:resources",
643       "//components/resources",
644       "//components/strings",
645       "//net:net_resources",
646       "//ui/resources",
647     ]
649     if (!is_ios) {
650       sources += [
651         "$root_gen_dir/blink/public/resources/blink_image_resources_${percent}_percent.pak",
652         "$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak",
653       ]
654       deps += [
655         "//content/app/resources",
656         "//third_party/WebKit/public:image_resources",
657       ]
658     }
659     if (use_ash) {
660       sources +=
661           [ "$root_gen_dir/ash/resources/ash_resources_${percent}_percent.pak" ]
662       deps += [ "//ash/resources" ]
663     }
664     if (toolkit_views) {
665       sources += [ "$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak" ]
666       deps += [ "//ui/views/resources" ]
667     }
668     if (is_chromeos) {
669       sources += [ "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_percent.pak" ]
670       deps += [ "//ui/chromeos/resources" ]
671     }
672     if (enable_extensions) {
673       sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ]
674       deps += [ "//extensions:extensions_browser_resources" ]
675     }
677     output = repack_output_file
678   }
680   copy(copy_name) {
681     visibility = [ ":*" ]
682     deps = [
683       ":$repack_name",
684     ]
685     sources = [
686       repack_output_file,
687     ]
688     outputs = [
689       "$root_build_dir/chrome_${percent}_percent.pak",
690     ]
691   }
694 chrome_repack_percent("repack_chrome_100_percent") {
695   percent = "100"
698 if (enable_hidpi) {
699   chrome_repack_percent("repack_chrome_200_percent") {
700     percent = "200"
701   }
704 # Generates a rule to repack a set of material design resources for the browser
705 # top chrome, substituting a given string in for the percentage (e.g. "100",
706 # "200").
707 template("chrome_repack_material_percent") {
708   percent = invoker.percent
710   repack_name = "${target_name}_repack"
711   repack_output_file =
712       "$root_gen_dir/repack/chrome_material_${percent}_percent.pak"
714   copy_name = target_name
716   repack(repack_name) {
717     visibility = [ ":$copy_name" ]
719     # All sources should also have deps for completeness.
720     sources = [
721       "$root_gen_dir/chrome/theme_resources_material_${percent}_percent.pak",
722     ]
724     deps = [
725       "//chrome/app/theme:theme_resources",
726     ]
728     output = repack_output_file
729   }
731   copy(copy_name) {
732     visibility = [ ":*" ]
733     deps = [
734       ":$repack_name",
735     ]
736     sources = [
737       repack_output_file,
738     ]
739     outputs = [
740       "$root_build_dir/chrome_material_${percent}_percent.pak",
741     ]
742   }
745 if (enable_topchrome_md) {
746   chrome_repack_material_percent("repack_chrome_material_100_percent") {
747     percent = "100"
748   }
750   if (enable_hidpi) {
751     chrome_repack_material_percent("repack_chrome_material_200_percent") {
752       percent = "200"
753     }
754   }
757 # GYP version: chrome/chrome_resources.gyp:chrome_strings
758 group("strings") {
759   deps = [
760     "//chrome/app:chromium_strings",
761     "//chrome/app:generated_resources",
762     "//chrome/app:google_chrome_strings",
763     "//chrome/app/resources:locale_settings",
764   ]
767 if (is_android) {
768   # GYP: //chrome/chrome.gyp:content_setting_java
769   java_cpp_enum("content_setting_javagen") {
770     sources = [
771       "../components/content_settings/core/common/content_settings.h",
772     ]
773     outputs = [
774       "org/chromium/chrome/browser/ContentSetting.java",
775     ]
776   }
778   # GYP: //chrome/chrome.gyp:content_settings_type_java
779   java_cpp_enum("content_settings_type_javagen") {
780     sources = [
781       "../components/content_settings/core/common/content_settings_types.h",
782     ]
783     outputs = [
784       "org/chromium/chrome/browser/ContentSettingsType.java",
785     ]
786   }
788   # GYP: //chrome/chrome.gyp:page_info_connection_type_java
789   java_cpp_enum("page_info_connection_type_javagen") {
790     sources = [
791       "browser/ui/android/website_settings_popup_android.h",
792     ]
793     outputs = [
794       "org/chromium/chrome/browser/PageInfoConnectionType.java",
795     ]
796   }
798   # GYP: //chrome/chrome_android.gypi:chrome_android_core
799   static_library("chrome_android_core") {
800     sources = [
801       "app/android/chrome_android_initializer.cc",
802       "app/android/chrome_android_initializer.h",
803       "app/android/chrome_jni_onload.cc",
804       "app/android/chrome_jni_onload.h",
805       "app/android/chrome_main_delegate_android.cc",
806       "app/android/chrome_main_delegate_android.h",
807       "app/chrome_main_delegate.cc",
808       "app/chrome_main_delegate.h",
809     ]
811     include_dirs = [ android_ndk_include_dir ]
813     libs = [
814       "android",
815       "jnigraphics",
816     ]
818     deps = [
819       "//chrome/browser",
820       "//chrome/browser/ui",
821       "//chrome/child",
822       "//chrome/plugin",
823       "//chrome/renderer",
824       "//chrome/utility",
825       "//components/enhanced_bookmarks",
826       "//content/public/app:both",
827     ]
828   }
831 if (is_linux) {
832   action("manpage") {
833     if (is_chrome_branded) {
834       name = "Google Chrome"
835       filename = "google-chrome"
836       confdir = "google-chrome"
837     } else {
838       name = "Chromium"
839       filename = "chromium-browser"
840       confdir = "chromium"
841     }
843     script = "//chrome/tools/build/linux/sed.py"
844     infile = "app/resources/manpage.1.in"
845     inputs = [
846       infile,
847     ]
849     outfile = "$root_out_dir/chrome.1"
850     outputs = [
851       outfile,
852     ]
854     args = [
855       rebase_path(infile, root_build_dir),
856       rebase_path(outfile, root_build_dir),
857       "-e s/@@NAME@@/$name/",
858       "-e s/@@FILENAME@@/$filename/",
859       "-e s/@@CONFDIR@@/$confdir/",
860     ]
861   }
863   action("linux_symbols") {
864     script = "//build/linux/dump_app_syms.py"
866     dump_syms_label = "//breakpad:dump_syms($host_toolchain)"
867     dump_syms_binary =
868         get_label_info(dump_syms_label, "root_out_dir") + "/" + "dump_syms"
870     chrome_binary = "$root_out_dir/chrome"
871     if (current_cpu == "x86") {
872       # Use "ia32" instead of "x86" for GYP compat.
873       symbol_file = "$root_out_dir/chrome.breakpad.ia32"
874     } else {
875       symbol_file = "$root_out_dir/chrome.breakpad.$current_cpu"
876     }
878     inputs = [
879       chrome_binary,
880       dump_syms_binary,
881     ]
882     outputs = [
883       symbol_file,
884     ]
886     args = [
887       "./" + rebase_path(dump_syms_binary, root_build_dir),
888       "0",  # TODO(GYP) This is linux_strip_binary if it is needed.
889       rebase_path(chrome_binary, root_build_dir),
890       rebase_path(symbol_file, root_build_dir),
891     ]
893     deps = [
894       ":chrome",
895       dump_syms_label,
896     ]
897   }