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