OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Without any args, this simply loads the IDs out of a bunch of the Chrome GRD | 6 """Without any args, this simply loads the IDs out of a bunch of the Chrome GRD |
7 files, and then checks the subset of the code that loads the strings to try | 7 files, and then checks the subset of the code that loads the strings to try |
8 and figure out what isn't in use any more. | 8 and figure out what isn't in use any more. |
9 You can give paths to GRD files and source directories to control what is | 9 You can give paths to GRD files and source directories to control what is |
10 check instead. | 10 check instead. |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 os.path.join(chrome_app_res_dir, 'locale_settings_cros.grd'), | 141 os.path.join(chrome_app_res_dir, 'locale_settings_cros.grd'), |
142 os.path.join(chrome_app_res_dir, 'locale_settings_linux.grd'), | 142 os.path.join(chrome_app_res_dir, 'locale_settings_linux.grd'), |
143 os.path.join(chrome_app_res_dir, 'locale_settings_mac.grd'), | 143 os.path.join(chrome_app_res_dir, 'locale_settings_mac.grd'), |
144 os.path.join(chrome_app_res_dir, 'locale_settings_win.grd'), | 144 os.path.join(chrome_app_res_dir, 'locale_settings_win.grd'), |
145 os.path.join(chrome_app_dir, 'theme', 'theme_resources.grd'), | 145 os.path.join(chrome_app_dir, 'theme', 'theme_resources.grd'), |
146 os.path.join(chrome_dir, 'browser', 'browser_resources.grd'), | 146 os.path.join(chrome_dir, 'browser', 'browser_resources.grd'), |
147 os.path.join(chrome_dir, 'browser', 'resources', 'shared_resources.grd'), | 147 os.path.join(chrome_dir, 'browser', 'resources', 'shared_resources.grd'), |
148 os.path.join(chrome_dir, 'common', 'common_resources.grd'), | 148 os.path.join(chrome_dir, 'common', 'common_resources.grd'), |
149 os.path.join(chrome_dir, 'renderer', 'renderer_resources.grd'), | 149 os.path.join(chrome_dir, 'renderer', 'renderer_resources.grd'), |
150 os.path.join(src_dir, 'ui', 'resources', 'ui_resources.grd'), | 150 os.path.join(src_dir, 'ui', 'resources', 'ui_resources.grd'), |
| 151 os.path.join(src_dir, 'ui', 'resources', 'ui_resources_wallpapers.grd'), |
151 os.path.join(ui_base_strings_dir, 'app_locale_settings.grd'), | 152 os.path.join(ui_base_strings_dir, 'app_locale_settings.grd'), |
152 os.path.join(ui_base_strings_dir, 'ui_strings.grd'), | 153 os.path.join(ui_base_strings_dir, 'ui_strings.grd'), |
153 ] | 154 ] |
154 | 155 |
155 # If no source directories were given, default them: | 156 # If no source directories were given, default them: |
156 if len(src_dirs) == 0: | 157 if len(src_dirs) == 0: |
157 src_dirs = [ | 158 src_dirs = [ |
158 os.path.join(src_dir, 'app'), | 159 os.path.join(src_dir, 'app'), |
159 os.path.join(src_dir, 'chrome'), | 160 os.path.join(src_dir, 'chrome'), |
160 os.path.join(src_dir, 'chrome_frame'), | 161 os.path.join(src_dir, 'chrome_frame'), |
161 os.path.join(src_dir, 'content'), | 162 os.path.join(src_dir, 'content'), |
162 os.path.join(src_dir, 'ui'), | 163 os.path.join(src_dir, 'ui'), |
163 os.path.join(src_dir, 'views'), | 164 os.path.join(src_dir, 'views'), |
164 # nsNSSCertHelper.cpp has a bunch of ids | 165 # nsNSSCertHelper.cpp has a bunch of ids |
165 os.path.join(src_dir, 'third_party', 'mozilla_security_manager'), | 166 os.path.join(src_dir, 'third_party', 'mozilla_security_manager'), |
166 os.path.join(chrome_dir, 'installer'), | 167 os.path.join(chrome_dir, 'installer'), |
167 ] | 168 ] |
168 | 169 |
169 return CheckForUnusedGrdIDsInSources(grd_files, src_dirs) | 170 return CheckForUnusedGrdIDsInSources(grd_files, src_dirs) |
170 | 171 |
171 | 172 |
172 if __name__ == '__main__': | 173 if __name__ == '__main__': |
173 sys.exit(main()) | 174 sys.exit(main()) |
OLD | NEW |