Implement HasPermission() method in PermissionService.
[chromium-blink-merge.git] / content / content.gyp
blob0a7922dc3a42b80199fc09d361f7a574c3c1f6fb
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     'chromium_code': 1,  # Use higher warning level.
8     'chromium_enable_vtune_jit_for_v8%': 0,  # enable the vtune support for V8 engine.
9     'directxsdk_exists': '<!pymod_do_main(dir_exists ../third_party/directxsdk)',
10   },
11   'target_defaults': {
12     'defines': ['CONTENT_IMPLEMENTATION'],
13     'conditions': [
14       # TODO(jschuh): Remove this after crbug.com/173851 gets fixed.
15       ['OS=="win" and target_arch=="x64"', {
16         'msvs_settings': {
17           'VCCLCompilerTool': {
18             'AdditionalOptions': ['/bigobj'],
19           },
20         },
21       }],
22     ],
23   },
24   'includes': [
25     'content_common_mojo_bindings.gypi',
26   ],
27   'conditions': [
28     ['OS != "ios"', {
29       'includes': [
30         '../build/win_precompile.gypi',
31         'content_resources.gypi',
32       ],
33     }],
34     ['OS == "win"', {
35       'targets': [
36         {
37           'target_name': 'content_startup_helper_win',
38           'type': 'static_library',
39           'include_dirs': [
40             '..',
41           ],
42           'dependencies': [
43             '../base/base.gyp:base',
44             '../base/base.gyp:base_i18n',
45             '../sandbox/sandbox.gyp:sandbox',
46           ],
47           'sources': [
48             'app/startup_helper_win.cc',
49             'public/app/startup_helper_win.h',
50           ],
51         }
52       ],
53     }],
54     # In component mode, we build all of content as a single DLL.
55     # However, in the static mode, we need to build content as multiple
56     # targets in order to prevent dependencies from getting introduced
57     # upstream unnecessarily (e.g., content_renderer depends on allocator
58     # and chrome_exe depends on content_common but we don't want
59     # chrome_exe to have to depend on allocator).
60     ['component=="static_library"', {
61       'target_defines': [
62         'COMPILE_CONTENT_STATICALLY',
63       ],
64       'targets': [
65         {
66           # GN version: //content
67           'target_name': 'content',
68           'type': 'none',
69           'dependencies': [
70             'content_browser',
71             'content_common',
72             'content_common_mojo_bindings',
73           ],
74           'export_dependent_settings': [
75             'content_common',
76             'content_common_mojo_bindings',
77           ],
78           'conditions': [
79             ['OS != "ios"', {
80               'dependencies': [
81                 'content_child',
82                 'content_gpu',
83                 'content_plugin',
84                 'content_ppapi_plugin',
85                 'content_renderer',
86                 'content_utility',
87               ],
88             }],
89           ],
90         },
91         {
92           # GN version: //content/app:browser
93           'target_name': 'content_app_browser',
94           'type': 'static_library',
95           'variables': { 'enable_wexit_time_destructors': 1, },
96           'includes': [
97             'content_app.gypi',
98           ],
99           'dependencies': [
100             'content_common',
101           ],
102           'export_dependent_settings': [
103             'content_common',
104           ],
105           'conditions': [
106             ['chrome_multiple_dll', {
107               'defines': [
108                 'CHROME_MULTIPLE_DLL_BROWSER',
109               ],
110             }],
111           ],
112         },
113         {
114           # GN version: //content/app:child
115           'target_name': 'content_app_child',
116           'type': 'static_library',
117           'variables': { 'enable_wexit_time_destructors': 1, },
118           'includes': [
119             'content_app.gypi',
120           ],
121           'dependencies': [
122             'content_common',
123           ],
124           'export_dependent_settings': [
125             'content_common',
126           ],
127           'conditions': [
128             ['chrome_multiple_dll', {
129               'defines': [
130                 'CHROME_MULTIPLE_DLL_CHILD',
131               ],
132             }],
133           ],
134         },
135         {
136           # GN version: //content/app:both
137           'target_name': 'content_app_both',
138           'type': 'static_library',
139           'variables': { 'enable_wexit_time_destructors': 1, },
140           'includes': [
141             'content_app.gypi',
142           ],
143           'dependencies': [
144             'content_common',
145             'content_common_mojo_bindings',
146           ],
147           'export_dependent_settings': [
148             'content_common',
149             'content_common_mojo_bindings',
150           ],
151         },
152         {
153           # GN version: //content/browser and //content/public/browser
154           'target_name': 'content_browser',
155           'type': 'static_library',
156           'variables': { 'enable_wexit_time_destructors': 1, },
157           'includes': [
158             'content_browser.gypi',
159             # Disable LTO due to ELF section name out of range
160             # crbug.com/422251
161             '../build/android/disable_lto.gypi',
162           ],
163           'dependencies': [
164             'content_common',
165             'content_common_mojo_bindings',
166           ],
167           'export_dependent_settings': [
168             'content_common',
169             'content_common_mojo_bindings',
170           ],
171           'conditions': [
172             ['java_bridge==1', {
173               'dependencies': [
174                 'content_child',
175               ]
176             }],
177             ['OS=="android"', {
178               'dependencies': [
179                 'content_gpu',
180                 'content_utility',
181               ],
182             }],
183             ['OS != "ios"', {
184               'dependencies': [
185                 'content_resources',
186               ],
187             }],
188           ],
189         },
190         {
191           # GN version: //content/common and //content/public/common
192           'target_name': 'content_common',
193           'type': 'static_library',
194           'variables': { 'enable_wexit_time_destructors': 1, },
195           'includes': [
196             'content_common.gypi',
197           ],
198           'dependencies': [
199             'content_common_mojo_bindings',
200           ],
201           'conditions': [
202             ['OS != "ios"', {
203               'dependencies': [
204                 'content_resources',
205               ],
206             }],
207           ],
208           # Disable c4267 warnings until we fix size_t to int truncations.
209           'msvs_disabled_warnings': [ 4267, ],
210         },
211       ],
212       'conditions': [
213         ['OS != "ios"', {
214           'targets': [
215             {
216               # GN version: //content/child and //content/public/child
217               'target_name': 'content_child',
218               'type': 'static_library',
219               'variables': { 'enable_wexit_time_destructors': 1, },
220               'includes': [
221                 'content_child.gypi',
222               ],
223               'dependencies': [
224                 'content_resources',
225               ],
226               # Disable c4267 warnings until we fix size_t to int truncations.
227               'msvs_disabled_warnings': [ 4267, ],
228             },
229             {
230               # GN version: //content/gpu
231               'target_name': 'content_gpu',
232               'type': 'static_library',
233               'variables': { 'enable_wexit_time_destructors': 1, },
234               'includes': [
235                 'content_gpu.gypi',
236               ],
237               'dependencies': [
238                 'content_child',
239                 'content_common',
240               ],
241             },
242             {
243               # GN version: //content/plugin and //content/public/plugin
244               'target_name': 'content_plugin',
245               'type': 'static_library',
246               'variables': { 'enable_wexit_time_destructors': 1, },
247               'includes': [
248                 'content_plugin.gypi',
249               ],
250               'dependencies': [
251                 'content_child',
252                 'content_common',
253               ],
254             },
255             {
256               # GN version: //content/ppapi_plugin
257               'target_name': 'content_ppapi_plugin',
258               'type': 'static_library',
259               'variables': { 'enable_wexit_time_destructors': 1, },
260               'includes': [
261                 'content_ppapi_plugin.gypi',
262               ],
263               # Disable c4267 warnings until we fix size_t to int truncations.
264               'msvs_disabled_warnings': [ 4267, ],
265             },
266             {
267               # GN version: //content/renderer and //content/public/renderer
268               'target_name': 'content_renderer',
269               'type': 'static_library',
270               'variables': { 'enable_wexit_time_destructors': 1, },
271               'includes': [
272                 'content_renderer.gypi',
273               ],
274               'dependencies': [
275                 'content_child',
276                 'content_common',
277                 'content_resources',
278               ],
279               'export_dependent_settings': [
280                 'content_common',
281               ],
282               'conditions': [
283                 ['chromium_enable_vtune_jit_for_v8==1', {
284                   'dependencies': [
285                     '../v8/src/third_party/vtune/v8vtune.gyp:v8_vtune',
286                   ],
287                 }],
288               ],
289             },
290             {
291               # GN version: //content/utility and //content/public/utility
292               'target_name': 'content_utility',
293               'type': 'static_library',
294               'variables': { 'enable_wexit_time_destructors': 1, },
295               'includes': [
296                 'content_utility.gypi',
297               ],
298               'dependencies': [
299                 'content_child',
300                 'content_common',
301               ],
302             },
303           ],
304         }],
305       ],
306     },
307     {  # component != static_library
308       'targets': [
309         {
310           # GN version: //content
311           'target_name': 'content',
312           'type': 'shared_library',
313           'variables': { 'enable_wexit_time_destructors': 1, },
314           'dependencies': [
315             'content_common_mojo_bindings',
316             'content_resources',
317           ],
318           'export_dependent_settings': [
319             'content_common_mojo_bindings',
320           ],
321           'conditions': [
322             ['chromium_enable_vtune_jit_for_v8==1', {
323               'dependencies': [
324                 '../v8/src/third_party/vtune/v8vtune.gyp:v8_vtune',
325               ],
326             }],
327           ],
328           'includes': [
329             'content_app.gypi',
330             'content_browser.gypi',
331             'content_child.gypi',
332             'content_common.gypi',
333             'content_gpu.gypi',
334             'content_plugin.gypi',
335             'content_ppapi_plugin.gypi',
336             'content_renderer.gypi',
337             'content_utility.gypi',
338           ],
339           'msvs_settings': {
340             'VCLinkerTool': {
341               'conditions': [
342                 ['incremental_chrome_dll==1', {
343                   'UseLibraryDependencyInputs': "true",
344                 }],
345               ],
346             },
347           },
348         },
349         {
350           # GN version: //content/app:browser
351           'target_name': 'content_app_browser',
352           'type': 'none',
353           'dependencies': ['content', 'content_browser'],
354         },
355         {
356           # GN version: //content/app:child
357           'target_name': 'content_app_child',
358           'type': 'none',
359           'dependencies': ['content', 'content_child'],
360         },
361         {
362           # GN version: //content/app:both
363           'target_name': 'content_app_both',
364           'type': 'none',
365           'dependencies': ['content'],
366           'export_dependent_settings': ['content'],
367         },
368         {
369           # GN version: //content/browser and //content/public/browser
370           'target_name': 'content_browser',
371           'type': 'none',
372           'dependencies': ['content'],
373           'export_dependent_settings': ['content'],
374         },
375         {
376           # GN version: //content/common and //content/public/common
377           'target_name': 'content_common',
378           'type': 'none',
379           'dependencies': ['content', 'content_resources'],
380           # Disable c4267 warnings until we fix size_t to int truncations.
381           'msvs_disabled_warnings': [ 4267, ],
382           'export_dependent_settings': ['content'],
383         },
384         {
385           # GN Version: //content/child
386           'target_name': 'content_child',
387           'type': 'none',
388           'dependencies': ['content'],
389         },
390         {
391           # GN version: //content/gpu
392           'target_name': 'content_gpu',
393           'type': 'none',
394           'dependencies': ['content'],
395         },
396         {
397           # GN version: //content/plugin
398           'target_name': 'content_plugin',
399           'type': 'none',
400           'dependencies': ['content'],
401         },
402         {
403           # GN version: //content/ppapi_plugin
404           'target_name': 'content_ppapi_plugin',
405           'type': 'none',
406           'dependencies': ['content'],
407           # Disable c4267 warnings until we fix size_t to int truncations.
408           'msvs_disabled_warnings': [ 4267, ],
409         },
410         {
411           # GN version: //content/renderer and //content/public/renderer
412           'target_name': 'content_renderer',
413           'type': 'none',
414           'dependencies': ['content'],
415           'export_dependent_settings': ['content'],
416         },
417         {
418           # GN version: //content/utility
419           'target_name': 'content_utility',
420           'type': 'none',
421           'dependencies': ['content'],
422           'export_dependent_settings': ['content'],
423         },
424       ],
425     }],
426     ['OS == "android"', {
427       'targets': [
428         {
429           'target_name': 'common_aidl',
430           'type': 'none',
431           'variables': {
432             'aidl_interface_file': 'public/android/java/src/org/chromium/content/common/common.aidl',
433             'aidl_import_include': 'public/android/java/src',
434           },
435           'sources': [
436             'public/android/java/src/org/chromium/content/common/IChildProcessCallback.aidl',
437             'public/android/java/src/org/chromium/content/common/IChildProcessService.aidl',
438           ],
439           'includes': [ '../build/java_aidl.gypi' ],
440         },
441         {
442           'target_name': 'content_java',
443           'type': 'none',
444           'dependencies': [
445             '../base/base.gyp:base',
446             '../device/battery/battery.gyp:device_battery_java',
447             '../device/vibration/vibration.gyp:device_vibration_java',
448             '../media/media.gyp:media_java',
449             '../mojo/mojo_base.gyp:mojo_system_java',
450             '../mojo/public/mojo_public.gyp:mojo_application_bindings',
451             '../mojo/public/mojo_public.gyp:mojo_bindings_java',
452             '../net/net.gyp:net',
453             '../ui/android/ui_android.gyp:ui_java',
454             'common_aidl',
455             'content_common',
456             'content_strings_grd',
457             'content_gamepad_mapping',
458             'gesture_event_type_java',
459             'popup_item_type_java',
460             'result_codes_java',
461             'selection_event_type_java',
462             'speech_recognition_error_java',
463             'top_controls_state_java',
464             'screen_orientation_values_java',
465           ],
466           'variables': {
467             'java_in_dir': '../content/public/android/java',
468             'has_java_resources': 1,
469             'R_package': 'org.chromium.content',
470             'R_package_relpath': 'org/chromium/content',
471           },
472           'includes': [ '../build/java.gypi' ],
473         },
474         {
475           'target_name': 'content_strings_grd',
476           # The android_webview/Android.mk file depends on this target directly.
477           'android_unmangled_name': 1,
478           'type': 'none',
479           'variables': {
480             'grd_file': '../content/public/android/java/strings/android_content_strings.grd',
481           },
482           'includes': [
483             '../build/java_strings_grd.gypi',
484           ],
485         },
486         {
487           'target_name': 'content_gamepad_mapping',
488           'type': 'none',
489           'variables': {
490             'source_file': 'browser/gamepad/gamepad_standard_mappings.h',
491           },
492           'includes': [ '../build/android/java_cpp_enum.gypi' ],
493         },
494         {
495           'target_name': 'gesture_event_type_java',
496           'type': 'none',
497           'variables': {
498             'source_file': 'browser/android/gesture_event_type.h',
499           },
500           'includes': [ '../build/android/java_cpp_enum.gypi' ],
501         },
502         {
503           'target_name': 'popup_item_type_java',
504           'type': 'none',
505           'variables': {
506             'source_file': 'browser/android/content_view_core_impl.cc',
507           },
508           'includes': [ '../build/android/java_cpp_enum.gypi' ],
509         },
510         {
511           'target_name': 'result_codes_java',
512           'type': 'none',
513           'variables': {
514             'source_file': 'public/common/result_codes.h',
515           },
516           'includes': [ '../build/android/java_cpp_enum.gypi' ],
517         },
518         {
519           'target_name': 'selection_event_type_java',
520           'type': 'none',
521           'variables': {
522             'source_file': 'browser/renderer_host/input/selection_event_type.h',
523           },
524           'includes': [ '../build/android/java_cpp_enum.gypi' ],
525         },
526         {
527           'target_name': 'speech_recognition_error_java',
528           'type': 'none',
529           'variables': {
530             'source_file': 'public/common/speech_recognition_error.h',
531           },
532           'includes': [ '../build/android/java_cpp_enum.gypi' ],
533         },
534         {
535           'target_name': 'top_controls_state_java',
536           'type': 'none',
537           'variables': {
538             'source_file': 'public/common/top_controls_state.h',
539           },
540           'includes': [ '../build/android/java_cpp_enum.gypi' ],
541         },
542         {
543           'target_name': 'screen_orientation_values_java',
544           'type': 'none',
545           'variables': {
546             'source_file': 'public/common/screen_orientation_values.h',
547           },
548           'includes': [ '../build/android/java_cpp_enum.gypi' ],
549         },
550         {
551           'target_name': 'java_set_jni_headers',
552           'type': 'none',
553           'variables': {
554             'jni_gen_package': 'content',
555             'input_java_class': 'java/util/HashSet.class',
556           },
557           'includes': [ '../build/jar_file_jni_generator.gypi' ],
558         },
559         {
560           'target_name': 'motionevent_jni_headers',
561           'type': 'none',
562           'variables': {
563              'jni_gen_package': 'content',
564              'input_java_class': 'android/view/MotionEvent.class',
565            },
566           'includes': [ '../build/jar_file_jni_generator.gypi' ],
567         },
568         {
569           'target_name': 'content_jni_headers',
570           'type': 'none',
571           'dependencies': [
572             'java_set_jni_headers',
573             'motionevent_jni_headers'
574           ],
575           'includes': [ 'content_jni.gypi' ],
576         },
577         {
578           'target_name': 'content_icudata',
579           'type': 'none',
580           'conditions': [
581             ['icu_use_data_file_flag==1', {
582               'copies': [
583                 {
584                   'destination': '<(PRODUCT_DIR)/content_shell/assets',
585                   'files': [
586                     '<(PRODUCT_DIR)/icudtl.dat',
587                   ],
588                 },
589               ],
590             }],
591           ],
592         },
593         {
594           'target_name': 'content_v8_external_data',
595           'type': 'none',
596           'conditions': [
597             ['v8_use_external_startup_data==1', {
598               'copies': [
599                 {
600                   'destination': '<(PRODUCT_DIR)/content_shell/assets',
601                   'files': [
602                     '<(PRODUCT_DIR)/natives_blob.bin',
603                     '<(PRODUCT_DIR)/snapshot_blob.bin',
604                   ],
605                 },
606               ],
607             }],
608           ],
609         },
610       ],
611     }],  # OS == "android"
612   ],