OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Extract UserMetrics "actions" strings from the Chrome source. | 7 """Extract UserMetrics "actions" strings from the Chrome source. |
8 | 8 |
9 This program generates the list of known actions we expect to see in the | 9 This program generates the list of known actions we expect to see in the |
10 user behavior logs. It walks the Chrome source, looking for calls to | 10 user behavior logs. It walks the Chrome source, looking for calls to |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 def AddExtensionActions(actions): | 356 def AddExtensionActions(actions): |
357 """Add actions reported by extensions via chrome.metricsPrivate API. | 357 """Add actions reported by extensions via chrome.metricsPrivate API. |
358 | 358 |
359 Arguments: | 359 Arguments: |
360 actions: set of actions to add to. | 360 actions: set of actions to add to. |
361 """ | 361 """ |
362 # Actions sent by Chrome OS File Browser. | 362 # Actions sent by Chrome OS File Browser. |
363 actions.add('FileBrowser.CreateNewFolder') | 363 actions.add('FileBrowser.CreateNewFolder') |
364 actions.add('FileBrowser.PhotoEditor.Edit') | 364 actions.add('FileBrowser.PhotoEditor.Edit') |
365 actions.add('FileBrowser.PhotoEditor.View') | 365 actions.add('FileBrowser.PhotoEditor.View') |
| 366 actions.add('FileBrowser.SuggestApps.ShowDialog') |
366 | 367 |
367 # Actions sent by Google Now client. | 368 # Actions sent by Google Now client. |
368 actions.add('GoogleNow.MessageClicked') | 369 actions.add('GoogleNow.MessageClicked') |
369 actions.add('GoogleNow.ButtonClicked0') | 370 actions.add('GoogleNow.ButtonClicked0') |
370 actions.add('GoogleNow.ButtonClicked1') | 371 actions.add('GoogleNow.ButtonClicked1') |
371 actions.add('GoogleNow.Dismissed') | 372 actions.add('GoogleNow.Dismissed') |
372 | 373 |
373 def GrepForActions(path, actions): | 374 def GrepForActions(path, actions): |
374 """Grep a source file for calls to UserMetrics functions. | 375 """Grep a source file for calls to UserMetrics functions. |
375 | 376 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 else: | 613 else: |
613 print action | 614 print action |
614 | 615 |
615 if hash_output: | 616 if hash_output: |
616 print "Done. Do not forget to add chromeactions.txt to your changelist" | 617 print "Done. Do not forget to add chromeactions.txt to your changelist" |
617 return 0 | 618 return 0 |
618 | 619 |
619 | 620 |
620 if '__main__' == __name__: | 621 if '__main__' == __name__: |
621 sys.exit(main(sys.argv)) | 622 sys.exit(main(sys.argv)) |
OLD | NEW |