Upstream oodles of Chrome for Android code into Chromium.
[chromium-blink-merge.git] / chrome / BUILD.gn
blob4f962b7902bf2b70326a22a79bc469c993d61f14
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         "app/chrome_crash_reporter_client.cc",
38         "app/chrome_crash_reporter_client.h",
39         "app/chrome_exe.rc",
40         "app/chrome_exe_load_config_win.cc",
41         "app/chrome_exe_main_win.cc",
42         "app/chrome_watcher_client_win.cc",
43         "app/chrome_watcher_client_win.h",
44         "app/chrome_watcher_command_line_win.cc",
45         "app/chrome_watcher_command_line_win.h",
46         "app/client_util.cc",
47         "app/client_util.h",
48         "app/kasko_client.cc",
49         "app/kasko_client.h",
50         "app/signature_validator_win.cc",
51         "app/signature_validator_win.h",
52         "common/crash_keys.cc",
53         "common/crash_keys.h'",
54       ]
56       if (is_component_build) {
57         # This is necessary to make content_switches compile without DLL
58         # linkage errors in a component build.
59         defines += [ "COMPILE_CONTENT_STATICALLY" ]
60       }
62       deps += [
63         ":chrome_exe_version",
64         ":image_pre_reader",
65         ":main_dll",
67         # 'chrome_nacl_win64" TODO(GYP)
68         # '../win8/delegate_execute/delegate_execute.gyp:*', TODO(GYP)
69         # '../win8/metro_driver/metro_driver.gyp:metro_driver', TODO(GYP)
70         "//base",
71         "//breakpad:breakpad_handler",
72         "//breakpad:breakpad_sender",
73         "//chrome/browser:chrome_process_finder",
74         "//chrome/chrome_watcher",
75         "//chrome/chrome_watcher:client",
76         "//chrome/installer/util",
77         "//chrome_elf",
78         "//components/browser_watcher:browser_watcher_client",
79         "//components/crash/app",
80         "//content:startup_helper_win",
81         "//crypto",
82         "//sandbox",
83         "//ui/gfx",
84       ]
85       libs = [
86         "wintrust.lib",
87         "crypt32.lib",
88       ]
89       configs -= [ "//build/config/win:console" ]
90       configs += [ "//build/config/win:windowed" ]
91     } else if (use_aura) {
92       # Non-Windows aura entrypoint.
93       sources += [ "app/chrome_exe_main_aura.cc" ]
94     }
96     if (is_linux) {
97       sources += [
98         "app/chrome_dll_resource.h",
99         "app/chrome_main.cc",
100         "app/chrome_main_delegate.cc",
101         "app/chrome_main_delegate.h",
102       ]
104       deps += [
105         # On Linux, link the dependencies (libraries) that make up actual
106         # Chromium functionality directly into the executable.
107         ":browser_dependencies",
108         ":child_dependencies",
109         ":manpage",
110         "//base/allocator",
112         # Needed to use the master_preferences functions
113         "//chrome/installer/util",
114         "//content/public/app:both",
115       ]
117       # Needed for chrome_main.cc initialization of libraries.
118       configs += [ "//build/config/linux:pangocairo" ]
120       # GYP has this in a 'profiling==0 and linux_disable_pie==0' condition.
121       # but GN doesn't have either of these flags.
122       ldflags = [ "-pie" ]
124       if (use_x11) {
125         configs += [
126           "//build/config/linux:x11",
127           "//build/config/linux:xext",
128         ]
129       }
130     }
132     if (is_mac) {
133       sources += [ "app/chrome_exe_main_mac.cc" ]
134       # TODO(GYP) lots more stuff in the is_mac block.
135     } else {  # Non-Mac.
136       deps += [
137         ":packed_extra_resources",
138         ":packed_resources",
139         "//components/startup_metric_utils",
141         # Precompiled plugins that need to get copied to the output directory.
142         # On Mac, internal plugins go inside the framework, so these
143         # dependencies are on chrome.dll.
144         "//third_party/adobe/flash:flapper_binaries",
145         "//third_party/widevine/cdm:widevinecdmadapter",
146       ]
147     }
149     if (is_linux && enable_plugins) {
150       deps += [ "//pdf" ]
151     }
153     if (is_multi_dll_chrome) {
154       defines += [ "CHROME_MULTIPLE_DLL" ]
155       data_deps += [ ":chrome_child" ]
156     }
157   }
158 }  # !is_android
160 shared_library("main_dll") {
161   configs += [ "//build/config/compiler:wexit_time_destructors" ]
162   defines = []
164   deps = [
165     ":browser_dependencies",
166     "//base/allocator",
167   ]
168   if (is_win) {
169     output_name = "chrome"
171     sources = [
172       "//base/win/dllmain.cc",
173       "app/chrome_command_ids.h",
174       "app/chrome_dll.rc",
175       "app/chrome_dll_resource.h",
176       "app/chrome_main.cc",
177       "app/chrome_main_delegate.cc",
178       "app/chrome_main_delegate.h",
179       "app/close_handle_hook_win.cc",
180       "app/close_handle_hook_win.h",
181       "app/delay_load_hook_win.cc",
182       "app/delay_load_hook_win.h",
183     ]
185     deps += [
186       ":chrome_dll_version",
187       "//base/trace_event/etw_manifest:chrome_events_win",
188       "//chrome/app/theme:chrome_unscaled_resources",
189       "//chrome_elf",
190       "//content/app/resources",
191       "//crypto",
192       "//net:net_resources",
193       "//third_party/wtl",
194       "//ui/views",
195     ]
196     if (enable_configuration_policy) {
197       deps += [ "//components/policy" ]
198     }
199     if (current_cpu == "x86") {
200       # Add a dependency to custom import library for user32 delay imports only
201       # in x86 builds.
202       #deps += [ 'chrome_user32_delay_imports' ]  TODO(GYP)
203     }
205     # This is a large module that can't do incremental linking in some cases.
206     configs -= [ "//build/config/win:default_incremental_linking" ]
207     configs += [ "//build/config/win:default_large_module_incremental_linking" ]
209     # TODO(GYP) Lots of VCLinkerTool stuff on Windows.
211     # TODO(GYP) chrome_pgo_phase on Windows.
212   }
214   if (use_aura) {
215     deps += [ "//ui/compositor" ]
216   }
218   if (is_multi_dll_chrome) {
219     defines += [ "CHROME_MULTIPLE_DLL_BROWSER" ]
220     deps += [ "//content/public/app:browser" ]
221   } else {
222     deps += [
223       ":child_dependencies",
224       "//content/public/app:both",
225     ]
226   }
228   if (cld_version == 0 || cld_version == 2) {
229     deps += [ "//third_party/cld_2" ]
230   }
232   if (is_mac) {
233     #['OS=="mac" and component!="shared_library"', {  TODO(GYP)
234     #  'includes': [ 'chrome_dll_bundle.gypi' ],
235     #}],
236     # TODO(GYP) Lots of other stuff in the OS=="mac" block.
237   }
239   if (enable_plugins && !is_multi_dll_chrome) {
240     deps += [ "//pdf" ]
241   }
244 if (is_multi_dll_chrome) {
245   shared_library("chrome_child") {
246     sources = [
247       "app/chrome_main.cc",
248       "app/chrome_main_delegate.cc",
249       "app/chrome_main_delegate.h",
250       "app/close_handle_hook_win.cc",
251       "app/close_handle_hook_win.h",
252     ]
254     configs += [ "//build/config/compiler:wexit_time_destructors" ]
255     defines = [ "CHROME_MULTIPLE_DLL_CHILD" ]
257     deps = [
258       ":child_dependencies",
259       ":chrome_dll_version",
260       "//chrome/browser/policy:path_parser",
261       "//content/public/app:child",
262     ]
264     if (is_win) {
265       deps += [ "//chrome_elf" ]
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 (enable_chromevox_next) {
428     deps += [
429       #'browser/resources/chromeos/chromevox2/chromevox.gyp:chromevox2',  TODO(GYP)
430     ]
431   } else {
432     deps += [
433       #'browser/resources/chromeos/chromevox/chromevox.gyp:chromevox',  TODO(GYP)
434     ]
435   }
437   if (enable_extensions) {
438     deps += [
439       "//chrome/browser/resources:quota_internals_resources",
440       "//chrome/browser/resources:sync_file_system_internals_resources",
441     ]
442   }
445 if (is_chrome_branded) {
446   copy("default_apps") {
447     visibility = [ ":packed_resources" ]
448     sources = [
449       "browser/resources/default_apps/docs.crx",
450       "browser/resources/default_apps/drive.crx",
451       "browser/resources/default_apps/external_extensions.json",
452       "browser/resources/default_apps/gmail.crx",
453       "browser/resources/default_apps/search.crx",
454       "browser/resources/default_apps/youtube.crx",
455     ]
456     outputs = [
457       "$root_out_dir/default_apps/{{source_file_part}}",
458     ]
459   }
462 group("packed_resources") {
463   deps = [
464     ":repack_locales_pack",
465     ":repack_pseudo_locales_pack",
466     ":repack_chrome_100_percent",
467   ]
469   if (is_chrome_branded) {
470     deps += [ ":default_apps" ]
471   }
473   if (enable_hidpi) {
474     deps += [ ":repack_chrome_200_percent" ]
475   }
478 repack("packed_extra_resources") {
479   visibility = [ "./*" ]
480   sources = [
481     "$root_gen_dir/chrome/browser_resources.pak",
482     "$root_gen_dir/chrome/chrome_unscaled_resources.pak",
483     "$root_gen_dir/chrome/common_resources.pak",
484     "$root_gen_dir/chrome/invalidations_resources.pak",
485     "$root_gen_dir/chrome/memory_internals_resources.pak",
486     "$root_gen_dir/chrome/net_internals_resources.pak",
487     "$root_gen_dir/chrome/password_manager_internals_resources.pak",
488     "$root_gen_dir/chrome/signin_internals_resources.pak",
489     "$root_gen_dir/chrome/sync_internals_resources.pak",
490     "$root_gen_dir/chrome/translate_internals_resources.pak",
491     "$root_gen_dir/components/components_resources.pak",
492     "$root_gen_dir/net/net_resources.pak",
493     "$root_gen_dir/ui/resources/webui_resources.pak",
494   ]
495   deps = [
496     "//chrome/browser:resources",
497     "//chrome/app/theme:chrome_unscaled_resources",
498     "//chrome/common:resources",
499     "//chrome/browser/resources:invalidations_resources",
500     "//chrome/browser/resources:memory_internals_resources",
501     "//chrome/browser/resources:net_internals_resources",
502     "//chrome/browser/resources:password_manager_internals_resources",
503     "//chrome/browser/resources:signin_internals_resources",
504     "//chrome/browser/resources:sync_internals_resources",
505     "//chrome/browser/resources:translate_internals_resources",
506     "//components/resources",
507     "//net:net_resources",
508     "//ui/resources",
509   ]
511   if (!is_ios && !is_android) {
512     # New paks should be added here by default.
513     sources += [
514       "$root_gen_dir/blink/devtools_resources.pak",
515       "$root_gen_dir/chrome/component_extension_resources.pak",
516       "$root_gen_dir/chrome/options_resources.pak",
517       "$root_gen_dir/chrome/quota_internals_resources.pak",
518       "$root_gen_dir/chrome/settings_resources.pak",
519       "$root_gen_dir/chrome/sync_file_system_internals_resources.pak",
520       "$root_gen_dir/chrome/webrtc_device_provider_resources.pak",
521     ]
522     deps += [
523       "//chrome/browser/devtools:webrtc_device_provider_resources",
524       "//chrome/browser/resources:component_extension_resources",
525       "//chrome/browser/resources:options_resources",
526       "//chrome/browser/resources:settings_resources",
527       "//chrome/browser/resources:quota_internals_resources",
528       "//chrome/browser/resources:sync_file_system_internals_resources",
529       "//content/browser/devtools:devtools_resources",
530     ]
531   }
532   if (!is_ios) {
533     sources += [
534       "$root_gen_dir/blink/public/resources/blink_resources.pak",
535       "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
536       "$root_gen_dir/content/content_resources.pak",
537     ]
538   }
539   if (is_chromeos) {
540     sources += [ "$root_gen_dir/ui/file_manager/file_manager_resources.pak" ]
541     sources += [ "$root_gen_dir/ui/oobe/oobe_resources.pak" ]
542     deps += [ "//ui/file_manager:resources" ]
543     deps += [ "//ui/oobe:resources" ]
544   }
545   if (enable_extensions) {
546     sources += [
547       "$root_gen_dir/chrome/extensions_api_resources.pak",
548       "$root_gen_dir/extensions/extensions_renderer_resources.pak",
549       "$root_gen_dir/extensions/extensions_resources.pak",
550     ]
551     deps += [ "//chrome/common:extensions_api_resources" ]
552   }
554   # GYP outputs the file in the gen/repack directory. On non-Mac/iOS platforms
555   # it them copies it. This skipes the copy step and writes it to the final
556   # location.
557   if (is_mac || is_ios) {
558     output = "$root_gen_dir/repack/resources.pak"
559   } else {
560     output = "$root_out_dir/resources.pak"
561   }
564 # GYP version: chrome/chrome_resources.gyp:browser_tests_pak
565 repack("browser_tests_pak") {
566   sources = [
567     "$root_gen_dir/chrome/options_test_resources.pak",
568   ]
569   output = "$root_out_dir/browser_tests.pak"
572 # Collects per-locale grit files from many sources into global per-locale files.
573 chrome_repack_locales("repack_locales_pack") {
574   visibility = [ ":*" ]
576   input_locales = locales
578   if (is_mac) {
579     output_locales = locales_as_mac_outputs
580   } else {
581     output_locales = locales
582   }
585 chrome_repack_locales("repack_pseudo_locales_pack") {
586   visibility = [ ":*" ]
588   input_locales = [ "fake-bidi" ]
590   if (is_mac) {
591     output_locales = [ "fake_bidi" ]  # Mac uses underscores.
592   } else {
593     output_locales = [ "fake-bidi" ]
594   }
597 # Generates a rule to repack a set of resources, substituting a given string
598 # in for the percentage (e.g. "100", "200"). It generates the repacked files in
599 # the "gen" directory, and then introduces a copy rule to copy it to the root
600 # build directory.
602 # It's not clear why this two-step dance is necessary as opposed to just
603 # generating the file in the destination. However, this is what the GYP build
604 # does, and for maintenance purposes, this keeps the same files in the same
605 # place between the two builds when possible.
607 # Argument:
608 #   percent [required]
609 #      String to substitute for the percentage.
610 template("chrome_repack_percent") {
611   percent = invoker.percent
613   repack_name = "${target_name}_repack"
614   repack_output_file = "$root_gen_dir/repack/chrome_${percent}_percent.pak"
616   copy_name = target_name
618   repack(repack_name) {
619     visibility = [ ":$copy_name" ]
621     # All sources should also have deps for completeness.
622     sources = [
623       "$root_gen_dir/chrome/renderer_resources_${percent}_percent.pak",
624       "$root_gen_dir/chrome/theme_resources_${percent}_percent.pak",
625       "$root_gen_dir/components/components_resources_${percent}_percent.pak",
626       "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak",
627     ]
629     deps = [
630       "//chrome/app/theme:theme_resources",
631       "//chrome/renderer:resources",
632       "//components/strings",
633       "//net:net_resources",
634     ]
636     if (!is_ios) {
637       sources += [
638         "$root_gen_dir/blink/public/resources/blink_image_resources_${percent}_percent.pak",
639         "$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak",
640       ]
641       deps += [ "//content:resources" ]
642     }
643     if (use_ash) {
644       sources +=
645           [ "$root_gen_dir/ash/resources/ash_resources_${percent}_percent.pak" ]
646       deps += [ "//ash/resources" ]
647     }
648     if (is_chromeos) {
649       sources += [ "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_percent.pak" ]
650       deps += [ "//ui/chromeos/resources" ]
651     }
652     if (enable_extensions) {
653       sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ]
654     }
656     output = repack_output_file
657   }
659   copy(copy_name) {
660     visibility = [ ":*" ]
661     deps = [
662       ":$repack_name",
663     ]
664     sources = [
665       repack_output_file,
666     ]
667     outputs = [
668       "$root_build_dir/chrome_${percent}_percent.pak",
669     ]
670   }
673 chrome_repack_percent("repack_chrome_100_percent") {
674   percent = "100"
677 if (enable_hidpi) {
678   chrome_repack_percent("repack_chrome_200_percent") {
679     percent = "200"
680   }
683 # GYP version: chrome/chrome_resources.gyp:chrome_strings
684 group("strings") {
685   deps = [
686     "//chrome/app:chromium_strings",
687     "//chrome/app:generated_resources",
688     "//chrome/app:google_chrome_strings",
689     "//chrome/app/resources:locale_settings",
690   ]
693 if (is_android) {
694   # GYP: //chrome/chrome.gyp:content_setting_java
695   java_cpp_enum("content_setting_javagen") {
696     sources = [
697       "../components/content_settings/core/common/content_settings.h",
698     ]
699     outputs = [
700       "org/chromium/chrome/browser/ContentSetting.java",
701     ]
702   }
704   # GYP: //chrome/chrome.gyp:content_settings_type_java
705   java_cpp_enum("content_settings_type_javagen") {
706     sources = [
707       "../components/content_settings/core/common/content_settings_types.h",
708     ]
709     outputs = [
710       "org/chromium/chrome/browser/ContentSettingsType.java",
711     ]
712   }
714   # GYP: //chrome/chrome.gyp:page_info_connection_type_java
715   java_cpp_enum("page_info_connection_type_javagen") {
716     sources = [
717       "browser/ui/android/website_settings_popup_android.h",
718     ]
719     outputs = [
720       "org/chromium/chrome/browser/PageInfoConnectionType.java",
721     ]
722   }
724   # GYP: //chrome/chrome_android.gypi:chrome_android_core
725   static_library("chrome_android_core") {
726     sources = [
727       "app/android/chrome_android_initializer.cc",
728       "app/android/chrome_android_initializer.h",
729       "app/android/chrome_jni_onload.cc",
730       "app/android/chrome_jni_onload.h",
731       "app/android/chrome_main_delegate_android.cc",
732       "app/android/chrome_main_delegate_android.h",
733       "app/chrome_main_delegate.cc",
734       "app/chrome_main_delegate.h",
735     ]
737     include_dirs = [ android_ndk_include_dir ]
739     libs = [
740       "android",
741       "jnigraphics",
742     ]
744     deps = [
745       "//chrome/browser",
746       "//chrome/browser/ui",
747       "//chrome/child",
748       "//chrome/plugin",
749       "//chrome/renderer",
750       "//chrome/utility",
751       "//components/enhanced_bookmarks",
752       "//content/public/app:both",
753     ]
754   }
757 if (is_linux) {
758   action("manpage") {
759     if (is_chrome_branded) {
760       name = "Google Chrome"
761       filename = "google-chrome"
762       confdir = "google-chrome"
763     } else {
764       name = "Chromium"
765       filename = "chromium-browser"
766       confdir = "chromium"
767     }
769     script = "//chrome/tools/build/linux/sed.py"
770     infile = "app/resources/manpage.1.in"
771     inputs = [
772       infile,
773     ]
775     outfile = "$root_out_dir/chrome.1"
776     outputs = [
777       outfile,
778     ]
780     args = [
781       rebase_path(infile, root_build_dir),
782       rebase_path(outfile, root_build_dir),
783       "-e s/@@NAME@@/$name/",
784       "-e s/@@FILENAME@@/$filename/",
785       "-e s/@@CONFDIR@@/$confdir/",
786     ]
787   }