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