Content settings: remove some plugin-related code/resources when... there are no...
[chromium-blink-merge.git] / content / content_shell.gypi
blob9d634b1eb6e5b4e382e833ae31df9da02a2fff0b
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       # GN version: //content/shell:content_shell_lib
23       'target_name': 'content_shell_lib',
24       'type': 'static_library',
25       'defines': ['CONTENT_SHELL_VERSION="<(content_shell_version)"'],
26       'variables': {
27         'chromium_code': 1,
28       },
29       'dependencies': [
30         'app/resources/content_resources.gyp:content_resources',
31         'app/strings/content_strings.gyp:content_strings',
32         'content.gyp:content_app_both',
33         'content.gyp:content_browser',
34         'content.gyp:content_common',
35         'content.gyp:content_gpu',
36         'content.gyp:content_plugin',
37         'content.gyp:content_ppapi_plugin',
38         'content.gyp:content_renderer',
39         'content.gyp:content_resources',
40         'content.gyp:content_utility',
41         'content_shell_resources',
42         'copy_test_netscape_plugin',
43         'layouttest_support_content',
44         '../base/base.gyp:base',
45         '../base/base.gyp:base_static',
46         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
47         '../cc/blink/cc_blink.gyp:cc_blink',
48         '../cc/cc.gyp:cc',
49         '../components/components.gyp:crash_component_breakpad_mac_to_be_deleted',
50         '../components/components.gyp:devtools_discovery',
51         '../components/components.gyp:devtools_http_handler',
52         '../components/components.gyp:web_cache_renderer',
53         '../components/components.gyp:plugins_renderer',
54         '../components/test_runner/test_runner.gyp:test_runner',
55         '../components/url_formatter/url_formatter.gyp:url_formatter',
56         '../device/bluetooth/bluetooth.gyp:device_bluetooth',
57         '../device/bluetooth/bluetooth.gyp:device_bluetooth_mocks',
58         '../gin/gin.gyp:gin',
59         '../gpu/gpu.gyp:gpu',
60         '../ipc/ipc.gyp:ipc',
61         '../media/blink/media_blink.gyp:media_blink',
62         '../media/media.gyp:media',
63         '../net/net.gyp:net',
64         '../net/net.gyp:net_resources',
65         '../skia/skia.gyp:skia',
66         '../storage/storage_browser.gyp:storage',
67         '../third_party/WebKit/public/blink.gyp:blink',
68         '../third_party/WebKit/public/blink.gyp:blink_test_support',
69         '../testing/gmock.gyp:gmock',
70         '../testing/gtest.gyp:gtest',
71         '../ui/base/ime/ui_base_ime.gyp:ui_base_ime',
72         '../ui/base/ui_base.gyp:ui_base',
73         '../ui/events/events.gyp:events_base',
74         '../ui/gfx/gfx.gyp:gfx',
75         '../ui/gfx/gfx.gyp:gfx_geometry',
76         '../ui/gfx/ipc/gfx_ipc.gyp:gfx_ipc',
77         '../ui/gl/gl.gyp:gl',
78         '../url/url.gyp:url_lib',
79         '../v8/tools/gyp/v8.gyp:v8',
80       ],
81       'include_dirs': [
82         '..',
83       ],
84       'sources': [
85         # Note: sources list duplicated in GN build.
86         'shell/android/shell_jni_registrar.cc',
87         'shell/android/shell_jni_registrar.h',
88         'shell/android/shell_manager.cc',
89         'shell/android/shell_manager.h',
90         'shell/app/blink_test_platform_support.h',
91         'shell/app/blink_test_platform_support_android.cc',
92         'shell/app/blink_test_platform_support_linux.cc',
93         'shell/app/blink_test_platform_support_mac.mm',
94         'shell/app/blink_test_platform_support_win.cc',
95         'shell/app/paths_mac.h',
96         'shell/app/paths_mac.mm',
97         'shell/app/shell_crash_reporter_client.cc',
98         'shell/app/shell_crash_reporter_client.h',
99         'shell/app/shell_main_delegate.cc',
100         'shell/app/shell_main_delegate.h',
101         'shell/app/shell_main_delegate_mac.h',
102         'shell/app/shell_main_delegate_mac.mm',
103         'shell/browser/blink_test_controller.cc',
104         'shell/browser/blink_test_controller.h',
105         'shell/browser/ipc_echo_message_filter.cc',
106         'shell/browser/ipc_echo_message_filter.h',
107         'shell/browser/layout_test/layout_test_android.cc',
108         'shell/browser/layout_test/layout_test_android.h',
109         'shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc',
110         'shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h',
111         'shell/browser/layout_test/layout_test_bluetooth_chooser_factory.cc',
112         'shell/browser/layout_test/layout_test_bluetooth_chooser_factory.h',
113         'shell/browser/layout_test/layout_test_browser_context.cc',
114         'shell/browser/layout_test/layout_test_browser_context.h',
115         'shell/browser/layout_test/layout_test_browser_main.cc',
116         'shell/browser/layout_test/layout_test_browser_main.h',
117         'shell/browser/layout_test/layout_test_browser_main_parts.cc',
118         'shell/browser/layout_test/layout_test_browser_main_parts.h',
119         'shell/browser/layout_test/layout_test_content_browser_client.cc',
120         'shell/browser/layout_test/layout_test_content_browser_client.h',
121         'shell/browser/layout_test/layout_test_devtools_frontend.cc',
122         'shell/browser/layout_test/layout_test_devtools_frontend.h',
123         'shell/browser/layout_test/layout_test_download_manager_delegate.cc',
124         'shell/browser/layout_test/layout_test_download_manager_delegate.h',
125         'shell/browser/layout_test/layout_test_javascript_dialog_manager.cc',
126         'shell/browser/layout_test/layout_test_javascript_dialog_manager.h',
127         'shell/browser/layout_test/layout_test_message_filter.cc',
128         'shell/browser/layout_test/layout_test_message_filter.h',
129         'shell/browser/layout_test/layout_test_navigator_connect_service_factory.cc',
130         'shell/browser/layout_test/layout_test_navigator_connect_service_factory.h',
131         'shell/browser/layout_test/layout_test_notification_manager.cc',
132         'shell/browser/layout_test/layout_test_notification_manager.h',
133         'shell/browser/layout_test/layout_test_permission_manager.cc',
134         'shell/browser/layout_test/layout_test_permission_manager.h',
135         'shell/browser/layout_test/layout_test_push_messaging_service.cc',
136         'shell/browser/layout_test/layout_test_push_messaging_service.h',
137         'shell/browser/layout_test/layout_test_resource_dispatcher_host_delegate.cc',
138         'shell/browser/layout_test/layout_test_resource_dispatcher_host_delegate.h',
139         'shell/browser/layout_test/layout_test_url_request_context_getter.cc',
140         'shell/browser/layout_test/layout_test_url_request_context_getter.h',
141         'shell/browser/notify_done_forwarder.cc',
142         'shell/browser/notify_done_forwarder.h',
143         'shell/browser/shell.cc',
144         'shell/browser/shell.h',
145         'shell/browser/shell_access_token_store.cc',
146         'shell/browser/shell_access_token_store.h',
147         'shell/browser/shell_android.cc',
148         'shell/browser/shell_application_mac.h',
149         'shell/browser/shell_application_mac.mm',
150         'shell/browser/shell_aura.cc',
151         'shell/browser/shell_browser_context.cc',
152         'shell/browser/shell_browser_context.h',
153         'shell/browser/shell_browser_main.cc',
154         'shell/browser/shell_browser_main.h',
155         'shell/browser/shell_browser_main_parts.cc',
156         'shell/browser/shell_browser_main_parts.h',
157         'shell/browser/shell_browser_main_parts_mac.mm',
158         'shell/browser/shell_content_browser_client.cc',
159         'shell/browser/shell_content_browser_client.h',
160         'shell/browser/shell_devtools_frontend.cc',
161         'shell/browser/shell_devtools_frontend.h',
162         'shell/browser/shell_devtools_manager_delegate.cc',
163         'shell/browser/shell_devtools_manager_delegate.h',
164         'shell/browser/shell_download_manager_delegate.cc',
165         'shell/browser/shell_download_manager_delegate.h',
166         'shell/browser/shell_javascript_dialog.h',
167         'shell/browser/shell_javascript_dialog_mac.mm',
168         'shell/browser/shell_javascript_dialog_manager.cc',
169         'shell/browser/shell_javascript_dialog_manager.h',
170         'shell/browser/shell_javascript_dialog_win.cc',
171         'shell/browser/shell_login_dialog.cc',
172         'shell/browser/shell_login_dialog.h',
173         'shell/browser/shell_login_dialog_mac.mm',
174         'shell/browser/shell_mac.mm',
175         'shell/browser/shell_mojo_test_utils_android.cc',
176         'shell/browser/shell_mojo_test_utils_android.h',
177         'shell/browser/shell_net_log.cc',
178         'shell/browser/shell_net_log.h',
179         'shell/browser/shell_network_delegate.cc',
180         'shell/browser/shell_network_delegate.h',
181         'shell/browser/shell_permission_manager.cc',
182         'shell/browser/shell_permission_manager.h',
183         'shell/browser/shell_platform_data_aura.cc',
184         'shell/browser/shell_platform_data_aura.h',
185         'shell/browser/shell_plugin_service_filter.cc',
186         'shell/browser/shell_plugin_service_filter.h',
187         'shell/browser/shell_quota_permission_context.cc',
188         'shell/browser/shell_quota_permission_context.h',
189         'shell/browser/shell_resource_dispatcher_host_delegate.cc',
190         'shell/browser/shell_resource_dispatcher_host_delegate.h',
191         'shell/browser/shell_speech_recognition_manager_delegate.cc',
192         'shell/browser/shell_speech_recognition_manager_delegate.h',
193         'shell/browser/shell_url_request_context_getter.cc',
194         'shell/browser/shell_url_request_context_getter.h',
195         'shell/browser/shell_views.cc',
196         'shell/browser/shell_web_contents_view_delegate.h',
197         'shell/browser/shell_web_contents_view_delegate_android.cc',
198         'shell/browser/shell_web_contents_view_delegate_creator.h',
199         'shell/browser/shell_web_contents_view_delegate_mac.mm',
200         'shell/browser/shell_web_contents_view_delegate_win.cc',
201         'shell/common/layout_test/layout_test_messages.cc',
202         'shell/common/layout_test/layout_test_messages.h',
203         'shell/common/leak_detection_result.h',
204         'shell/common/shell_content_client.cc',
205         'shell/common/shell_content_client.h',
206         'shell/common/shell_messages.cc',
207         'shell/common/shell_messages.h',
208         'shell/common/shell_switches.cc',
209         'shell/common/shell_switches.h',
210         'shell/common/shell_test_configuration.cc',
211         'shell/common/shell_test_configuration.h',
212         'shell/common/v8_breakpad_support_win.cc',
213         'shell/common/v8_breakpad_support_win.h',
214         'shell/renderer/ipc_echo.cc',
215         'shell/renderer/ipc_echo.h',
216         'shell/renderer/layout_test/blink_test_helpers.cc',
217         'shell/renderer/layout_test/blink_test_helpers.h',
218         'shell/renderer/layout_test/blink_test_runner.cc',
219         'shell/renderer/layout_test/blink_test_runner.h',
220         'shell/renderer/layout_test/gc_controller.cc',
221         'shell/renderer/layout_test/gc_controller.h',
222         'shell/renderer/layout_test/layout_test_content_renderer_client.cc',
223         'shell/renderer/layout_test/layout_test_content_renderer_client.h',
224         'shell/renderer/layout_test/layout_test_render_frame_observer.cc',
225         'shell/renderer/layout_test/layout_test_render_frame_observer.h',
226         'shell/renderer/layout_test/layout_test_render_process_observer.cc',
227         'shell/renderer/layout_test/layout_test_render_process_observer.h',
228         'shell/renderer/layout_test/leak_detector.cc',
229         'shell/renderer/layout_test/leak_detector.h',
230         'shell/renderer/layout_test/test_media_stream_renderer_factory.cc',
231         'shell/renderer/layout_test/test_media_stream_renderer_factory.h',
232         'shell/renderer/layout_test/test_video_frame_provider.cc',
233         'shell/renderer/layout_test/test_video_frame_provider.h',
234         'shell/renderer/shell_content_renderer_client.cc',
235         'shell/renderer/shell_content_renderer_client.h',
236         'shell/renderer/shell_render_view_observer.cc',
237         'shell/renderer/shell_render_view_observer.h',
238         'shell/utility/shell_content_utility_client.cc',
239         'shell/utility/shell_content_utility_client.h',
240       ],
241       'msvs_settings': {
242         'VCLinkerTool': {
243           'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
244         },
245       },
246       'conditions': [
247         ['OS=="win" and win_use_allocator_shim==1', {
248           'dependencies': [
249             '../base/allocator/allocator.gyp:allocator',
250           ],
251         }],
252         ['OS=="win"', {
253           'resource_include_dirs': [
254             '<(SHARED_INTERMEDIATE_DIR)/content/app/strings',
255           ],
256           'dependencies': [
257             '<(DEPTH)/content/app/strings/content_strings.gyp:content_strings',
258           ],
259           'configurations': {
260             'Debug_Base': {
261               'msvs_settings': {
262                 'VCLinkerTool': {
263                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
264                 },
265               },
266             },
267           },
268           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
269           'msvs_disabled_warnings': [ 4267, ],
270         }],  # OS=="win"
271         ['OS=="linux"', {
272           'dependencies': [
273             '../build/linux/system.gyp:fontconfig',
274           ],
275         }],
276         ['use_x11 == 1', {
277           'dependencies': [
278             '../ui/events/devices/events_devices.gyp:events_devices',
279             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
280           ],
281         }],
282         ['OS=="android"', {
283           'dependencies': [
284             '../mojo/mojo_base.gyp:libmojo_system_java',
285             'content_shell_jni_headers',
286           ],
287           'dependencies!': [
288             'copy_test_netscape_plugin',
289           ],
290         }],  # OS=="android"
291         ['os_posix == 1 and OS != "mac"', {
292           'dependencies': [
293             '../components/components.gyp:breakpad_host',
294           ],
295         }],
296         ['(OS=="linux" or OS=="android") and use_allocator!="none"', {
297           'dependencies': [
298             # This is needed by content/app/content_main_runner.cc
299             '../base/allocator/allocator.gyp:allocator',
300           ],
301         }],
302         ['use_aura==1', {
303           'dependencies': [
304             '../ui/aura/aura.gyp:aura',
305             '../ui/aura/aura.gyp:aura_test_support',
306             '../ui/events/events.gyp:events',
307             '../ui/strings/ui_strings.gyp:ui_strings',
308             '../ui/wm/wm.gyp:wm',
309           ],
310           'conditions': [
311             ['toolkit_views==1', {
312               'dependencies': [
313                 '../ui/resources/ui_resources.gyp:ui_resources',
314                 '../ui/views/controls/webview/webview.gyp:webview',
315                 '../ui/views/views.gyp:views',
316                 '../ui/views/views.gyp:views_test_support',
317               ],
318               'sources/': [
319                 ['exclude', 'shell/browser/shell_aura.cc'],
320               ],
321             }, {
322               'sources/': [
323                 ['exclude', 'shell/browser/shell_views.cc'],
324               ],
325             }],
326           ],
327         }, {
328           'sources/': [
329             ['exclude', 'shell/browser/shell_aura.cc'],
330             ['exclude', 'shell/browser/shell_views.cc'],
331           ],
332         }],  # use_aura==1
333         # The test plugin relies on X11.
334         ['OS=="linux" and use_x11==0', {
335           'dependencies!': [
336             'copy_test_netscape_plugin',
337           ],
338         }],
339         ['chromeos==1', {
340           'dependencies': [
341             '../chromeos/chromeos.gyp:chromeos',
342             '../ui/wm/wm.gyp:wm_test_support',
343            ],
344         }], # chromeos==1
345         ['use_custom_freetype==1', {
346           'dependencies': [
347              '../third_party/freetype2/freetype2.gyp:freetype2',
348           ],
349         }],
350         ['enable_plugins==0', {
351           'sources!': [
352             'shell/browser/shell_plugin_service_filter.cc',
353             'shell/browser/shell_plugin_service_filter.h',
354           ],
355         }]
356       ],
357     },
358     {
359       # GN version: //content/shell:resources
360       'target_name': 'content_shell_resources',
361       'type': 'none',
362       'variables': {
363         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/content',
364       },
365       'dependencies': [
366         '../components/test_runner/test_runner.gyp:resources',
367       ],
368       'actions': [
369         {
370           'action_name': 'generate_content_shell_resources',
371           'variables': {
372             'grit_grd_file': 'shell/shell_resources.grd',
373           },
374           'includes': [ '../build/grit_action.gypi' ],
375         },
376       ],
377       'includes': [ '../build/grit_target.gypi' ],
378       'copies': [
379         {
380           'destination': '<(PRODUCT_DIR)',
381           'files': [
382             '<(SHARED_INTERMEDIATE_DIR)/content/shell_resources.pak'
383           ],
384         },
385       ],
386     },
387     {
388       # We build a minimal set of resources so WebKit in content_shell has
389       # access to necessary resources.
390       # GN version: //content/shell:pak
391       'target_name': 'content_shell_pak',
392       'type': 'none',
393       'dependencies': [
394         'app/resources/content_resources.gyp:content_resources',
395         'app/strings/content_strings.gyp:content_strings',
396         'browser/tracing/tracing_resources.gyp:tracing_resources',
397         'content.gyp:content_resources',
398         'content_shell_resources',
399         '<(DEPTH)/net/net.gyp:net_resources',
400         '<(DEPTH)/third_party/WebKit/public/blink_resources.gyp:blink_resources',
401         '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
402         '<(DEPTH)/ui/strings/ui_strings.gyp:ui_strings',
403       ],
404       'conditions': [
405         ['OS!="android"', {
406           'dependencies': [
407             'browser/devtools/devtools_resources.gyp:devtools_resources',
408           ],
409         }],
410         ['OS=="android"', {
411           'copies': [
412             {
413               'destination': '<(PRODUCT_DIR)',
414               'files': [
415                 '<(PRODUCT_DIR)/content_shell/assets/content_shell.pak'
416               ],
417             },
418           ],
419         }],
420         ['toolkit_views==1', {
421           'dependencies': [
422             '<(DEPTH)/ui/views/resources/views_resources.gyp:views_resources'
423           ],
424         }],
425       ],
426       'actions': [
427         {
428           'action_name': 'repack_content_shell_pack',
429           'variables': {
430             'pak_inputs': [
431               '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak',
432               '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_image_resources_100_percent.pak',
433               '<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_100_percent.pak',
434               '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.pak',
435               '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.pak',
436               '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
437               '<(SHARED_INTERMEDIATE_DIR)/content/shell_resources.pak',
438               '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
439               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
440               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/webui_resources.pak',
441               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
442               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
443             ],
444             'conditions': [
445               ['toolkit_views==1', {
446                 'pak_inputs': [
447                   '<(SHARED_INTERMEDIATE_DIR)/ui/views/resources/views_resources_100_percent.pak',
448                 ],
449               }],
450               ['OS!="android"', {
451                 'pak_inputs': ['<(SHARED_INTERMEDIATE_DIR)/blink/devtools_resources.pak',],
452                 'pak_output': '<(PRODUCT_DIR)/content_shell.pak',
453               }, {
454                 'pak_output': '<(PRODUCT_DIR)/content_shell/assets/content_shell.pak',
455               }],
456             ],
457           },
458           'includes': [ '../build/repack_action.gypi' ],
459         },
460       ],
461     },
462     {
463       # GN version: //content/shell:content_shell
464       'target_name': 'content_shell',
465       'type': 'executable',
466       'mac_bundle': 1,
467       'variables': {
468         'chromium_code': 1,
469       },
470       'dependencies': [
471         'content_shell_lib',
472         'content_shell_pak',
473         '../third_party/mesa/mesa.gyp:osmesa',
474         '../tools/imagediff/image_diff.gyp:image_diff',
475       ],
476       'include_dirs': [
477         '..',
478       ],
479       'sources': [
480         'shell/app/shell_main.cc',
481       ],
482       'mac_bundle_resources': [
483         'shell/app/app.icns',
484         'shell/app/app-Info.plist',
485       ],
486       # TODO(mark): Come up with a fancier way to do this.  It should only
487       # be necessary to list app-Info.plist once, not the three times it is
488       # listed here.
489       'mac_bundle_resources!': [
490         'shell/app/app-Info.plist',
491       ],
492       'xcode_settings': {
493         'INFOPLIST_FILE': 'shell/app/app-Info.plist',
494       },
495       'msvs_settings': {
496         'VCManifestTool': {
497           'AdditionalManifestFiles': [
498             'shell/app/shell.exe.manifest',
499           ],
500         },
501       },
502       'conditions': [
503         ['OS=="win" and win_use_allocator_shim==1', {
504           'dependencies': [
505             '../base/allocator/allocator.gyp:allocator',
506           ],
507         }],
508         ['OS=="win"', {
509           'sources': [
510             'shell/app/shell.rc',
511           ],
512           'configurations': {
513             'Debug_Base': {
514               'msvs_settings': {
515                 'VCLinkerTool': {
516                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
517                 },
518               },
519             },
520           },
521         }],  # OS=="win"
522         ['OS == "win"', {
523           'dependencies': [
524             '../sandbox/sandbox.gyp:sandbox',
525           ],
526         }],  # OS=="win"
527         ['OS=="win" and asan==0', {
528           'msvs_settings': {
529             'VCLinkerTool': {
530               'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
531             },
532           },
533         }],  # OS=="win" and asan==0
534         ['OS=="mac"', {
535           'product_name': '<(content_shell_product_name)',
536           'dependencies!': [
537             'content_shell_lib',
538           ],
539           'dependencies': [
540             'content_shell_framework',
541             'content_shell_helper_app',
542           ],
543           'copies': [
544             {
545               'destination': '<(PRODUCT_DIR)/<(content_shell_product_name).app/Contents/Frameworks',
546               'files': [
547                 '<(PRODUCT_DIR)/<(content_shell_product_name) Helper.app',
548               ],
549             },
550           ],
551           'postbuilds': [
552             {
553               'postbuild_name': 'Copy <(content_shell_product_name) Framework.framework',
554               'action': [
555                 '../build/mac/copy_framework_unversioned.sh',
556                 '${BUILT_PRODUCTS_DIR}/<(content_shell_product_name) Framework.framework',
557                 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Frameworks',
558               ],
559             },
560             {
561               # Modify the Info.plist as needed.
562               'postbuild_name': 'Tweak Info.plist',
563               'action': ['../build/mac/tweak_info_plist.py',
564                          '--scm=1',
565                          '--version=<(content_shell_version)'],
566             },
567             {
568               # This postbuid step is responsible for creating the following
569               # helpers:
570               #
571               # Content Shell Helper EH.app and Content Shell Helper NP.app are
572               # created from Content Shell Helper.app.
573               #
574               # The EH helper is marked for an executable heap. The NP helper
575               # is marked for no PIE (ASLR).
576               'postbuild_name': 'Make More Helpers',
577               'action': [
578                 '../build/mac/make_more_helpers.sh',
579                 'Frameworks',
580                 '<(content_shell_product_name)',
581               ],
582             },
583             {
584               # Make sure there isn't any Objective-C in the shell's
585               # executable.
586               'postbuild_name': 'Verify No Objective-C',
587               'action': [
588                 '../build/mac/verify_no_objc.sh',
589               ],
590             },
591           ],
592         }],  # OS=="mac"
593         ['OS=="android"', {
594           'dependencies': [
595             '../tools/imagediff/image_diff.gyp:image_diff#host',
596           ],
597           'dependencies!': [
598             '../tools/imagediff/image_diff.gyp:image_diff',
599           ],
600         }],  # OS=="android"
601       ],
602     },
603     {
604       'target_name': 'content_shell_builder',
605       'type': 'none',
606       'dependencies': [
607         'content_shell',
608       ],
609     },
611     {
612       'target_name': 'test_netscape_plugin',
613       'type': 'loadable_module',
614       'sources': [
615         'shell/tools/plugin/PluginObject.cpp',
616         'shell/tools/plugin/PluginObject.h',
617         'shell/tools/plugin/PluginObjectMac.mm',
618         'shell/tools/plugin/PluginTest.cpp',
619         'shell/tools/plugin/PluginTest.h',
620         'shell/tools/plugin/TestObject.cpp',
621         'shell/tools/plugin/Tests/DocumentOpenInDestroyStream.cpp',
622         'shell/tools/plugin/Tests/EvaluateJSAfterRemovingPluginElement.cpp',
623         'shell/tools/plugin/Tests/FormValue.cpp',
624         'shell/tools/plugin/Tests/GetURLNotifyWithURLThatFailsToLoad.cpp',
625         'shell/tools/plugin/Tests/GetURLWithJavaScriptURL.cpp',
626         'shell/tools/plugin/Tests/GetURLWithJavaScriptURLDestroyingPlugin.cpp',
627         'shell/tools/plugin/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp',
628         'shell/tools/plugin/Tests/LeakWindowScriptableObject.cpp',
629         'shell/tools/plugin/Tests/LogNPPSetWindow.cpp',
630         'shell/tools/plugin/Tests/NPDeallocateCalledBeforeNPShutdown.cpp',
631         'shell/tools/plugin/Tests/NPPNewFails.cpp',
632         'shell/tools/plugin/Tests/NPRuntimeCallsWithNullNPP.cpp',
633         'shell/tools/plugin/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp',
634         'shell/tools/plugin/Tests/NPRuntimeRemoveProperty.cpp',
635         'shell/tools/plugin/Tests/NullNPPGetValuePointer.cpp',
636         'shell/tools/plugin/Tests/PassDifferentNPPStruct.cpp',
637         'shell/tools/plugin/Tests/PluginScriptableNPObjectInvokeDefault.cpp',
638         'shell/tools/plugin/Tests/PluginScriptableObjectOverridesAllProperties.cpp',
639         'shell/tools/plugin/main.cpp',
640         'shell/tools/plugin/test_object.h',
641       ],
642       'include_dirs': [
643         '<(DEPTH)',
644         '<(DEPTH)/content/shell/tools/plugin/',
645       ],
646       'dependencies': [
647         '../base/base.gyp:base',
648         '../third_party/npapi/npapi.gyp:npapi',
649       ],
650       'conditions': [
651         ['OS=="mac"', {
652           'mac_bundle': 1,
653           'product_extension': 'plugin',
654           'link_settings': {
655             'libraries': [
656               '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
657               '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
658               '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
659             ]
660           },
661           'xcode_settings': {
662             'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
663             'INFOPLIST_FILE': 'shell/tools/plugin/mac/Info.plist',
664           },
665         }],
666         ['os_posix == 1 and OS != "mac"', {
667           'cflags': [
668             '-fvisibility=default',
669           ],
670         }],
671         ['use_x11 == 1', {
672           'dependencies': [ '../build/linux/system.gyp:x11' ],
673         }],
674         ['OS=="win"', {
675           'conditions': [
676             ['MSVS_VERSION < "2015"', {
677               'defines': [
678                 # This seems like a hack, but this is what Safari Win does.
679                 # Luckily it is no longer needed/allowed with VS 2015.
680                 'snprintf=_snprintf',
681               ],
682             }],
683           ],
684           'sources': [
685             'shell/tools/plugin/win/TestNetscapePlugin.def',
686             'shell/tools/plugin/win/TestNetscapePlugin.rc',
687           ],
688           # The .rc file requires that the name of the dll is np_test_netscape_plugin.dll.
689           'product_name': 'np_test_netscape_plugin',
690           # Disable c4267 warnings until we fix size_t to int truncations.
691           'msvs_disabled_warnings': [ 4267, ],
692         }],
693       ],
694     },
695     {
696       'target_name': 'copy_test_netscape_plugin',
697       'type': 'none',
698       'dependencies': [
699         'test_netscape_plugin',
700       ],
701       'conditions': [
702         ['OS=="win"', {
703           'copies': [{
704             'destination': '<(PRODUCT_DIR)/plugins',
705             'files': ['<(PRODUCT_DIR)/np_test_netscape_plugin.dll'],
706           }],
707         }],
708         ['OS=="mac"', {
709           'copies': [{
710             'destination': '<(PRODUCT_DIR)/plugins/',
711             'files': ['<(PRODUCT_DIR)/test_netscape_plugin.plugin/'],
712           }],
713         }],
714         ['os_posix == 1 and OS != "mac"', {
715           'copies': [{
716             'destination': '<(PRODUCT_DIR)/plugins',
717             'files': ['<(PRODUCT_DIR)/libtest_netscape_plugin.so'],
718           }],
719         }],
720       ],
721     }
722   ],
723   'conditions': [
724     ['OS=="mac"', {
725       'targets': [
726         {
727           'target_name': 'content_shell_framework',
728           'type': 'shared_library',
729           'product_name': '<(content_shell_product_name) Framework',
730           'mac_bundle': 1,
731           'mac_bundle_resources': [
732             'shell/app/English.lproj/HttpAuth.xib',
733             'shell/app/English.lproj/MainMenu.xib',
734             '<(PRODUCT_DIR)/content_shell.pak',
735             'shell/app/framework-Info.plist',
736           ],
737           'mac_bundle_resources!': [
738             'shell/app/framework-Info.plist',
739           ],
740           'xcode_settings': {
741             # The framework is placed within the .app's Framework
742             # directory.  DYLIB_INSTALL_NAME_BASE and
743             # LD_DYLIB_INSTALL_NAME affect -install_name.
744             'DYLIB_INSTALL_NAME_BASE':
745                 '@executable_path/../Frameworks',
746             # See /build/mac/copy_framework_unversioned.sh for
747             # information on LD_DYLIB_INSTALL_NAME.
748             'LD_DYLIB_INSTALL_NAME':
749                 '$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(WRAPPER_NAME)/$(PRODUCT_NAME)',
751             'INFOPLIST_FILE': 'shell/app/framework-Info.plist',
752           },
753           'dependencies': [
754             'content_shell_lib',
755           ],
756           'include_dirs': [
757             '..',
758           ],
759           'sources': [
760             'shell/app/shell_content_main.cc',
761             'shell/app/shell_content_main.h',
762           ],
763           'postbuilds': [
764             {
765               # Modify the Info.plist as needed.  The script explains why
766               # this is needed.  This is also done in the chrome target.
767               # The framework needs the Breakpad keys if this feature is
768               # enabled.  It does not need the Keystone keys; these always
769               # come from the outer application bundle.  The framework
770               # doesn't currently use the SCM keys for anything,
771               # but this seems like a really good place to store them.
772               'postbuild_name': 'Tweak Info.plist',
773               'action': ['../build/mac/tweak_info_plist.py',
774                          '--breakpad=1',
775                          '--keystone=0',
776                          '--scm=1',
777                          '--version=<(content_shell_version)',
778                          '--branding=<(content_shell_product_name)'],
779             },
780           ],
781           'copies': [
782             {
783               'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Resources',
784               'files': [
785                 '<(PRODUCT_DIR)/crash_inspector',
786                 '<(PRODUCT_DIR)/crash_report_sender.app'
787               ],
788             },
789           ],
790           'conditions': [
791             ['icu_use_data_file_flag==1', {
792               'mac_bundle_resources': [
793                 '<(PRODUCT_DIR)/icudtl.dat',
794               ],
795             }],
796             ['v8_use_external_startup_data==1', {
797               'mac_bundle_resources': [
798                 '<(PRODUCT_DIR)/natives_blob.bin',
799                 '<(PRODUCT_DIR)/snapshot_blob.bin',
800               ],
801             }],
802           ],
803         },  # target content_shell_framework
804         {
805           'target_name': 'content_shell_helper_app',
806           'type': 'executable',
807           'variables': { 'enable_wexit_time_destructors': 1, },
808           'product_name': '<(content_shell_product_name) Helper',
809           'mac_bundle': 1,
810           'dependencies': [
811             'content_shell_framework',
812           ],
813           'sources': [
814             'shell/app/shell_main.cc',
815             'shell/app/helper-Info.plist',
816           ],
817           # TODO(mark): Come up with a fancier way to do this.  It should only
818           # be necessary to list helper-Info.plist once, not the three times it
819           # is listed here.
820           'mac_bundle_resources!': [
821             'shell/app/helper-Info.plist',
822           ],
823           # TODO(mark): For now, don't put any resources into this app.  Its
824           # resources directory will be a symbolic link to the browser app's
825           # resources directory.
826           'mac_bundle_resources/': [
827             ['exclude', '.*'],
828           ],
829           'xcode_settings': {
830             'INFOPLIST_FILE': 'shell/app/helper-Info.plist',
831           },
832           'postbuilds': [
833             {
834               # The framework defines its load-time path
835               # (DYLIB_INSTALL_NAME_BASE) relative to the main executable
836               # (chrome).  A different relative path needs to be used in
837               # content_shell_helper_app.
838               'postbuild_name': 'Fix Framework Link',
839               'action': [
840                 'install_name_tool',
841                 '-change',
842                 '@executable_path/../Frameworks/<(content_shell_product_name) Framework.framework/<(content_shell_product_name) Framework',
843                 '@executable_path/../../../<(content_shell_product_name) Framework.framework/<(content_shell_product_name) Framework',
844                 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
845               ],
846             },
847             {
848               # Modify the Info.plist as needed.  The script explains why this
849               # is needed.  This is also done in the chrome and chrome_dll
850               # targets.  In this case, --breakpad=0, --keystone=0, and --scm=0
851               # are used because Breakpad, Keystone, and SCM keys are
852               # never placed into the helper.
853               'postbuild_name': 'Tweak Info.plist',
854               'action': ['../build/mac/tweak_info_plist.py',
855                          '--breakpad=0',
856                          '--keystone=0',
857                          '--scm=0',
858                          '--version=<(content_shell_version)'],
859             },
860             {
861               # Make sure there isn't any Objective-C in the helper app's
862               # executable.
863               'postbuild_name': 'Verify No Objective-C',
864               'action': [
865                 '../build/mac/verify_no_objc.sh',
866               ],
867             },
868           ],
869           'conditions': [
870             ['component=="shared_library"', {
871               'xcode_settings': {
872                 'LD_RUNPATH_SEARCH_PATHS': [
873                   # Get back from Content Shell.app/Contents/Frameworks/
874                   #                                 Helper.app/Contents/MacOS
875                   '@loader_path/../../../../../..',
876                 ],
877               },
878             }],
879           ],
880         },  # target content_shell_helper_app
881       ],
882     }],  # OS=="mac"
883     ['OS=="android"', {
884       'targets': [
885         {
886           # TODO(jrg): Update this action and other jni generators to only
887           # require specifying the java directory and generate the rest.
888           'target_name': 'content_shell_jni_headers',
889           'type': 'none',
890           'sources': [
891             'shell/android/java/src/org/chromium/content_shell/ShellLayoutTestUtils.java',
892             'shell/android/java/src/org/chromium/content_shell/ShellMojoTestUtils.java',
893             'shell/android/java/src/org/chromium/content_shell/ShellManager.java',
894             'shell/android/java/src/org/chromium/content_shell/Shell.java',
895           ],
896           'variables': {
897             'jni_gen_package': 'content/shell',
898           },
899           'includes': [ '../build/jni_generator.gypi' ],
900         },
901         {
902           'target_name': 'libcontent_shell_content_view',
903           'type': 'shared_library',
904           'dependencies': [
905             'content_shell_jni_headers',
906             'content_shell_lib',
907             'content_shell_pak',
908             # Skia is necessary to ensure the dependencies needed by
909             # WebContents are included.
910             '../skia/skia.gyp:skia',
911             '<(DEPTH)/media/media.gyp:player_android',
912           ],
913           'sources': [
914             'shell/android/shell_library_loader.cc',
915           ],
916         },
917         {
918           'target_name': 'content_shell_java',
919           'type': 'none',
920           'dependencies': [
921             'content.gyp:content_java',
922           ],
923           'variables': {
924             'java_in_dir': '../content/shell/android/java',
925             'has_java_resources': 1,
926             'R_package': 'org.chromium.content_shell',
927             'R_package_relpath': 'org/chromium/content_shell',
928           },
929           'includes': [ '../build/java.gypi' ],
930         },
931         {
932           # content_shell_apk creates a .jar as a side effect. Any java targets
933           # that need that .jar in their classpath should depend on this target,
934           # content_shell_apk_java. Dependents of content_shell_apk receive its
935           # jar path in the variable 'apk_output_jar_path'. This target should
936           # only be used by targets which instrument content_shell_apk.
937           'target_name': 'content_shell_apk_java',
938           'type': 'none',
939           'dependencies': [
940             'content_shell_apk',
941           ],
942           'includes': [ '../build/apk_fake_jar.gypi' ],
943         },
944         {
945           # GN version: //content/shell/android:content_shell_manifest
946           'target_name': 'content_shell_manifest',
947           'type': 'none',
948           'variables': {
949             'jinja_inputs': ['shell/android/shell_apk/AndroidManifest.xml.jinja2'],
950             'jinja_output': '<(SHARED_INTERMEDIATE_DIR)/content_shell_manifest/AndroidManifest.xml',
951           },
952           'includes': [ '../build/android/jinja_template.gypi' ],
953         },
954         {
955           # GN version: //content/shell/android:content_shell_apk
956           'target_name': 'content_shell_apk',
957           'type': 'none',
958           'dependencies': [
959             'content.gyp:content_icudata',
960             'content.gyp:content_java',
961             'content.gyp:content_v8_external_data',
962             'content_java_test_support',
963             'content_shell_java',
964             'libcontent_shell_content_view',
965             '../base/base.gyp:base_java',
966             '../media/media.gyp:media_java',
967             '../net/net.gyp:net_java',
968             '../third_party/mesa/mesa.gyp:osmesa_in_lib_dir',
969             '../tools/android/forwarder/forwarder.gyp:forwarder',
970             '../tools/imagediff/image_diff.gyp:image_diff#host',
971             '../ui/android/ui_android.gyp:ui_java',
972           ],
973           'variables': {
974             'apk_name': 'ContentShell',
975             'manifest_package_name': 'org.chromium.content_shell_apk',
976             'android_manifest_path': '<(SHARED_INTERMEDIATE_DIR)/content_shell_manifest/AndroidManifest.xml',
977             'java_in_dir': 'shell/android/shell_apk',
978             'resource_dir': 'shell/android/shell_apk/res',
979             'native_lib_target': 'libcontent_shell_content_view',
980             'additional_input_paths': ['<(PRODUCT_DIR)/content_shell/assets/content_shell.pak'],
981             'asset_location': '<(PRODUCT_DIR)/content_shell/assets',
982             'extra_native_libs': ['<(SHARED_LIB_DIR)/libosmesa.so'],
983             'conditions': [
984               ['icu_use_data_file_flag==1', {
985                 'additional_input_paths': [
986                   '<(PRODUCT_DIR)/icudtl.dat',
987                 ],
988               }],
989               ['v8_use_external_startup_data==1', {
990                 'additional_input_paths': [
991                   '<(PRODUCT_DIR)/natives_blob.bin',
992                   '<(PRODUCT_DIR)/snapshot_blob.bin',
993                 ],
994               }],
995             ],
996           },
997           'includes': [ '../build/java_apk.gypi' ],
998         },
999       ],
1000     }],  # OS=="android"
1001     ['OS=="win"', {
1002       'targets': [
1003         {
1004           # GN version: //content/shell:crash_service
1005           'target_name': 'content_shell_crash_service',
1006           'type': 'executable',
1007           'dependencies': [
1008             '../base/base.gyp:base',
1009             '../components/components.gyp:breakpad_crash_service',
1010           ],
1011           'include_dirs': [
1012             '..',
1013           ],
1014           'sources': [
1015             'shell/tools/content_shell_crash_service.cc',
1016           ],
1017           'msvs_settings': {
1018             'VCLinkerTool': {
1019               'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
1020             },
1021           },
1022         },
1023       ],
1024     }],  # OS=="win"
1025     ['OS=="win" and fastbuild==0 and target_arch=="ia32" and syzyasan==1', {
1026       'variables': {
1027         'dest_dir': '<(PRODUCT_DIR)/syzygy',
1028       },
1029       'targets': [
1030         {
1031           'target_name': 'content_shell_syzyasan',
1032           'type': 'none',
1033           'sources' : [],
1034           # Instrument content_shell with SyzyAsan.
1035           'actions': [
1036             {
1037               'action_name': 'Instrument content_shell with SyzyAsan',
1038               'inputs': [
1039                 '<(PRODUCT_DIR)/content_shell.exe',
1040               ],
1041               'outputs': [
1042                 '<(dest_dir)/content_shell.exe',
1043                 '<(dest_dir)/content_shell.exe.pdb',
1044               ],
1045               'action': [
1046                 'python',
1047                 '<(DEPTH)/chrome/tools/build/win/syzygy/instrument.py',
1048                 '--mode', 'asan',
1049                 '--input_executable', '<(PRODUCT_DIR)/content_shell.exe',
1050                 '--input_symbol', '<(PRODUCT_DIR)/content_shell.exe.pdb',
1051                 '--destination_dir', '<(dest_dir)',
1052               ],
1053             },
1054           ],
1055         },
1056       ],
1057     }],  # OS=="win" and fastbuild==0 and target_arch=="ia32"
1058   ]