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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 os.path.join(chrome_app_res_dir, 'locale_settings_google_chromeos.grd'), | 144 os.path.join(chrome_app_res_dir, 'locale_settings_google_chromeos.grd'), |
145 os.path.join(chrome_app_res_dir, 'locale_settings_linux.grd'), | 145 os.path.join(chrome_app_res_dir, 'locale_settings_linux.grd'), |
146 os.path.join(chrome_app_res_dir, 'locale_settings_mac.grd'), | 146 os.path.join(chrome_app_res_dir, 'locale_settings_mac.grd'), |
147 os.path.join(chrome_app_res_dir, 'locale_settings_win.grd'), | 147 os.path.join(chrome_app_res_dir, 'locale_settings_win.grd'), |
148 os.path.join(chrome_app_dir, 'theme', 'theme_resources.grd'), | 148 os.path.join(chrome_app_dir, 'theme', 'theme_resources.grd'), |
149 os.path.join(chrome_dir, 'browser', 'browser_resources.grd'), | 149 os.path.join(chrome_dir, 'browser', 'browser_resources.grd'), |
150 os.path.join(chrome_dir, 'common', 'common_resources.grd'), | 150 os.path.join(chrome_dir, 'common', 'common_resources.grd'), |
151 os.path.join(chrome_dir, 'renderer', 'resources', | 151 os.path.join(chrome_dir, 'renderer', 'resources', |
152 'renderer_resources.grd'), | 152 'renderer_resources.grd'), |
153 os.path.join(device_base_dir, 'bluetooth', 'bluetooth_strings.grd'), | 153 os.path.join(device_base_dir, 'bluetooth', 'bluetooth_strings.grd'), |
| 154 os.path.join(src_dir, 'extensions', 'extensions_strings.grd'), |
154 os.path.join(src_dir, 'ui', 'resources', 'ui_resources.grd'), | 155 os.path.join(src_dir, 'ui', 'resources', 'ui_resources.grd'), |
155 os.path.join(src_dir, 'ui', 'webui', 'resources', 'webui_resources.grd'), | 156 os.path.join(src_dir, 'ui', 'webui', 'resources', 'webui_resources.grd'), |
156 os.path.join(ui_base_strings_dir, 'app_locale_settings.grd'), | 157 os.path.join(ui_base_strings_dir, 'app_locale_settings.grd'), |
157 os.path.join(ui_base_strings_dir, 'ui_strings.grd'), | 158 os.path.join(ui_base_strings_dir, 'ui_strings.grd'), |
158 ] | 159 ] |
159 | 160 |
160 # If no source directories were given, default them: | 161 # If no source directories were given, default them: |
161 if len(src_dirs) == 0: | 162 if len(src_dirs) == 0: |
162 src_dirs = [ | 163 src_dirs = [ |
163 os.path.join(src_dir, 'app'), | 164 os.path.join(src_dir, 'app'), |
164 os.path.join(src_dir, 'ash'), | 165 os.path.join(src_dir, 'ash'), |
165 os.path.join(src_dir, 'chrome'), | 166 os.path.join(src_dir, 'chrome'), |
166 os.path.join(src_dir, 'components'), | 167 os.path.join(src_dir, 'components'), |
167 os.path.join(src_dir, 'content'), | 168 os.path.join(src_dir, 'content'), |
168 os.path.join(src_dir, 'device'), | 169 os.path.join(src_dir, 'device'), |
| 170 os.path.join(src_dir, 'extensions'), |
169 os.path.join(src_dir, 'ui'), | 171 os.path.join(src_dir, 'ui'), |
170 os.path.join(src_dir, 'views'), | 172 os.path.join(src_dir, 'views'), |
171 # nsNSSCertHelper.cpp has a bunch of ids | 173 # nsNSSCertHelper.cpp has a bunch of ids |
172 os.path.join(src_dir, 'third_party', 'mozilla_security_manager'), | 174 os.path.join(src_dir, 'third_party', 'mozilla_security_manager'), |
173 os.path.join(chrome_dir, 'installer'), | 175 os.path.join(chrome_dir, 'installer'), |
174 ] | 176 ] |
175 | 177 |
176 return CheckForUnusedGrdIDsInSources(grd_files, src_dirs) | 178 return CheckForUnusedGrdIDsInSources(grd_files, src_dirs) |
177 | 179 |
178 | 180 |
179 if __name__ == '__main__': | 181 if __name__ == '__main__': |
180 sys.exit(main()) | 182 sys.exit(main()) |
OLD | NEW |