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