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_standard.grd'), | |
152 os.path.join(ui_base_strings_dir, 'app_locale_settings.grd'), | 151 os.path.join(ui_base_strings_dir, 'app_locale_settings.grd'), |
153 os.path.join(ui_base_strings_dir, 'ui_strings.grd'), | 152 os.path.join(ui_base_strings_dir, 'ui_strings.grd'), |
154 ] | 153 ] |
155 | 154 |
156 # If no source directories were given, default them: | 155 # If no source directories were given, default them: |
157 if len(src_dirs) == 0: | 156 if len(src_dirs) == 0: |
158 src_dirs = [ | 157 src_dirs = [ |
159 os.path.join(src_dir, 'app'), | 158 os.path.join(src_dir, 'app'), |
160 os.path.join(src_dir, 'chrome'), | 159 os.path.join(src_dir, 'chrome'), |
161 os.path.join(src_dir, 'chrome_frame'), | 160 os.path.join(src_dir, 'chrome_frame'), |
162 os.path.join(src_dir, 'content'), | 161 os.path.join(src_dir, 'content'), |
163 os.path.join(src_dir, 'ui'), | 162 os.path.join(src_dir, 'ui'), |
164 os.path.join(src_dir, 'views'), | 163 os.path.join(src_dir, 'views'), |
165 # nsNSSCertHelper.cpp has a bunch of ids | 164 # nsNSSCertHelper.cpp has a bunch of ids |
166 os.path.join(src_dir, 'third_party', 'mozilla_security_manager'), | 165 os.path.join(src_dir, 'third_party', 'mozilla_security_manager'), |
167 os.path.join(chrome_dir, 'installer'), | 166 os.path.join(chrome_dir, 'installer'), |
168 ] | 167 ] |
169 | 168 |
170 return CheckForUnusedGrdIDsInSources(grd_files, src_dirs) | 169 return CheckForUnusedGrdIDsInSources(grd_files, src_dirs) |
171 | 170 |
172 | 171 |
173 if __name__ == '__main__': | 172 if __name__ == '__main__': |
174 sys.exit(main()) | 173 sys.exit(main()) |
OLD | NEW |