Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: chrome/tools/check_grd_for_unused_strings.py

Issue 10910264: Move wallpapers to ash/resource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac fix Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_resources.gyp ('k') | tools/gritsettings/resource_ids » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 # If no GRD files were given, default them: 127 # If no GRD files were given, default them:
128 if len(grd_files) == 0: 128 if len(grd_files) == 0:
129 ash_base_dir = os.path.join(src_dir, 'ash') 129 ash_base_dir = os.path.join(src_dir, 'ash')
130 chrome_dir = os.path.join(src_dir, 'chrome') 130 chrome_dir = os.path.join(src_dir, 'chrome')
131 chrome_app_dir = os.path.join(chrome_dir, 'app') 131 chrome_app_dir = os.path.join(chrome_dir, 'app')
132 chrome_app_res_dir = os.path.join(chrome_app_dir, 'resources') 132 chrome_app_res_dir = os.path.join(chrome_app_dir, 'resources')
133 ui_base_dir = os.path.join(src_dir, 'ui', 'base',) 133 ui_base_dir = os.path.join(src_dir, 'ui', 'base',)
134 ui_base_strings_dir = os.path.join(ui_base_dir, 'strings') 134 ui_base_strings_dir = os.path.join(ui_base_dir, 'strings')
135 grd_files = [ 135 grd_files = [
136 os.path.join(ash_base_dir, 'ash_strings.grd'), 136 os.path.join(ash_base_dir, 'ash_strings.grd'),
137 os.path.join(ash_base_dir, 'resources', 'ash_resources.grd'),
138 os.path.join(ash_base_dir, 'resources', 'ash_wallpaper_resources.grd'),
137 os.path.join(chrome_app_dir, 'chromium_strings.grd'), 139 os.path.join(chrome_app_dir, 'chromium_strings.grd'),
138 os.path.join(chrome_app_dir, 'generated_resources.grd'), 140 os.path.join(chrome_app_dir, 'generated_resources.grd'),
139 os.path.join(chrome_app_dir, 'google_chrome_strings.grd'), 141 os.path.join(chrome_app_dir, 'google_chrome_strings.grd'),
140 os.path.join(chrome_app_res_dir, 'locale_settings.grd'), 142 os.path.join(chrome_app_res_dir, 'locale_settings.grd'),
141 os.path.join(chrome_app_res_dir, 'locale_settings_cros.grd'), 143 os.path.join(chrome_app_res_dir, 'locale_settings_cros.grd'),
142 os.path.join(chrome_app_res_dir, 'locale_settings_linux.grd'), 144 os.path.join(chrome_app_res_dir, 'locale_settings_linux.grd'),
143 os.path.join(chrome_app_res_dir, 'locale_settings_mac.grd'), 145 os.path.join(chrome_app_res_dir, 'locale_settings_mac.grd'),
144 os.path.join(chrome_app_res_dir, 'locale_settings_win.grd'), 146 os.path.join(chrome_app_res_dir, 'locale_settings_win.grd'),
145 os.path.join(chrome_app_dir, 'theme', 'theme_resources.grd'), 147 os.path.join(chrome_app_dir, 'theme', 'theme_resources.grd'),
146 os.path.join(chrome_dir, 'browser', 'browser_resources.grd'), 148 os.path.join(chrome_dir, 'browser', 'browser_resources.grd'),
147 os.path.join(chrome_dir, 'browser', 'resources', 'shared_resources.grd'), 149 os.path.join(chrome_dir, 'browser', 'resources', 'shared_resources.grd'),
148 os.path.join(chrome_dir, 'common', 'common_resources.grd'), 150 os.path.join(chrome_dir, 'common', 'common_resources.grd'),
149 os.path.join(chrome_dir, 'renderer', 'resources', 151 os.path.join(chrome_dir, 'renderer', 'resources',
150 'renderer_resources.grd'), 152 'renderer_resources.grd'),
151 os.path.join(src_dir, 'ui', 'resources', 'ui_resources.grd'), 153 os.path.join(src_dir, 'ui', 'resources', 'ui_resources.grd'),
152 os.path.join(src_dir, 'ui', 'resources', 'ui_resources_wallpapers.grd'),
153 os.path.join(ui_base_strings_dir, 'app_locale_settings.grd'), 154 os.path.join(ui_base_strings_dir, 'app_locale_settings.grd'),
154 os.path.join(ui_base_strings_dir, 'ui_strings.grd'), 155 os.path.join(ui_base_strings_dir, 'ui_strings.grd'),
155 ] 156 ]
156 157
157 # If no source directories were given, default them: 158 # If no source directories were given, default them:
158 if len(src_dirs) == 0: 159 if len(src_dirs) == 0:
159 src_dirs = [ 160 src_dirs = [
160 os.path.join(src_dir, 'app'), 161 os.path.join(src_dir, 'app'),
161 os.path.join(src_dir, 'ash'), 162 os.path.join(src_dir, 'ash'),
162 os.path.join(src_dir, 'chrome'), 163 os.path.join(src_dir, 'chrome'),
163 os.path.join(src_dir, 'chrome_frame'), 164 os.path.join(src_dir, 'chrome_frame'),
164 os.path.join(src_dir, 'content'), 165 os.path.join(src_dir, 'content'),
165 os.path.join(src_dir, 'ui'), 166 os.path.join(src_dir, 'ui'),
166 os.path.join(src_dir, 'views'), 167 os.path.join(src_dir, 'views'),
167 # nsNSSCertHelper.cpp has a bunch of ids 168 # nsNSSCertHelper.cpp has a bunch of ids
168 os.path.join(src_dir, 'third_party', 'mozilla_security_manager'), 169 os.path.join(src_dir, 'third_party', 'mozilla_security_manager'),
169 os.path.join(chrome_dir, 'installer'), 170 os.path.join(chrome_dir, 'installer'),
170 ] 171 ]
171 172
172 return CheckForUnusedGrdIDsInSources(grd_files, src_dirs) 173 return CheckForUnusedGrdIDsInSources(grd_files, src_dirs)
173 174
174 175
175 if __name__ == '__main__': 176 if __name__ == '__main__':
176 sys.exit(main()) 177 sys.exit(main())
OLDNEW
« no previous file with comments | « chrome/chrome_resources.gyp ('k') | tools/gritsettings/resource_ids » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698