OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2009 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 """Extract UserMetrics "actions" strings from the Chrome source. | 6 """Extract UserMetrics "actions" strings from the Chrome source. |
7 | 7 |
8 This program generates the list of known actions we expect to see in the | 8 This program generates the list of known actions we expect to see in the |
9 user behavior logs. It walks the Chrome source, looking for calls to | 9 user behavior logs. It walks the Chrome source, looking for calls to |
10 UserMetrics functions, extracting actions and warning on improper calls, | 10 UserMetrics functions, extracting actions and warning on improper calls, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 def AddClosedSourceActions(actions): | 155 def AddClosedSourceActions(actions): |
156 """Add actions that are in code which is not checked out by default | 156 """Add actions that are in code which is not checked out by default |
157 | 157 |
158 Arguments | 158 Arguments |
159 actions: set of actions to add to. | 159 actions: set of actions to add to. |
160 """ | 160 """ |
161 actions.add('PDF.PrintPage') | 161 actions.add('PDF.PrintPage') |
162 actions.add('PDF.FitToHeightButton') | 162 actions.add('PDF.FitToHeightButton') |
163 actions.add('PDF.FitToWidthButton') | 163 actions.add('PDF.FitToWidthButton') |
| 164 actions.add('PDF.LoadFailure') |
| 165 actions.add('PDF.LoadSuccess') |
164 actions.add('PDF.ZoomFromBrowser') | 166 actions.add('PDF.ZoomFromBrowser') |
165 actions.add('PDF.ZoomOutButton') | 167 actions.add('PDF.ZoomOutButton') |
166 actions.add('PDF.ZoomInButton') | 168 actions.add('PDF.ZoomInButton') |
167 | 169 |
168 def AddAboutFlagsActions(actions): | 170 def AddAboutFlagsActions(actions): |
169 """This parses the experimental feature flags for UMA actions. | 171 """This parses the experimental feature flags for UMA actions. |
170 | 172 |
171 Arguments: | 173 Arguments: |
172 actions: set of actions to add to. | 174 actions: set of actions to add to. |
173 """ | 175 """ |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 hash.update(action) | 268 hash.update(action) |
267 print >>f, '0x%s\t%s' % (hash.hexdigest()[:16], action) | 269 print >>f, '0x%s\t%s' % (hash.hexdigest()[:16], action) |
268 else: | 270 else: |
269 print action | 271 print action |
270 | 272 |
271 if hash_output: | 273 if hash_output: |
272 print "Done. Do not forget to add chromeactions.txt to your changelist" | 274 print "Done. Do not forget to add chromeactions.txt to your changelist" |
273 | 275 |
274 if '__main__' == __name__: | 276 if '__main__' == __name__: |
275 main(sys.argv) | 277 main(sys.argv) |
OLD | NEW |