Allow supervised users to delete profiles in about:settings.
[chromium-blink-merge.git] / chromecast / chromecast.gyp
blobdb35e6f588b8dd873d2b918a8f3139b0ac270a44
1 # Copyright 2014 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     'android_support_v13_target%':
8         '../third_party/android_tools/android_tools.gyp:android_support_v13_javalib',
9     'cast_build_release': 'internal/build/cast_build_release',
10     'chromium_code': 1,
11     'chromecast_branding%': 'Chromium',
12     'disable_display%': 0,
13   },
14   'includes': [
15     'chromecast_tests.gypi',
16   ],
17   'target_defaults': {
18     'include_dirs': [
19       '..',  # Root of Chromium checkout
20     ],
21     'conditions': [
22       ['disable_display==1', {
23         'defines': ['DISABLE_DISPLAY'],
24       }],
25     ],
26   },
27   'targets': [
28     # TODO(gunsch): Remove these fake targets once they're either added or no
29     # longer referenced from internal code.
30     {'target_name': 'cast_media_audio', 'type': 'none'},
31     {'target_name': 'cast_port_impl', 'type': 'none'},
33     {
34       'target_name': 'cast_base',
35       'type': '<(component)',
36       'dependencies': [
37         '../base/base.gyp:base',
38       ],
39       'sources': [
40         'base/metrics/cast_histograms.h',
41         'base/metrics/cast_metrics_helper.cc',
42         'base/metrics/cast_metrics_helper.h',
43         'base/metrics/grouped_histogram.cc',
44         'base/metrics/grouped_histogram.h'
45       ],
46     },  # end of target 'cast_base'
47     {
48       'target_name': 'cast_crash_client',
49       'type': '<(component)',
50       'dependencies': [
51         '../breakpad/breakpad.gyp:breakpad_client',
52         '../components/components.gyp:crash_component',
53       ],
54       'sources': [
55         'crash/cast_crash_reporter_client.cc',
56         'crash/cast_crash_reporter_client.h',
57       ],
58       'conditions': [
59         ['chromecast_branding=="Chrome"', {
60           'dependencies': [
61             '<(cast_internal_gyp):crash_internal',
62           ],
63         }, {
64           'sources': [
65             'crash/cast_crash_reporter_client_simple.cc',
66           ],
67         }],
68       ]
69     },  # end of target 'cast_crash_client'
70     {
71       'target_name': 'cast_net',
72       'type': '<(component)',
73       'sources': [
74         'net/network_change_notifier_cast.cc',
75         'net/network_change_notifier_cast.h',
76         'net/network_change_notifier_factory_cast.cc',
77         'net/network_change_notifier_factory_cast.h',
78       ],
79     },
80     {
81       'target_name': 'cast_shell_resources',
82       'type': 'none',
83       'variables': {
84         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chromecast',
85       },
86       'actions': [
87         {
88           'action_name': 'cast_shell_resources',
89           'variables': {
90             'grit_grd_file': 'app/resources/shell_resources.grd',
91             'grit_resource_ids': 'app/resources/resource_ids',
92           },
93           'includes': [ '../build/grit_action.gypi' ],
94         },
95       ],
96       'includes': [ '../build/grit_target.gypi' ],
97     },
98     {
99       'target_name': 'cast_shell_pak',
100       'type': 'none',
101       'dependencies': [
102         'cast_shell_resources',
103         '../content/app/resources/content_resources.gyp:content_resources',
104         '../content/app/strings/content_strings.gyp:content_strings',
105         '../net/net.gyp:net_resources',
106         '../third_party/WebKit/public/blink_resources.gyp:blink_resources',
107         '../ui/resources/ui_resources.gyp:ui_resources',
108         '../ui/strings/ui_strings.gyp:ui_strings',
109       ],
110       'actions': [
111         {
112           'action_name': 'repack_cast_shell_pack',
113           'variables': {
114             'pak_inputs': [
115               '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak',
116               '<(SHARED_INTERMEDIATE_DIR)/chromecast/shell_resources.pak',
117               '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
118               '<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_100_percent.pak',
119               '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.pak',
120               '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
121               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
122               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/webui_resources.pak',
123               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
124               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
125             ],
126             'pak_output': '<(PRODUCT_DIR)/assets/cast_shell.pak',
127           },
128           'includes': [ '../build/repack_action.gypi' ],
129         },
130       ],
131     },
132     # This target contains all content-embedder implementation that is
133     # non-platform-specific.
134     {
135       'target_name': 'cast_shell_common',
136       'type': '<(component)',
137       'dependencies': [
138         'cast_base',
139         'cast_crash_client',
140         'cast_shell_pak',
141         'cast_shell_resources',
142         'cast_version_header',
143         'chromecast_locales.gyp:chromecast_locales_pak',
144         'chromecast_locales.gyp:chromecast_settings',
145         'media/media.gyp:media_base',
146         '../base/base.gyp:base',
147         '../components/components.gyp:breakpad_host',
148         '../components/components.gyp:cdm_renderer',
149         '../components/components.gyp:component_metrics_proto',
150         '../components/components.gyp:crash_component',
151         '../components/components.gyp:network_hints_browser',
152         '../components/components.gyp:network_hints_renderer',
153         '../components/components.gyp:metrics',
154         '../components/components.gyp:metrics_gpu',
155         '../components/components.gyp:metrics_net',
156         '../components/components.gyp:metrics_profiler',
157         '../content/content.gyp:content',
158         '../content/content.gyp:content_app_browser',
159         '../skia/skia.gyp:skia',
160         '../third_party/WebKit/public/blink.gyp:blink',
161         '../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
162       ],
163       'sources': [
164         'app/cast_main_delegate.cc',
165         'app/cast_main_delegate.h',
166         'browser/cast_browser_context.cc',
167         'browser/cast_browser_context.h',
168         'browser/cast_browser_main_parts.cc',
169         'browser/cast_browser_main_parts.h',
170         'browser/cast_browser_process.cc',
171         'browser/cast_browser_process.h',
172         'browser/cast_content_browser_client.cc',
173         'browser/cast_content_browser_client.h',
174         'browser/cast_content_window.cc',
175         'browser/cast_content_window.h',
176         'browser/cast_download_manager_delegate.cc',
177         'browser/cast_download_manager_delegate.h',
178         'browser/cast_http_user_agent_settings.cc',
179         'browser/cast_http_user_agent_settings.h',
180         'browser/cast_network_delegate.cc',
181         'browser/cast_network_delegate.h',
182         'browser/devtools/cast_dev_tools_delegate.cc',
183         'browser/devtools/cast_dev_tools_delegate.h',
184         'browser/devtools/remote_debugging_server.cc',
185         'browser/devtools/remote_debugging_server.h',
186         'browser/geolocation/cast_access_token_store.cc',
187         'browser/geolocation/cast_access_token_store.h',
188         'browser/metrics/cast_metrics_prefs.cc',
189         'browser/metrics/cast_metrics_prefs.h',
190         'browser/metrics/cast_metrics_service_client.cc',
191         'browser/metrics/cast_metrics_service_client.h',
192         'browser/metrics/cast_stability_metrics_provider.cc',
193         'browser/metrics/cast_stability_metrics_provider.h',
194         'browser/metrics/platform_metrics_providers.h',
195         'browser/pref_service_helper.cc',
196         'browser/pref_service_helper.h',
197         'browser/service/cast_service.cc',
198         'browser/service/cast_service.h',
199         'browser/url_request_context_factory.cc',
200         'browser/url_request_context_factory.h',
201         'common/cast_content_client.cc',
202         'common/cast_content_client.h',
203         'common/cast_paths.cc',
204         'common/cast_paths.h',
205         'common/cast_resource_delegate.cc',
206         'common/cast_resource_delegate.h',
207         'common/chromecast_switches.cc',
208         'common/chromecast_switches.h',
209         'common/platform_client_auth.h',
210         'common/pref_names.cc',
211         'common/pref_names.h',
212         'renderer/cast_content_renderer_client.cc',
213         'renderer/cast_content_renderer_client.h',
214         'renderer/cast_media_load_deferrer.cc',
215         'renderer/cast_media_load_deferrer.h',
216         'renderer/cast_render_process_observer.cc',
217         'renderer/cast_render_process_observer.h',
218         'renderer/key_systems_cast.cc',
219         'renderer/key_systems_cast.h',
220       ],
221       'conditions': [
222         ['chromecast_branding=="Chrome"', {
223           'dependencies': [
224             '<(cast_internal_gyp):cast_shell_internal',
225           ],
226         }, {
227           'sources': [
228             'browser/cast_content_browser_client_simple.cc',
229             'browser/cast_network_delegate_simple.cc',
230             'browser/devtools/remote_debugging_server_simple.cc',
231             'browser/media/cast_browser_cdm_factory_simple.cc',
232             'browser/metrics/platform_metrics_providers_simple.cc',
233             'browser/pref_service_helper_simple.cc',
234             'common/platform_client_auth_simple.cc',
235             'renderer/key_systems_cast_simple.cc',
236           ],
237           'conditions': [
238             ['OS=="android"', {
239               'sources': [
240                 'browser/service/cast_service_android.cc',
241                 'browser/service/cast_service_android.h',
242               ],
243             }, {
244               'sources': [
245                 'browser/service/cast_service_simple.cc',
246                 'browser/service/cast_service_simple.h',
247               ],
248             }],
249           ],
250         }],
251         # ExternalMetrics not necessary on Android and (as of this writing) uses
252         # non-portable filesystem operations. Also webcrypto is not used on
253         # Android either.
254         ['OS=="linux"', {
255           'sources': [
256             'browser/metrics/external_metrics.cc',
257             'browser/metrics/external_metrics.h',
258           ],
259           'dependencies': [
260             '../components/components.gyp:metrics_serialization',
261           ],
262         }],
263       ],
264     },
265     {
266       'target_name': 'cast_version_header',
267       'type': 'none',
268       'direct_dependent_settings': {
269         'include_dirs': [
270           '<(SHARED_INTERMEDIATE_DIR)',
271         ],
272       },
273       'actions': [
274         {
275           'action_name': 'version_header',
276           'message': 'Generating version header file: <@(_outputs)',
277           'inputs': [
278             '<(version_path)',
279             'common/version.h.in',
280           ],
281           'outputs': [
282             '<(SHARED_INTERMEDIATE_DIR)/chromecast/common/version.h',
283           ],
284           'action': [
285             'python',
286             '<(version_py_path)',
287             '-e', 'VERSION_FULL="<(version_full)"',
288             # CAST_BUILD_INCREMENTAL is taken from buildbot if available;
289             # otherwise, a dev string is used.
290             '-e', 'CAST_BUILD_INCREMENTAL="<!(echo ${CAST_BUILD_INCREMENTAL:="<!(date +%Y%m%d.%H%M%S)"})"',
291             # CAST_BUILD_RELEASE is taken from cast_build_release file if exist;
292             # otherwise, a dev string is used.
293             '-e', 'CAST_BUILD_RELEASE="<!(if test -f <(cast_build_release); then cat <(cast_build_release); else echo eng.${USER}; fi)"',
294             '-e', 'CAST_IS_DEBUG_BUILD=1 if "<(CONFIGURATION_NAME)" == "Debug" else 0',
295             'common/version.h.in',
296             '<@(_outputs)',
297           ],
298           'includes': [
299             '../build/util/version.gypi',
300           ],
301         },
302       ],
303     },
304   ],  # end of targets
306   # Targets for Android receiver.
307   'conditions': [
308     ['OS=="android"', {
309       'targets': [
310         {
311           'target_name': 'cast_shell_icudata',
312           'type': 'none',
313           'dependencies': [
314             '../third_party/icu/icu.gyp:icudata',
315           ],
316           'copies': [{
317             'destination': '<(PRODUCT_DIR)/assets',
318             'files': ['<(PRODUCT_DIR)/icudtl.dat'],
319           }],
320         },
321         {
322           'target_name': 'libcast_shell_android',
323           'type': 'shared_library',
324           'dependencies': [
325             'cast_jni_headers',
326             'cast_shell_common',
327             'cast_shell_icudata',
328             'cast_shell_pak',
329             'cast_version_header',
330             '../base/base.gyp:base',
331             '../breakpad/breakpad.gyp:breakpad_client',
332             '../components/components.gyp:breakpad_host',
333             '../components/components.gyp:crash_component',
334             '../content/content.gyp:content_app_browser',
335             '../content/content.gyp:content',
336             '../skia/skia.gyp:skia',
337             '../ui/gfx/gfx.gyp:gfx',
338             '../ui/gl/gl.gyp:gl',
339           ],
340           'include_dirs': [
341             '../breakpad/src',
342           ],
343           'sources': [
344             'android/cast_jni_registrar.cc',
345             'android/cast_jni_registrar.h',
346             'android/chromecast_config_android.cc',
347             'android/chromecast_config_android.h',
348             'android/platform_jni_loader.h',
349             'app/android/cast_jni_loader.cc',
350             'browser/android/cast_window_android.cc',
351             'browser/android/cast_window_android.h',
352             'browser/android/cast_window_manager.cc',
353             'browser/android/cast_window_manager.h',
354             'browser/android/external_video_surface_container_impl.cc',
355             'browser/android/external_video_surface_container_impl.h',
356             'crash/android/cast_crash_reporter_client_android.cc',
357             'crash/android/cast_crash_reporter_client_android.h',
358             'crash/android/crash_handler.cc',
359             'crash/android/crash_handler.h',
360           ],
361           'conditions': [
362             ['chromecast_branding=="Chrome"', {
363               'dependencies': [
364                 '<(cast_internal_gyp):cast_shell_android_internal'
365               ],
366             }, {
367               'sources': [
368                 'android/chromecast_config_android_stub.cc',
369                 'android/platform_jni_loader_stub.cc',
370               ],
371             }]
372           ],
373         },  # end of target 'libcast_shell_android'
374         {
375           'target_name': 'cast_shell_java',
376           'type': 'none',
377           'dependencies': [
378             '<(android_support_v13_target)',
379             '../base/base.gyp:base_java',
380             '../content/content.gyp:content_java',
381             '../media/media.gyp:media_java',
382             '../net/net.gyp:net_java',
383             '../ui/android/ui_android.gyp:ui_java',
384           ],
385           'variables': {
386             'has_java_resources': 1,
387             'java_in_dir': 'browser/android/apk',
388             'resource_dir': 'browser/android/apk/res',
389             'R_package': 'org.chromium.chromecast.shell',
390           },
391           'includes': ['../build/java.gypi'],
392         },  # end of target 'cast_shell_java'
393         {
394           'target_name': 'cast_shell_manifest',
395           'type': 'none',
396           'variables': {
397             'jinja_inputs': ['browser/android/apk/AndroidManifest.xml.jinja2'],
398             'jinja_output': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
399           },
400           'includes': [ '../build/android/jinja_template.gypi' ],
401         },
402         {
403           'target_name': 'cast_shell_apk',
404           'type': 'none',
405           'dependencies': [
406             'cast_shell_java',
407             'libcast_shell_android',
408           ],
409           'variables': {
410             'apk_name': 'CastShell',
411             'manifest_package_name': 'org.chromium.chromecast.shell',
412             # Note(gunsch): there are no Java files in the android/ directory.
413             # Unfortunately, the java_apk.gypi target rigidly insists on having
414             # a java_in_dir directory, but complains about duplicate classes
415             # from the common cast_shell_java target (shared with internal APK)
416             # if the actual Java path is used.
417             # This will hopefully be removable after the great GN migration.
418             'java_in_dir': 'android',
419             'android_manifest_path': '<(SHARED_INTERMEDIATE_DIR)/cast_shell_manifest/AndroidManifest.xml',
420             'package_name': 'org.chromium.chromecast.shell',
421             'native_lib_target': 'libcast_shell_android',
422             'asset_location': '<(PRODUCT_DIR)/assets',
423             'additional_input_paths': ['<(PRODUCT_DIR)/assets/cast_shell.pak'],
424           },
425           'includes': [ '../build/java_apk.gypi' ],
426         },
427         {
428           'target_name': 'cast_jni_headers',
429           'type': 'none',
430           'sources': [
431             'browser/android/apk/src/org/chromium/chromecast/shell/CastCrashHandler.java',
432             'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java',
433             'browser/android/apk/src/org/chromium/chromecast/shell/CastWindowManager.java',
434             'browser/android/apk/src/org/chromium/chromecast/shell/ExternalVideoSurfaceContainer.java',
435           ],
436           'direct_dependent_settings': {
437             'include_dirs': [
438               '<(SHARED_INTERMEDIATE_DIR)/chromecast',
439             ],
440           },
441           'variables': {
442             'jni_gen_package': 'chromecast',
443           },
444           'includes': [ '../build/jni_generator.gypi' ],
445         },
446       ],  # end of targets
447     }, {  # OS != "android"
448       'targets': [
449         {
450           'target_name': 'cast_shell_media',
451           'type': '<(component)',
452           'dependencies': [
453             'media/media.gyp:cast_media',
454             '../content/content.gyp:content',
455             '../ipc/ipc.gyp:ipc',
456             '../media/media.gyp:media',
457           ],
458           'sources': [
459             'browser/media/cast_browser_cdm_factory.cc',
460             'browser/media/cast_browser_cdm_factory.h',
461             'browser/media/cma_message_filter_host.cc',
462             'browser/media/cma_message_filter_host.h',
463             'browser/media/cma_message_loop.cc',
464             'browser/media/cma_message_loop.h',
465             'browser/media/media_pipeline_host.cc',
466             'browser/media/media_pipeline_host.h',
467             'common/media/cma_ipc_common.h',
468             'common/media/cma_messages.h',
469             'common/media/cma_message_generator.cc',
470             'common/media/cma_message_generator.h',
471             'common/media/cma_param_traits.cc',
472             'common/media/cma_param_traits.h',
473             'common/media/shared_memory_chunk.cc',
474             'common/media/shared_memory_chunk.h',
475             'renderer/media/audio_pipeline_proxy.cc',
476             'renderer/media/audio_pipeline_proxy.h',
477             'renderer/media/cma_media_renderer_factory.cc',
478             'renderer/media/cma_media_renderer_factory.h',
479             'renderer/media/cma_message_filter_proxy.cc',
480             'renderer/media/cma_message_filter_proxy.h',
481             'renderer/media/media_channel_proxy.cc',
482             'renderer/media/media_channel_proxy.h',
483             'renderer/media/media_pipeline_proxy.cc',
484             'renderer/media/media_pipeline_proxy.h',
485             'renderer/media/video_pipeline_proxy.cc',
486             'renderer/media/video_pipeline_proxy.h',
487           ],
488         },  # end of target 'cast_shell_media'
489         # This target contains all of the primary code of |cast_shell|, except
490         # for |main|. This allows end-to-end tests using |cast_shell|.
491         # This also includes all targets that cannot be built on Android.
492         {
493           'target_name': 'cast_shell_core',
494           'type': '<(component)',
495           'dependencies': [
496             'cast_net',
497             'cast_shell_media',
498             'cast_shell_common',
499             'media/media.gyp:cast_media',
500             '../ui/aura/aura.gyp:aura_test_support',
501           ],
502           'conditions': [
503             ['chromecast_branding=="Chrome"', {
504               'dependencies': [
505                 '<(cast_internal_gyp):cast_gfx_internal',
506               ],
507             }, {
508               'dependencies': [
509                 '../ui/ozone/ozone.gyp:eglplatform_shim_x11',
510               ],
511             }],
512           ],
513         },
514         {
515           'target_name': 'cast_shell',
516           'type': 'executable',
517           'dependencies': [
518             'cast_shell_core',
519           ],
520           'sources': [
521             'app/cast_main.cc',
522           ],
523           # TODO(dougsteed): remove when Chromecast moves to boringssl.
524           # Allow the cast shell to find the NSS module in the same directory.
525           'ldflags': [
526             '-Wl,-rpath=\$$ORIGIN'
527           ],
528         },
529       ],  # end of targets
530     }],
531   ],  # end of conditions