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