Add an extension override bubble and warning box for proxy extensions.
[chromium-blink-merge.git] / chrome / chrome_resources.gyp
blob315079eaf5910f4b706c5246876f94908d691411
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.
5   'variables': {
6     'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
7     'about_credits_file': '<(SHARED_INTERMEDIATE_DIR)/about_credits.html',
8     'additional_modules_list_file': '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/internal/additional_modules_list.txt',
9     'omnibox_mojom_file': '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/ui/webui/omnibox/omnibox.mojom.js',
10   },
11   'targets': [
12     {
13       'target_name': 'chrome_extra_resources',
14       'type': 'none',
15       # These resources end up in resources.pak because they are resources
16       # used by internal pages.  Putting them in a separate pak file makes
17       # it easier for us to reference them internally.
18       'actions': [
19         {
20           'action_name': 'generate_memory_internals_resources',
21           'variables': {
22             'grit_grd_file': 'browser/resources/memory_internals_resources.grd',
23           },
24           'includes': [ '../build/grit_action.gypi' ],
25         },
26         {
27           'action_name': 'generate_net_internals_resources',
28           'variables': {
29             'grit_grd_file': 'browser/resources/net_internals_resources.grd',
30           },
31           'includes': [ '../build/grit_action.gypi' ],
32         },
33         {
34           'action_name': 'generate_invalidations_resources',
35           'variables': {
36             'grit_grd_file': 'browser/resources/invalidations_resources.grd',
37             },
38           'includes': ['../build/grit_action.gypi' ],
39         },
40         {
41           'action_name': 'generate_password_manager_internals_resources',
42           'variables': {
43             'grit_grd_file': 'browser/resources/password_manager_internals_resources.grd',
44           },
45           'includes': [ '../build/grit_action.gypi' ],
46         },
47         {
48           'action_name': 'generate_signin_internals_resources',
49           'variables': {
50             'grit_grd_file': 'browser/resources/signin_internals_resources.grd',
51             },
52           'includes': ['../build/grit_action.gypi' ],
53         },
54         {
55           'action_name': 'generate_sync_internals_resources',
56           'variables': {
57             'grit_grd_file': 'browser/resources/sync_internals_resources.grd',
58           },
59           'includes': [ '../build/grit_action.gypi' ],
60         },
61         {
62           'action_name': 'generate_translate_internals_resources',
63           'variables': {
64             'grit_grd_file': 'browser/resources/translate_internals_resources.grd',
65           },
66           'includes': [ '../build/grit_action.gypi' ],
67         },
68       ],
69       'includes': [ '../build/grit_target.gypi' ],
70       'conditions': [
71         ['OS != "ios"', {
72           'dependencies': [
73             '../components/components_resources.gyp:components_resources',
74             '../content/browser/devtools/devtools_resources.gyp:devtools_resources',
75             '../content/browser/tracing/tracing_resources.gyp:tracing_resources',
76           ],
77           'actions': [
78             {
79               'action_name': 'generate_component_extension_resources',
80               'variables': {
81                 'grit_grd_file': 'browser/resources/component_extension_resources.grd',
82               },
83               'includes': [ '../build/grit_action.gypi' ],
84             },
85             {
86               'action_name': 'generate_options_resources',
87               'variables': {
88                 'grit_grd_file': 'browser/resources/options_resources.grd',
89               },
90               'includes': [ '../build/grit_action.gypi' ],
91             },
92             {
93               'action_name': 'generate_quota_internals_resources',
94               'variables': {
95                 'grit_grd_file': 'browser/resources/quota_internals_resources.grd',
96               },
97               'includes': [ '../build/grit_action.gypi' ],
98             },
99             {
100               'action_name': 'generate_sync_file_system_internals_resources',
101               'variables': {
102                 'grit_grd_file': 'browser/resources/sync_file_system_internals_resources.grd',
103               },
104               'includes': [ '../build/grit_action.gypi' ],
105             },
106           ],
107           'copies': [
108             {
109               'destination': '<(PRODUCT_DIR)/resources/extension/demo',
110               'files': [
111                 'browser/resources/extension_resource/demo/library.js',
112               ],
113             },
114           ],
115         }],
116         ['chromeos==1 and disable_nacl==0 and disable_nacl_untrusted==0', {
117           'conditions': [
118             # TODO(dtseng): Remove use_chromevox_next once ChromeVox Next is ready for testing.
119             ['use_chromevox_next==1', {
120               'dependencies': [
121                 'browser/resources/chromeos/chromevox2/chromevox.gyp:chromevox2',
122               ],
123             }, { # else use_chromevox_next == 0
124               'dependencies': [
125                 'browser/resources/chromeos/chromevox/chromevox.gyp:chromevox',
126               ],
127             }],
128           ],
129         }],
130       ],
131     },
132     {
133       'target_name': 'chrome_internal_resources_gen',
134       'type': 'none',
135       'conditions': [
136         ['branding=="Chrome"', {
137           'actions': [
138             {
139               'action_name': 'generate_transform_additional_modules_list',
140               'variables': {
141                 'additional_modules_input_path':
142                   'browser/internal/resources/additional_modules_list.input',
143                 'additional_modules_py_path':
144                   'browser/internal/transform_additional_modules_list.py',
145               },
146               'inputs': [
147                 '<(additional_modules_input_path)',
148               ],
149               'outputs': [
150                 '<(additional_modules_list_file)',
151               ],
152               'action': [
153                 'python',
154                 '<(additional_modules_py_path)',
155                 '<(additional_modules_input_path)',
156                 '<@(_outputs)',
157               ],
158               'message': 'Transforming additional modules list',
159             }
160           ],
161         }],
162       ],
163     },
164     {
165       # TODO(mark): It would be better if each static library that needed
166       # to run grit would list its own .grd files, but unfortunately some
167       # of the static libraries currently have circular dependencies among
168       # generated headers.
169       'target_name': 'chrome_resources',
170       'type': 'none',
171       'dependencies': [
172         'about_credits',
173         'chrome_internal_resources_gen',
174         'chrome_web_ui_mojo_bindings.gyp:web_ui_mojo_bindings',
175       ],
176       'actions': [
177         {
178           'action_name': 'generate_browser_resources',
179           'variables': {
180             'grit_grd_file': 'browser/browser_resources.grd',
181             'grit_additional_defines': [
182               '-E', 'about_credits_file=<(about_credits_file)',
183               '-E', 'additional_modules_list_file=<(additional_modules_list_file)',
184               '-E', 'omnibox_mojom_file=<(omnibox_mojom_file)',
185             ],
186           },
187           'includes': [ '../build/grit_action.gypi' ],
188         },
189         {
190           'action_name': 'generate_common_resources',
191           'variables': {
192             'grit_grd_file': 'common/common_resources.grd',
193           },
194           'includes': [ '../build/grit_action.gypi' ],
195         },
196         {
197           'action_name': 'generate_renderer_resources',
198           'variables': {
199             'grit_grd_file': 'renderer/resources/renderer_resources.grd',
200           },
201           'includes': [ '../build/grit_action.gypi' ],
202         },
203       ],
204       'conditions': [
205         ['enable_extensions==1', {
206           'actions': [
207             {
208               'action_name': 'generate_extensions_api_resources',
209               'variables': {
210                 'grit_grd_file': 'common/extensions_api_resources.grd',
211               },
212               'includes': [ '../build/grit_action.gypi' ],
213             }
214           ],
215         }],
216       ],
217       'includes': [ '../build/grit_target.gypi' ],
218     },
219     {
220       # TODO(mark): It would be better if each static library that needed
221       # to run grit would list its own .grd files, but unfortunately some
222       # of the static libraries currently have circular dependencies among
223       # generated headers.
224       'target_name': 'chrome_strings',
225       'type': 'none',
226       'actions': [
227         {
228           'action_name': 'generate_locale_settings',
229           'variables': {
230             'grit_grd_file': 'app/resources/locale_settings.grd',
231           },
232           'includes': [ '../build/grit_action.gypi' ],
233         },
234         {
235           'action_name': 'generate_chromium_strings',
236           'variables': {
237             'grit_grd_file': 'app/chromium_strings.grd',
238           },
239           'includes': [ '../build/grit_action.gypi' ],
240         },
241         {
242           'action_name': 'generate_generated_resources',
243           'variables': {
244             'grit_grd_file': 'app/generated_resources.grd',
245           },
246           'includes': [ '../build/grit_action.gypi' ],
247         },
248         {
249           'action_name': 'generate_google_chrome_strings',
250           'variables': {
251             'grit_grd_file': 'app/google_chrome_strings.grd',
252           },
253           'includes': [ '../build/grit_action.gypi' ],
254         },
255       ],
256       'includes': [ '../build/grit_target.gypi' ],
257     },
258     {
259       'target_name': 'chrome_strings_map',
260       'type': 'none',
261       'dependencies': [ 'chrome_strings', ],
262       'actions': [
263         {
264           'action_name': 'generate_resources_map',
265           'inputs': [
266             '<(grit_out_dir)/grit/generated_resources.h'
267           ],
268           'outputs': [
269             '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/metrics/variations/generated_resources_map.cc',
270           ],
271           'action': [
272             'python',
273             'browser/metrics/variations/generate_resources_map.py',
274             '<(grit_out_dir)/grit/generated_resources.h',
275             '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/metrics/variations/generated_resources_map.cc'
276           ],
277           'message': 'Generating generated resources map.',
278         }
279       ],
280     },
281     {
282       'target_name': 'platform_locale_settings',
283       'type': 'none',
284       'variables': {
285         'conditions': [
286           ['OS=="win"', {
287             'platform_locale_settings_grd':
288                 'app/resources/locale_settings_win.grd',
289           },],
290           ['OS=="linux"', {
291             'conditions': [
292               ['chromeos==1', {
293                 'conditions': [
294                   ['branding=="Chrome"', {
295                     'platform_locale_settings_grd':
296                         'app/resources/locale_settings_google_chromeos.grd',
297                   }, {  # branding!=Chrome
298                     'platform_locale_settings_grd':
299                         'app/resources/locale_settings_chromiumos.grd',
300                   }],
301                 ]
302               }, {  # chromeos==0
303                 'platform_locale_settings_grd':
304                     'app/resources/locale_settings_linux.grd',
305               }],
306             ],
307           },],
308           ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "linux"', {
309             'platform_locale_settings_grd':
310                 'app/resources/locale_settings_linux.grd',
311           },],
312           ['OS == "mac" or OS == "ios"', {
313             'platform_locale_settings_grd':
314                 'app/resources/locale_settings_mac.grd',
315           }],
316         ],  # conditions
317       },  # variables
318       'actions': [
319         {
320           'action_name': 'generate_platform_locale_settings',
321           'variables': {
322             'grit_grd_file': '<(platform_locale_settings_grd)',
323           },
324           'includes': [ '../build/grit_action.gypi' ],
325         },
326       ],
327       'includes': [ '../build/grit_target.gypi' ],
328     },
329     {
330       'target_name': 'theme_resources',
331       'type': 'none',
332       'dependencies': [
333         '../ui/resources/ui_resources.gyp:ui_resources',
334         'chrome_unscaled_resources',
335       ],
336       'actions': [
337         {
338           'action_name': 'generate_theme_resources',
339           'variables': {
340             'grit_grd_file': 'app/theme/theme_resources.grd',
341           },
342           'includes': [ '../build/grit_action.gypi' ],
343         },
344       ],
345       'includes': [ '../build/grit_target.gypi' ],
346     },
347     {
348       'target_name': 'packed_extra_resources',
349       'type': 'none',
350       'dependencies': [
351         'chrome_extra_resources',
352         'packed_resources',
353       ],
354       'actions': [
355         {
356           'includes': ['chrome_repack_resources.gypi']
357         },
358       ],
359       'conditions': [
360         ['OS != "mac" and OS != "ios"', {
361           # We'll install the resource files to the product directory.  The Mac
362           # copies the results over as bundle resources in its own special way.
363           'copies': [
364             {
365               'destination': '<(PRODUCT_DIR)',
366               'files': [
367                 '<(SHARED_INTERMEDIATE_DIR)/repack/resources.pak'
368               ],
369             },
370           ],
371         }],
372       ],
373     },
374     {
375       'target_name': 'packed_resources',
376       'type': 'none',
377       'dependencies': [
378         # MSVS needs the dependencies explictly named, Make is able to
379         # derive the dependencies from the output files.
380         'chrome_resources',
381         'chrome_strings',
382         'platform_locale_settings',
383         'theme_resources',
384         '<(DEPTH)/components/components_strings.gyp:components_strings',
385         '<(DEPTH)/net/net.gyp:net_resources',
386         '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
387         '<(DEPTH)/ui/strings/ui_strings.gyp:ui_strings',
388       ],
389       'actions': [
390         {
391           'action_name': 'repack_locales_pack',
392           'variables': {
393             'pak_locales': '<(locales)',
394           },
395           'includes': ['chrome_repack_locales.gypi']
396         },
397         {
398           'action_name': 'repack_pseudo_locales_pack',
399           'variables': {
400             'pak_locales': '<(pseudo_locales)',
401           },
402           'includes': ['chrome_repack_locales.gypi']
403         },
404         {
405           'includes': ['chrome_repack_chrome_100_percent.gypi']
406         },
407         {
408           'includes': ['chrome_repack_chrome_200_percent.gypi']
409         },
410       ],
411       'conditions': [
412         ['OS != "ios"', {
413           'dependencies': [
414             '<(DEPTH)/content/content_resources.gyp:content_resources',
415             '<(DEPTH)/device/bluetooth/bluetooth_strings.gyp:device_bluetooth_strings',
416             '<(DEPTH)/extensions/extensions_strings.gyp:extensions_strings',
417             '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
418             '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings',
419           ],
420         }],
421         ['use_ash==1', {
422           'dependencies': [
423              '<(DEPTH)/ash/ash_resources.gyp:ash_resources',
424              '<(DEPTH)/ash/ash_strings.gyp:ash_strings',
425           ],
426         }],
427         ['enable_autofill_dialog==1 and OS!="android"', {
428           'dependencies': [
429             '<(DEPTH)/third_party/libaddressinput/libaddressinput.gyp:libaddressinput_strings',
430           ],
431         }],
432         ['OS != "mac" and OS != "ios"', {
433           # Copy pak files to the product directory. These files will be picked
434           # up by the following installer scripts:
435           #   - Windows: chrome/installer/mini_installer/chrome.release
436           #   - Linux: chrome/installer/linux/internal/common/installer.include
437           # Ensure that the above scripts are updated when adding or removing
438           # pak files.
439           # Copying files to the product directory is not needed on the Mac
440           # since the framework build phase will copy them into the framework
441           # bundle directly.
442           'copies': [
443             {
444               'destination': '<(PRODUCT_DIR)',
445               'files': [
446                 '<(SHARED_INTERMEDIATE_DIR)/repack/chrome_100_percent.pak'
447               ],
448             },
449             {
450               'destination': '<(PRODUCT_DIR)/locales',
451               'files': [
452                 '<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(locales))'
453               ],
454             },
455             {
456               'destination': '<(PRODUCT_DIR)/pseudo_locales',
457               'files': [
458                 '<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(pseudo_locales))'
459               ],
460             },
461           ],
462           'conditions': [
463             ['branding=="Chrome"', {
464               'copies': [
465                 {
466                   # This location is for the Windows and Linux builds. For
467                   # Windows, the chrome.release file ensures that these files
468                   # are copied into the installer. Note that we have a separate
469                   # section in chrome_dll.gyp to copy these files for Mac, as it
470                   # needs to be dropped inside the framework.
471                   'destination': '<(PRODUCT_DIR)/default_apps',
472                   'files': ['<@(default_apps_list)']
473                 },
474               ],
475             }],
476             ['enable_hidpi == 1', {
477               'copies': [
478                 {
479                   'destination': '<(PRODUCT_DIR)',
480                   'files': [
481                     '<(SHARED_INTERMEDIATE_DIR)/repack/chrome_200_percent.pak',
482                   ],
483                 },
484               ],
485             }],
486           ], # conditions
487         }], # end OS != "mac" and OS != "ios"
488       ], # conditions
489     },
490     {
491       'target_name': 'chrome_unscaled_resources',
492       'type': 'none',
493       'actions': [
494         {
495           'action_name': 'generate_chrome_unscaled_resources',
496           'variables': {
497             'grit_grd_file': 'app/theme/chrome_unscaled_resources.grd',
498           },
499           'includes': [ '../build/grit_action.gypi' ],
500         },
501       ],
502       'includes': [ '../build/grit_target.gypi' ],
503     },
504     {
505       'target_name': 'about_credits',
506       'type': 'none',
507       'actions': [
508         {
509           'variables': {
510             'generator_path': '../tools/licenses.py',
511           },
512           'action_name': 'generate_about_credits',
513           'inputs': [
514             # TODO(phajdan.jr): make licenses.py print inputs too.
515             '<(generator_path)',
516           ],
517           'outputs': [
518             '<(about_credits_file)',
519           ],
520           'hard_dependency': 1,
521           'action': ['python',
522                      '<(generator_path)',
523                      'credits',
524                      '<(about_credits_file)',
525           ],
526           'message': 'Generating about:credits',
527         },
528       ],
529     },
530   ], # targets