Refactor management of overview window copy lifetime into a separate class.
[chromium-blink-merge.git] / content / content_shell.gypi
blob0895c2c7e230bacd8d77e95ed5b1350e407f9228
1 # Copyright (c) 2012 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.
6   'variables': {
7     'content_shell_product_name': 'Content Shell',
8     # The "19" is so that sites that sniff for version think that this is
9     # something reasonably current; the "77.34.5" is a hint that this isn't a
10     # standard Chrome.
11     'content_shell_version': '19.77.34.5',
12     'conditions': [
13       ['OS=="linux"', {
14        'use_custom_freetype%': 1,
15       }, {
16        'use_custom_freetype%': 0,
17       }],
18     ],
19   },
20   'targets': [
21     {
22       'target_name': 'content_shell_lib',
23       'type': 'static_library',
24       'defines': ['CONTENT_SHELL_VERSION="<(content_shell_version)"'],
25       'variables': {
26         'chromium_code': 1,
27       },
28       'dependencies': [
29         'content.gyp:content_app_both',
30         'content.gyp:content_browser',
31         'content.gyp:content_common',
32         'content.gyp:content_gpu',
33         'content.gyp:content_plugin',
34         'content.gyp:content_ppapi_plugin',
35         'content.gyp:content_renderer',
36         'content.gyp:content_utility',
37         'content.gyp:content_worker',
38         'content_shell_resources',
39         'test_support_content',
40         'content_resources.gyp:content_resources',
41         '../base/base.gyp:base',
42         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
43         '../components/components.gyp:breakpad_component',
44         '../ipc/ipc.gyp:ipc',
45         '../media/media.gyp:media',
46         '../net/net.gyp:net',
47         '../net/net.gyp:net_resources',
48         '../skia/skia.gyp:skia',
49         '../third_party/WebKit/public/blink_test_runner.gyp:blink_test_runner',
50         '../ui/events/events.gyp:events',
51         '../ui/gfx/gfx.gyp:gfx',
52         '../ui/gl/gl.gyp:gl',
53         '../ui/ui.gyp:ui',
54         '../url/url.gyp:url_lib',
55         '../v8/tools/gyp/v8.gyp:v8',
56         '../webkit/common/user_agent/webkit_user_agent.gyp:user_agent',
57         '../webkit/common/webkit_common.gyp:webkit_common',
58         '../webkit/glue/webkit_glue.gyp:glue',
59         '../webkit/webkit_resources.gyp:webkit_resources',
60       ],
61       'include_dirs': [
62         '..',
63       ],
64       'sources': [
65         'shell/android/shell_jni_registrar.cc',
66         'shell/android/shell_jni_registrar.h',
67         'shell/android/shell_manager.cc',
68         'shell/android/shell_manager.h',
69         'shell/app/paths_mac.h',
70         'shell/app/paths_mac.mm',
71         'shell/app/shell_breakpad_client.cc',
72         'shell/app/shell_breakpad_client.h',
73         'shell/app/shell_main_delegate.cc',
74         'shell/app/shell_main_delegate.h',
75         'shell/app/shell_main_delegate_mac.h',
76         'shell/app/shell_main_delegate_mac.mm',
77         'shell/app/webkit_test_platform_support_android.cc',
78         'shell/app/webkit_test_platform_support.h',
79         'shell/app/webkit_test_platform_support_linux.cc',
80         'shell/app/webkit_test_platform_support_mac.mm',
81         'shell/app/webkit_test_platform_support_win.cc',
82         'shell/browser/notify_done_forwarder.cc',
83         'shell/browser/notify_done_forwarder.h',
84         'shell/browser/shell_android.cc',
85         'shell/browser/shell_application_mac.h',
86         'shell/browser/shell_application_mac.mm',
87         'shell/browser/shell_aura.cc',
88         'shell/browser/shell_browser_context.cc',
89         'shell/browser/shell_browser_context.h',
90         'shell/browser/shell_browser_main.cc',
91         'shell/browser/shell_browser_main.h',
92         'shell/browser/shell_browser_main_parts.cc',
93         'shell/browser/shell_browser_main_parts.h',
94         'shell/browser/shell_browser_main_parts_mac.mm',
95         'shell/browser/shell.cc',
96         'shell/browser/shell_content_browser_client.cc',
97         'shell/browser/shell_content_browser_client.h',
98         'shell/browser/shell_devtools_delegate.cc',
99         'shell/browser/shell_devtools_delegate.h',
100         'shell/browser/shell_devtools_frontend.cc',
101         'shell/browser/shell_devtools_frontend.h',
102         'shell/browser/shell_download_manager_delegate.cc',
103         'shell/browser/shell_download_manager_delegate.h',
104         'shell/browser/shell_gtk.cc',
105         'shell/browser/shell.h',
106         'shell/browser/shell_javascript_dialog_gtk.cc',
107         'shell/browser/shell_javascript_dialog.h',
108         'shell/browser/shell_javascript_dialog_mac.mm',
109         'shell/browser/shell_javascript_dialog_manager.cc',
110         'shell/browser/shell_javascript_dialog_manager.h',
111         'shell/browser/shell_javascript_dialog_win.cc',
112         'shell/browser/shell_layout_tests_android.cc',
113         'shell/browser/shell_layout_tests_android.h',
114         'shell/browser/shell_login_dialog.cc',
115         'shell/browser/shell_login_dialog_gtk.cc',
116         'shell/browser/shell_login_dialog.h',
117         'shell/browser/shell_login_dialog_mac.mm',
118         'shell/browser/shell_mac.mm',
119         'shell/browser/shell_message_filter.cc',
120         'shell/browser/shell_message_filter.h',
121         'shell/browser/shell_net_log.cc',
122         'shell/browser/shell_net_log.h',
123         'shell/browser/shell_network_delegate.cc',
124         'shell/browser/shell_network_delegate.h',
125         'shell/browser/shell_plugin_service_filter.cc',
126         'shell/browser/shell_plugin_service_filter.h',
127         'shell/browser/shell_quota_permission_context.cc',
128         'shell/browser/shell_quota_permission_context.h',
129         'shell/browser/shell_resource_dispatcher_host_delegate.cc',
130         'shell/browser/shell_resource_dispatcher_host_delegate.h',
131         'shell/browser/shell_speech_recognition_manager_delegate.cc',
132         'shell/browser/shell_speech_recognition_manager_delegate.h',
133         'shell/browser/shell_url_request_context_getter.cc',
134         'shell/browser/shell_url_request_context_getter.h',
135         'shell/browser/shell_views.cc',
136         'shell/browser/shell_web_contents_view_delegate_android.cc',
137         'shell/browser/shell_web_contents_view_delegate_creator.h',
138         'shell/browser/shell_web_contents_view_delegate_gtk.cc',
139         'shell/browser/shell_web_contents_view_delegate.h',
140         'shell/browser/shell_web_contents_view_delegate_mac.mm',
141         'shell/browser/shell_web_contents_view_delegate_win.cc',
142         'shell/browser/shell_win.cc',
143         'shell/browser/webkit_test_controller.cc',
144         'shell/browser/webkit_test_controller.h',
145         'shell/common/shell_content_client.cc',
146         'shell/common/shell_content_client.h',
147         'shell/common/shell_messages.cc',
148         'shell/common/shell_messages.h',
149         'shell/common/shell_switches.cc',
150         'shell/common/shell_switches.h',
151         'shell/common/shell_test_configuration.cc',
152         'shell/common/shell_test_configuration.h',
153         'shell/common/webkit_test_helpers.cc',
154         'shell/common/webkit_test_helpers.h',
155         'shell/geolocation/shell_access_token_store.cc',
156         'shell/geolocation/shell_access_token_store.h',
157         'shell/renderer/gc_extension.cc',
158         'shell/renderer/gc_extension.h',
159         'shell/renderer/shell_content_renderer_client.cc',
160         'shell/renderer/shell_content_renderer_client.h',
161         'shell/renderer/shell_render_process_observer.cc',
162         'shell/renderer/shell_render_process_observer.h',
163         'shell/renderer/shell_render_view_observer.cc',
164         'shell/renderer/shell_render_view_observer.h',
165         'shell/renderer/webkit_test_runner.cc',
166         'shell/renderer/webkit_test_runner.h',
167       ],
168       'msvs_settings': {
169         'VCLinkerTool': {
170           'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
171         },
172       },
173       'conditions': [
174         ['OS=="win" and win_use_allocator_shim==1', {
175           'dependencies': [
176             '../base/allocator/allocator.gyp:allocator',
177           ],
178         }],
179         ['OS=="win"', {
180           'resource_include_dirs': [
181             '<(SHARED_INTERMEDIATE_DIR)/webkit',
182           ],
183           'dependencies': [
184             '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings',
185           ],
186           'configurations': {
187             'Debug_Base': {
188               'msvs_settings': {
189                 'VCLinkerTool': {
190                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
191                 },
192               },
193             },
194           },
195           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
196           'msvs_disabled_warnings': [ 4267, ],
197         }],  # OS=="win"
198         ['OS=="linux"', {
199           'dependencies': [
200             '../build/linux/system.gyp:fontconfig',
201           ],
202         }],
203         ['OS=="android"', {
204           'dependencies': [
205             'content_shell_jni_headers',
206           ],
207         }, {  # else: OS!="android"
208           'dependencies': [
209             # This dependency is for running DRT against the content shell, and
210             # this combination is not yet supported on Android.
211             'test_support_content',
212           ],
213         }],  # OS=="android"
214         ['os_posix == 1 and OS != "mac" and android_webview_build != 1', {
215           'dependencies': [
216             '../components/components.gyp:breakpad_host',
217           ],
218         }],
219         ['(os_posix==1 and use_aura==1 and linux_use_tcmalloc==1) or (android_use_tcmalloc==1)', {
220           'dependencies': [
221             # This is needed by content/app/content_main_runner.cc
222             '../base/allocator/allocator.gyp:allocator',
223           ],
224         }],
225         ['use_aura==1', {
226           'dependencies': [
227             '../ui/aura/aura.gyp:aura',
228             '../ui/base/strings/ui_strings.gyp:ui_strings',
229           ],
230           'sources/': [
231             ['exclude', 'shell/browser/shell_gtk.cc'],
232             ['exclude', 'shell/browser/shell_win.cc'],
233           ],
234           'conditions': [
235             ['toolkit_views==1', {
236               'dependencies': [
237                 '../ui/views/controls/webview/webview.gyp:webview',
238                 '../ui/views/views.gyp:views',
239                 '../ui/views/views.gyp:views_test_support',
240                 '../ui/ui.gyp:ui_resources',
241               ],
242               'sources/': [
243                 ['exclude', 'shell/browser/shell_aura.cc'],
244               ],
245             }, {
246               'sources/': [
247                 ['exclude', 'shell/browser/shell_views.cc'],
248               ],
249             }],
250           ],
251         }, {
252           'sources/': [
253             ['exclude', 'shell/browser/shell_aura.cc'],
254             ['exclude', 'shell/browser/shell_views.cc'],
255           ],
256         }],  # use_aura==1
257         ['chromeos==1', {
258           'dependencies': [
259             '../chromeos/chromeos.gyp:chromeos',
260             '../ui/shell/shell.gyp:shell',
261            ],
262         }], # chromeos==1
263         ['use_ash==1', {
264           'dependencies': [
265             '../ash/ash.gyp:ash',
266            ],
267         }],
268         ['use_custom_freetype==1', {
269           'dependencies': [
270              '../third_party/freetype2/freetype2.gyp:freetype2',
271           ],
272         }],
273         ['enable_plugins==0', {
274           'sources/': [
275             ['exclude', 'shell/browser/shell_plugin_service_filter.cc'],
276             ['exclude', 'shell/browser/shell_plugin_service_filter.h'],
277           ],
278         }]
279       ],
280     },
281     {
282       'target_name': 'content_shell_resources',
283       'type': 'none',
284       'dependencies': [
285         'generate_content_shell_resources',
286       ],
287       'variables': {
288         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/content',
289       },
290       'includes': [ '../build/grit_target.gypi' ],
291       'copies': [
292         {
293           'destination': '<(PRODUCT_DIR)',
294           'files': [
295             '<(SHARED_INTERMEDIATE_DIR)/content/shell_resources.pak'
296           ],
297         },
298       ],
299     },
300     {
301       'target_name': 'generate_content_shell_resources',
302       'type': 'none',
303       'variables': {
304         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/content',
305       },
306       'actions': [
307         {
308           'action_name': 'content_shell_resources',
309           'variables': {
310             'grit_grd_file': 'shell/shell_resources.grd',
311           },
312           'includes': [ '../build/grit_action.gypi' ],
313         },
314       ],
315     },
316     {
317       # We build a minimal set of resources so WebKit in content_shell has
318       # access to necessary resources.
319       'target_name': 'content_shell_pak',
320       'type': 'none',
321       'dependencies': [
322         'browser/devtools/devtools_resources.gyp:devtools_resources',
323         'content_resources.gyp:content_resources',
324         'content_shell_resources',
325         '<(DEPTH)/net/net.gyp:net_resources',
326         '<(DEPTH)/ui/base/strings/ui_strings.gyp:ui_strings',
327         '<(DEPTH)/ui/ui.gyp:ui_resources',
328         '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
329         '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings',
330       ],
331       'conditions': [
332         ['OS!="android" and OS!="ios"', {
333           'dependencies': [
334             'browser/tracing/tracing_resources.gyp:tracing_resources',
335           ],
336         }],
337       ],
338       'variables': {
339         'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py',
340       },
341       'actions': [
342         {
343           'action_name': 'repack_content_shell_pack',
344           'variables': {
345             'pak_inputs': [
346               '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
347               '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.pak',
348               '<(SHARED_INTERMEDIATE_DIR)/content/shell_resources.pak',
349               '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
350               '<(SHARED_INTERMEDIATE_DIR)/ui/app_locale_settings/app_locale_settings_en-US.pak',
351               '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak',
352               '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/webui_resources.pak',
353               '<(SHARED_INTERMEDIATE_DIR)/ui/ui_strings/ui_strings_en-US.pak',
354               '<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak',
355               '<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.pak',
356               '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak',
357               '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak',
358             ],
359           },
360           'inputs': [
361             '<(repack_path)',
362             '<@(pak_inputs)',
363           ],
364           'action': ['python', '<(repack_path)', '<@(_outputs)',
365                      '<@(pak_inputs)'],
366           'conditions': [
367             ['OS!="android"', {
368               'outputs': [
369                 '<(PRODUCT_DIR)/content_shell.pak',
370               ],
371             }, {
372               'outputs': [
373                 '<(PRODUCT_DIR)/content_shell/assets/content_shell.pak',
374               ],
375             }],
376           ],
377         },
378       ],
379     },
380     {
381       'target_name': 'content_shell',
382       'type': 'executable',
383       'mac_bundle': 1,
384       'variables': {
385         'chromium_code': 1,
386       },
387       'dependencies': [
388         'content_shell_lib',
389         'content_shell_pak',
390         '../third_party/mesa/mesa.gyp:osmesa',
391         '../tools/imagediff/image_diff.gyp:image_diff',
392       ],
393       'include_dirs': [
394         '..',
395       ],
396       'sources': [
397         'app/startup_helper_win.cc',
398         'shell/app/shell_main.cc',
399       ],
400       'mac_bundle_resources': [
401         'shell/app/app.icns',
402         'shell/app/app-Info.plist',
403       ],
404       # TODO(mark): Come up with a fancier way to do this.  It should only
405       # be necessary to list app-Info.plist once, not the three times it is
406       # listed here.
407       'mac_bundle_resources!': [
408         'shell/app/app-Info.plist',
409       ],
410       'xcode_settings': {
411         'INFOPLIST_FILE': 'shell/app/app-Info.plist',
412       },
413       'msvs_settings': {
414         'VCLinkerTool': {
415           'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
416         },
417         'VCManifestTool': {
418           'AdditionalManifestFiles': [
419             'shell/app/shell.exe.manifest',
420           ],
421         },
422       },
423       'conditions': [
424         ['OS=="win" and win_use_allocator_shim==1', {
425           'dependencies': [
426             '../base/allocator/allocator.gyp:allocator',
427           ],
428         }],
429         ['OS=="win"', {
430           'sources': [
431             'shell/app/shell.rc',
432           ],
433           'configurations': {
434             'Debug_Base': {
435               'msvs_settings': {
436                 'VCLinkerTool': {
437                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
438                 },
439               },
440             },
441           },
442         }],  # OS=="win"
443         ['OS == "win" or toolkit_uses_gtk == 1', {
444           'dependencies': [
445             '../sandbox/sandbox.gyp:sandbox',
446           ],
447         }],  # OS=="win" or toolkit_uses_gtk == 1
448         ['toolkit_uses_gtk == 1', {
449           'dependencies': [
450             '<(DEPTH)/build/linux/system.gyp:gtk',
451           ],
452         }],  # toolkit_uses_gtk
453         ['OS=="mac"', {
454           'product_name': '<(content_shell_product_name)',
455           'dependencies!': [
456             'content_shell_lib',
457           ],
458           'dependencies': [
459             'content_shell_framework',
460             'content_shell_helper_app',
461           ],
462           'copies': [
463             {
464               'destination': '<(PRODUCT_DIR)/<(content_shell_product_name).app/Contents/Frameworks',
465               'files': [
466                 '<(PRODUCT_DIR)/<(content_shell_product_name) Helper.app',
467               ],
468             },
469           ],
470           'postbuilds': [
471             {
472               'postbuild_name': 'Copy <(content_shell_product_name) Framework.framework',
473               'action': [
474                 '../build/mac/copy_framework_unversioned.sh',
475                 '${BUILT_PRODUCTS_DIR}/<(content_shell_product_name) Framework.framework',
476                 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Frameworks',
477               ],
478             },
479             {
480               'postbuild_name': 'Fix Framework Link',
481               'action': [
482                 'install_name_tool',
483                 '-change',
484                 '/Library/Frameworks/<(content_shell_product_name) Framework.framework/Versions/A/<(content_shell_product_name) Framework',
485                 '@executable_path/../Frameworks/<(content_shell_product_name) Framework.framework/<(content_shell_product_name) Framework',
486                 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
487               ],
488             },
489             {
490               # Modify the Info.plist as needed.
491               'postbuild_name': 'Tweak Info.plist',
492               'action': ['../build/mac/tweak_info_plist.py',
493                          '--scm=1',
494                          '--version=<(content_shell_version)'],
495             },
496             {
497               # This postbuid step is responsible for creating the following
498               # helpers:
499               #
500               # Content Shell Helper EH.app and Content Shell Helper NP.app are
501               # created from Content Shell Helper.app.
502               #
503               # The EH helper is marked for an executable heap. The NP helper
504               # is marked for no PIE (ASLR).
505               'postbuild_name': 'Make More Helpers',
506               'action': [
507                 '../build/mac/make_more_helpers.sh',
508                 'Frameworks',
509                 '<(content_shell_product_name)',
510               ],
511             },
512             {
513               # Make sure there isn't any Objective-C in the shell's
514               # executable.
515               'postbuild_name': 'Verify No Objective-C',
516               'action': [
517                 '../build/mac/verify_no_objc.sh',
518               ],
519             },
520           ],
521         }],  # OS=="mac"
522         ['OS=="android"', {
523           'dependencies!': [
524             '../tools/imagediff/image_diff.gyp:image_diff',
525           ],
526         }],  # OS=="android"
527         ['OS=="android" and android_webview_build==0', {
528           'dependencies': [
529             '../tools/imagediff/image_diff.gyp:image_diff#host',
530           ],
531         }],  # OS=="android" and android_webview_build==0
532       ],
533     },
534     {
535       'target_name': 'content_shell_builder',
536       'type': 'none',
537       'dependencies': [
538         'content_shell',
539       ],
540     },
541     {
542       'target_name': 'content_shell_symbols',
543       'type': 'none',
544       'conditions': [
545         ['OS=="linux"', {
546           'actions': [
547             {
548               'action_name': 'dump_symbols',
549               'inputs': [
550                 '<(DEPTH)/components/breakpad/tools/generate_breakpad_symbols.py',
551                 '<(PRODUCT_DIR)/dump_syms',
552                 '<(PRODUCT_DIR)/content_shell',
553               ],
554               'outputs': [
555                 '<(PRODUCT_DIR)/content_shell.breakpad.<(target_arch)',
556               ],
557               'action': ['<(DEPTH)/components/breakpad/tools/generate_breakpad_symbols.py',
558                          '--dump-syms-dir=<(PRODUCT_DIR)',
559                          '--symbols-dir=<(PRODUCT_DIR)/content_shell.breakpad.<(target_arch)',
560                          '--binary=<(PRODUCT_DIR)/content_shell',
561                          '--clear'],
562               'message': 'Dumping breakpad symbols to <(_outputs)',
563             },
564           ],
565           'dependencies': [
566             'content_shell',
567             '../breakpad/breakpad.gyp:dump_syms',
568           ],
569         }],  # OS=="linux"
570         ['OS=="android"', {
571           'actions': [
572             {
573               'action_name': 'dump_symbols',
574               'inputs': [
575                 '<(DEPTH)/components/breakpad/tools/generate_breakpad_symbols.py',
576                 '<(PRODUCT_DIR)/dump_syms',
577                 '<(PRODUCT_DIR)/lib/libcontent_shell_content_view.so',
578               ],
579               'outputs': [
580                 '<(PRODUCT_DIR)/content_shell.breakpad.<(target_arch)',
581               ],
582               'action': ['<(DEPTH)/components/breakpad/tools/generate_breakpad_symbols.py',
583                          '--dump-syms-dir=<(PRODUCT_DIR)',
584                          '--symbols-dir=<(PRODUCT_DIR)/content_shell.breakpad.<(target_arch)',
585                          '--binary=<(PRODUCT_DIR)/lib/libcontent_shell_content_view.so',
586                          '--clear'],
587               'message': 'Dumping breakpad symbols to <(_outputs)',
588             },
589           ],
590           'dependencies': [
591             'libcontent_shell_content_view',
592             '../breakpad/breakpad.gyp:dump_syms#host',
593           ],
594         }],  # OS=="android"
595       ],
596     },
597   ],
598   'conditions': [
599     ['OS=="mac"', {
600       'targets': [
601         {
602           'target_name': 'content_shell_framework',
603           'type': 'shared_library',
604           'product_name': '<(content_shell_product_name) Framework',
605           'mac_bundle': 1,
606           'mac_bundle_resources': [
607             'shell/app/English.lproj/HttpAuth.xib',
608             'shell/app/English.lproj/MainMenu.xib',
609             '<(PRODUCT_DIR)/content_shell.pak',
610             'shell/app/framework-Info.plist',
611           ],
612           'mac_bundle_resources!': [
613             'shell/app/framework-Info.plist',
614           ],
615           'xcode_settings': {
616             'INFOPLIST_FILE': 'shell/app/framework-Info.plist',
617           },
618           'dependencies': [
619             'content_shell_lib',
620           ],
621           'include_dirs': [
622             '..',
623           ],
624           'sources': [
625             'shell/app/shell_content_main.cc',
626             'shell/app/shell_content_main.h',
627           ],
628          'postbuilds': [
629            {
630              # Modify the Info.plist as needed.  The script explains why
631              # this is needed.  This is also done in the chrome target.
632              # The framework needs the Breakpad keys if this feature is
633              # enabled.  It does not need the Keystone keys; these always
634              # come from the outer application bundle.  The framework
635              # doesn't currently use the SCM keys for anything,
636              # but this seems like a really good place to store them.
637              'postbuild_name': 'Tweak Info.plist',
638              'action': ['../build/mac/tweak_info_plist.py',
639                         '--breakpad=1',
640                         '--keystone=0',
641                         '--scm=1',
642                         '--version=<(content_shell_version)',
643                         '--branding=<(content_shell_product_name)'],
644            },
645          ],
646           'copies': [
647             {
648               # Copy FFmpeg binaries for audio/video support.
649               'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
650               'files': [
651                 '<(PRODUCT_DIR)/ffmpegsumo.so',
652               ],
653             },
654             {
655               'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Resources',
656               'files': [
657                 '<(PRODUCT_DIR)/crash_inspector',
658                 '<(PRODUCT_DIR)/crash_report_sender.app'
659               ],
660             },
661           ],
662           'conditions': [
663             ['enable_webrtc==1', {
664               'variables': {
665                 'libpeer_target_type%': 'static_library',
666               },
667               'conditions': [
668                 ['libpeer_target_type!="static_library"', {
669                   'copies': [{
670                    'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
671                    'files': [
672                       '<(PRODUCT_DIR)/libpeerconnection.so',
673                     ],
674                   }],
675                 }],
676               ],
677             }],
678           ],
679         },  # target content_shell_framework
680         {
681           'target_name': 'content_shell_helper_app',
682           'type': 'executable',
683           'variables': { 'enable_wexit_time_destructors': 1, },
684           'product_name': '<(content_shell_product_name) Helper',
685           'mac_bundle': 1,
686           'dependencies': [
687             'content_shell_framework',
688           ],
689           'sources': [
690             'shell/app/shell_main.cc',
691             'shell/app/helper-Info.plist',
692           ],
693           # TODO(mark): Come up with a fancier way to do this.  It should only
694           # be necessary to list helper-Info.plist once, not the three times it
695           # is listed here.
696           'mac_bundle_resources!': [
697             'shell/app/helper-Info.plist',
698           ],
699           # TODO(mark): For now, don't put any resources into this app.  Its
700           # resources directory will be a symbolic link to the browser app's
701           # resources directory.
702           'mac_bundle_resources/': [
703             ['exclude', '.*'],
704           ],
705           'xcode_settings': {
706             'INFOPLIST_FILE': 'shell/app/helper-Info.plist',
707           },
708           'postbuilds': [
709             {
710               # The framework defines its load-time path
711               # (DYLIB_INSTALL_NAME_BASE) relative to the main executable
712               # (chrome).  A different relative path needs to be used in
713               # content_shell_helper_app.
714               'postbuild_name': 'Fix Framework Link',
715               'action': [
716                 'install_name_tool',
717                 '-change',
718                 '/Library/Frameworks/<(content_shell_product_name) Framework.framework/Versions/A/<(content_shell_product_name) Framework',
719                 '@executable_path/../../../../Frameworks/<(content_shell_product_name) Framework.framework/<(content_shell_product_name) Framework',
720                 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
721               ],
722             },
723             {
724               # Modify the Info.plist as needed.  The script explains why this
725               # is needed.  This is also done in the chrome and chrome_dll
726               # targets.  In this case, --breakpad=0, --keystone=0, and --scm=0
727               # are used because Breakpad, Keystone, and SCM keys are
728               # never placed into the helper.
729               'postbuild_name': 'Tweak Info.plist',
730               'action': ['../build/mac/tweak_info_plist.py',
731                          '--breakpad=0',
732                          '--keystone=0',
733                          '--scm=0',
734                          '--version=<(content_shell_version)'],
735             },
736             {
737               # Make sure there isn't any Objective-C in the helper app's
738               # executable.
739               'postbuild_name': 'Verify No Objective-C',
740               'action': [
741                 '../build/mac/verify_no_objc.sh',
742               ],
743             },
744           ],
745           'conditions': [
746             ['component=="shared_library"', {
747               'xcode_settings': {
748                 'LD_RUNPATH_SEARCH_PATHS': [
749                   # Get back from Content Shell.app/Contents/Frameworks/
750                   #                                 Helper.app/Contents/MacOS
751                   '@loader_path/../../../../../..',
752                 ],
753               },
754             }],
755           ],
756         },  # target content_shell_helper_app
757       ],
758     }],  # OS=="mac"
759     ['OS=="android"', {
760       'targets': [
761         {
762           # TODO(jrg): Update this action and other jni generators to only
763           # require specifying the java directory and generate the rest.
764           'target_name': 'content_shell_jni_headers',
765           'type': 'none',
766           'sources': [
767             'shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java',
768             'shell/android/java/src/org/chromium/content_shell/ShellLayoutTestUtils.java',
769             'shell/android/java/src/org/chromium/content_shell/ShellManager.java',
770             'shell/android/java/src/org/chromium/content_shell/Shell.java',
771           ],
772           'direct_dependent_settings': {
773             'include_dirs': [
774               '<(SHARED_INTERMEDIATE_DIR)/content/shell',
775             ],
776           },
777           'variables': {
778             'jni_gen_package': 'content/shell',
779           },
780           'includes': [ '../build/jni_generator.gypi' ],
781         },
782         {
783           'target_name': 'libcontent_shell_content_view',
784           'type': 'shared_library',
785           'dependencies': [
786             'content_shell_jni_headers',
787             'content_shell_lib',
788             'content_shell_pak',
789             # Skia is necessary to ensure the dependencies needed by
790             # WebContents are included.
791             '../skia/skia.gyp:skia',
792             '<(DEPTH)/media/media.gyp:player_android',
793           ],
794           'sources': [
795             'shell/android/shell_library_loader.cc',
796             'shell/android/shell_library_loader.h',
797           ],
798           'conditions': [
799             ['android_webview_build==1', {
800               'ldflags': [
801                 '-lgabi++',  # For rtti
802               ],
803             }],
804           ],
805         },
806         {
807           'target_name': 'content_shell_java',
808           'type': 'none',
809           'dependencies': [
810             'content.gyp:content_java',
811           ],
812           'variables': {
813             'java_in_dir': '../content/shell/android/java',
814             'has_java_resources': 1,
815             'R_package': 'org.chromium.content_shell',
816             'R_package_relpath': 'org/chromium/content_shell',
817           },
818           'includes': [ '../build/java.gypi' ],
819         },
820         {
821           # content_shell_apk creates a .jar as a side effect. Any java targets
822           # that need that .jar in their classpath should depend on this target,
823           # content_shell_apk_java. Dependents of content_shell_apk receive its
824           # jar path in the variable 'apk_output_jar_path'. This target should
825           # only be used by targets which instrument content_shell_apk.
826           'target_name': 'content_shell_apk_java',
827           'type': 'none',
828           'dependencies': [
829             'content_shell_apk',
830           ],
831           'includes': [ '../build/apk_fake_jar.gypi' ],
832         },
833         {
834           'target_name': 'content_shell_apk',
835           'type': 'none',
836           'dependencies': [
837             'content.gyp:content_java',
838             'content_java_test_support',
839             'content_shell_java',
840             'libcontent_shell_content_view',
841             '../base/base.gyp:base_java',
842             '../media/media.gyp:media_java',
843             '../net/net.gyp:net_java',
844             '../tools/android/forwarder/forwarder.gyp:forwarder',
845             '../ui/ui.gyp:ui_java',
846           ],
847           'variables': {
848             'apk_name': 'ContentShell',
849             'manifest_package_name': 'org.chromium.content_shell_apk',
850             'java_in_dir': 'shell/android/shell_apk',
851             'resource_dir': 'shell/android/shell_apk/res',
852             'native_lib_target': 'libcontent_shell_content_view',
853             'additional_input_paths': ['<(PRODUCT_DIR)/content_shell/assets/content_shell.pak'],
854             'asset_location': '<(ant_build_out)/content_shell/assets',
855           },
856           'conditions': [
857             ['android_webview_build==0', {
858               'dependencies': [
859                 '../tools/imagediff/image_diff.gyp:image_diff#host',
860               ],
861             }],
862           ],
863           'includes': [ '../build/java_apk.gypi' ],
864         },
865       ],
866     }],  # OS=="android"
867     ['OS=="win" and fastbuild==0 and target_arch=="ia32"', {
868       'variables': {
869         'dest_dir': '<(PRODUCT_DIR)/syzygy',
870       },
871       'targets': [
872         {
873           'target_name': 'content_shell_syzyasan',
874           'type': 'none',
875           'sources' : [],
876           # Instrument content_shell with SyzyAsan.
877           'actions': [
878             {
879               'action_name': 'Instrument content_shell with SyzyAsan',
880               'msvs_cygwin_shell': 0,
881               'inputs': [
882                 '<(PRODUCT_DIR)/content_shell.exe',
883               ],
884               'outputs': [
885                 '<(dest_dir)/content_shell.exe',
886                 '<(dest_dir)/content_shell.exe.pdb',
887               ],
888               'action': [
889                 'python',
890                 '<(DEPTH)/chrome/tools/build/win/syzygy_instrument.py',
891                 '--mode', 'asan',
892                 '--input_executable', '<(PRODUCT_DIR)/content_shell.exe',
893                 '--input_symbol', '<(PRODUCT_DIR)/content_shell.exe.pdb',
894                 '--destination_dir', '<(dest_dir)',
895               ],
896             },
897           ],
898         },
899       ],
900     }],  # OS=="win" and fastbuild==0 and target_arch=="ia32"
901   ]