OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 actions.add('Accel_BrightnessDown_F6') | 216 actions.add('Accel_BrightnessDown_F6') |
217 actions.add('Accel_BrightnessUp_F7') | 217 actions.add('Accel_BrightnessUp_F7') |
218 | 218 |
219 # Actions sent by Chrome OS update engine. | 219 # Actions sent by Chrome OS update engine. |
220 actions.add('Updater.ServerCertificateChanged') | 220 actions.add('Updater.ServerCertificateChanged') |
221 actions.add('Updater.ServerCertificateFailed') | 221 actions.add('Updater.ServerCertificateFailed') |
222 | 222 |
223 # Actions sent by Chrome OS cryptohome. | 223 # Actions sent by Chrome OS cryptohome. |
224 actions.add('Cryptohome.PKCS11InitFail') | 224 actions.add('Cryptohome.PKCS11InitFail') |
225 | 225 |
226 # Actions sent by Chrome OS File Browser. | |
227 actions.add('FileBrowser.CreateNewFolder.hhaomjibdihmijegdhdafkllkbggdgoj') | |
petkov
2011/11/14 13:25:27
Is this user action reported by the Chrome process
Vladislav Kaznacheev
2011/11/14 13:53:19
The File Browser is ChromeOS specific. It lives in
| |
228 | |
226 def GrepForActions(path, actions): | 229 def GrepForActions(path, actions): |
227 """Grep a source file for calls to UserMetrics functions. | 230 """Grep a source file for calls to UserMetrics functions. |
228 | 231 |
229 Arguments: | 232 Arguments: |
230 path: path to the file | 233 path: path to the file |
231 actions: set of actions to add to | 234 actions: set of actions to add to |
232 """ | 235 """ |
233 global number_of_files_total | 236 global number_of_files_total |
234 number_of_files_total = number_of_files_total + 1 | 237 number_of_files_total = number_of_files_total + 1 |
235 # we look for the UserMetricsAction structure constructor | 238 # we look for the UserMetricsAction structure constructor |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
425 hash.update(action) | 428 hash.update(action) |
426 print >>f, '0x%s\t%s' % (hash.hexdigest()[:16], action) | 429 print >>f, '0x%s\t%s' % (hash.hexdigest()[:16], action) |
427 else: | 430 else: |
428 print action | 431 print action |
429 | 432 |
430 if hash_output: | 433 if hash_output: |
431 print "Done. Do not forget to add chromeactions.txt to your changelist" | 434 print "Done. Do not forget to add chromeactions.txt to your changelist" |
432 | 435 |
433 if '__main__' == __name__: | 436 if '__main__' == __name__: |
434 main(sys.argv) | 437 main(sys.argv) |
OLD | NEW |