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.
5 import("//tools/grit/grit_rule.gni")
6 import("//tools/grit/repack.gni")
9 # Enable to include Polymer 0.8 in the binary.
10 enable_polymer_v08 = false
13 # GYP version: ui/resources/ui_resources.gyp:ui_resources
17 ":ui_unscaled_resources_grd",
18 ":webui_resources_grd",
22 grit("ui_resources_grd") {
23 source = "ui_resources.grd"
25 "grit/ui_resources.h",
26 "grit/ui_resources_map.cc",
27 "grit/ui_resources_map.h",
28 "ui_resources_100_percent.pak",
29 "ui_resources_200_percent.pak",
30 "ui_resources_300_percent.pak",
34 grit("ui_unscaled_resources_grd") {
35 source = "ui_unscaled_resources.grd"
36 use_qualified_include = true
38 "grit/ui_unscaled_resources.h",
39 "ui_unscaled_resources.rc",
43 webui_grit_defines = []
44 if (enable_polymer_v08) {
45 webui_grit_defines += [ "enable_polymer_v08" ]
48 grit("webui_resources_grd") {
49 source = "../webui/resources/webui_resources.grd"
51 "grit/webui_resources.h",
52 "grit/webui_resources_map.cc",
53 "grit/webui_resources_map.h",
54 "webui_resources.pak",
56 defines = webui_grit_defines
60 copy("copy_ui_resources_100_percent") {
62 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
65 "$root_out_dir/ui_resources_100_percent.pak",
73 # On iOS and Mac the string resources need to go into a locale subfolder, which
74 # introduces an extra dependency.
76 # GYP version: ui/resources/ui_resources.gyp:ui_test_pak
77 # (copy_ui_test_pak action)
78 if (is_ios || is_mac) {
79 group("ui_test_pak") {
81 ":repack_ui_test_pak",
82 ":repack_ui_test_mac_locale_pack",
88 "$root_out_dir/ui_test.pak",
91 "$root_out_dir/ui/en-US.pak",
94 ":repack_ui_test_pak",
99 # GYP version: ui/resources/ui_resources.gyp:ui_test_pak
100 repack("repack_ui_test_pak") {
101 # Depend on ui_test_pak instead of this one.
102 visibility = [ ":ui_test_pak" ]
105 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
106 "$root_gen_dir/ui/resources/webui_resources.pak",
107 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
108 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
113 "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_100_percent.pak",
114 "$root_gen_dir/ui/chromeos/strings/ui_chromeos_strings_en-US.pak",
118 output = "$root_out_dir/ui_test.pak"
126 deps += [ ":copy_ui_resources_100_percent" ]
131 "//ui/chromeos/resources",
132 "//ui/chromeos/strings",
137 # Repack just the strings for the framework locales on Mac and iOS. This
138 # emulates repack_locales.py, but just for en-US. Note ui_test.pak is not simply
139 # copied, because it causes leaks from allocations within system libraries when
140 # trying to load non-string resources. http://crbug.com/413034.
141 repack("repack_ui_test_mac_locale_pack") {
144 "//:gn_visibility", # TODO(GYP): this shouldn't be necessary.
148 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
149 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
152 output = "$root_out_dir/ui/en.lproj/locale.pak"