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

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

Issue 8822013: Adding ChromeOS Photo Editor user actions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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/tools/chromeactions.txt ('k') | no next file » | 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) 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 def AddExtensionActions(actions): 226 def AddExtensionActions(actions):
227 """Add actions reported by extensions via chrome.experimental.metrics API. 227 """Add actions reported by extensions via chrome.experimental.metrics API.
Ilya Sherman 2011/12/06 22:01:17 nit: Is this API still in chrome.experimental? I
Vladislav Kaznacheev 2011/12/07 11:18:57 Done.
228 228
229 Arguments: 229 Arguments:
230 actions: set of actions to add to. 230 actions: set of actions to add to.
231 """ 231 """
232 # Actions sent by Chrome OS File Browser. 232 # Actions sent by Chrome OS File Browser.
233 actions.add('FileBrowser.CreateNewFolder') 233 actions.add('FileBrowser.CreateNewFolder')
234 actions.add('FileBrowser.PhotoEditor.Edit')
235 actions.add('FileBrowser.PhotoEditor.View')
234 236
235 def GrepForActions(path, actions): 237 def GrepForActions(path, actions):
236 """Grep a source file for calls to UserMetrics functions. 238 """Grep a source file for calls to UserMetrics functions.
237 239
238 Arguments: 240 Arguments:
239 path: path to the file 241 path: path to the file
240 actions: set of actions to add to 242 actions: set of actions to add to
241 """ 243 """
242 global number_of_files_total 244 global number_of_files_total
243 number_of_files_total = number_of_files_total + 1 245 number_of_files_total = number_of_files_total + 1
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 else: 439 else:
438 print action 440 print action
439 441
440 if hash_output: 442 if hash_output:
441 print "Done. Do not forget to add chromeactions.txt to your changelist" 443 print "Done. Do not forget to add chromeactions.txt to your changelist"
442 return 0 444 return 0
443 445
444 446
445 if '__main__' == __name__: 447 if '__main__' == __name__:
446 sys.exit(main(sys.argv)) 448 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « chrome/tools/chromeactions.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698