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

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

Issue 13180002: Adding metrics for notification clicks and dismissals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Using Unix line endings for chromeactions.txt Created 7 years, 8 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
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 """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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 """Add actions reported by extensions via chrome.metricsPrivate API. 329 """Add actions reported by extensions via chrome.metricsPrivate API.
330 330
331 Arguments: 331 Arguments:
332 actions: set of actions to add to. 332 actions: set of actions to add to.
333 """ 333 """
334 # Actions sent by Chrome OS File Browser. 334 # Actions sent by Chrome OS File Browser.
335 actions.add('FileBrowser.CreateNewFolder') 335 actions.add('FileBrowser.CreateNewFolder')
336 actions.add('FileBrowser.PhotoEditor.Edit') 336 actions.add('FileBrowser.PhotoEditor.Edit')
337 actions.add('FileBrowser.PhotoEditor.View') 337 actions.add('FileBrowser.PhotoEditor.View')
338 338
339 # Actions sent by Google Now client.
340 actions.add('GoogleNow.MessageClicked')
341 actions.add('GoogleNow.ButtonClicked0')
342 actions.add('GoogleNow.ButtonClicked1')
343 actions.add('GoogleNow.Dismissed')
344
339 def GrepForActions(path, actions): 345 def GrepForActions(path, actions):
340 """Grep a source file for calls to UserMetrics functions. 346 """Grep a source file for calls to UserMetrics functions.
341 347
342 Arguments: 348 Arguments:
343 path: path to the file 349 path: path to the file
344 actions: set of actions to add to 350 actions: set of actions to add to
345 """ 351 """
346 global number_of_files_total 352 global number_of_files_total
347 number_of_files_total = number_of_files_total + 1 353 number_of_files_total = number_of_files_total + 1
348 # we look for the UserMetricsAction structure constructor 354 # we look for the UserMetricsAction structure constructor
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 else: 559 else:
554 print action 560 print action
555 561
556 if hash_output: 562 if hash_output:
557 print "Done. Do not forget to add chromeactions.txt to your changelist" 563 print "Done. Do not forget to add chromeactions.txt to your changelist"
558 return 0 564 return 0
559 565
560 566
561 if '__main__' == __name__: 567 if '__main__' == __name__:
562 sys.exit(main(sys.argv)) 568 sys.exit(main(sys.argv))
OLDNEW
« chrome/tools/chromeactions.txt ('K') | « chrome/tools/chromeactions.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698