| 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 # Walk the source tree to process all .cc files. | 576 # Walk the source tree to process all .cc files. |
| 577 ash_root = os.path.normpath(os.path.join(REPOSITORY_ROOT, 'ash')) | 577 ash_root = os.path.normpath(os.path.join(REPOSITORY_ROOT, 'ash')) |
| 578 WalkDirectory(ash_root, actions, EXTENSIONS, GrepForActions) | 578 WalkDirectory(ash_root, actions, EXTENSIONS, GrepForActions) |
| 579 chrome_root = os.path.normpath(os.path.join(REPOSITORY_ROOT, 'chrome')) | 579 chrome_root = os.path.normpath(os.path.join(REPOSITORY_ROOT, 'chrome')) |
| 580 WalkDirectory(chrome_root, actions, EXTENSIONS, GrepForActions) | 580 WalkDirectory(chrome_root, actions, EXTENSIONS, GrepForActions) |
| 581 content_root = os.path.normpath(os.path.join(REPOSITORY_ROOT, 'content')) | 581 content_root = os.path.normpath(os.path.join(REPOSITORY_ROOT, 'content')) |
| 582 WalkDirectory(content_root, actions, EXTENSIONS, GrepForActions) | 582 WalkDirectory(content_root, actions, EXTENSIONS, GrepForActions) |
| 583 components_root = os.path.normpath(os.path.join(REPOSITORY_ROOT, | 583 components_root = os.path.normpath(os.path.join(REPOSITORY_ROOT, |
| 584 'components')) | 584 'components')) |
| 585 WalkDirectory(components_root, actions, EXTENSIONS, GrepForActions) | 585 WalkDirectory(components_root, actions, EXTENSIONS, GrepForActions) |
| 586 extensions_root = os.path.normpath(os.path.join(REPOSITORY_ROOT, |
| 587 'extensions')) |
| 588 WalkDirectory(extensions_root, actions, EXTENSIONS, GrepForActions) |
| 586 net_root = os.path.normpath(os.path.join(REPOSITORY_ROOT, 'net')) | 589 net_root = os.path.normpath(os.path.join(REPOSITORY_ROOT, 'net')) |
| 587 WalkDirectory(net_root, actions, EXTENSIONS, GrepForActions) | 590 WalkDirectory(net_root, actions, EXTENSIONS, GrepForActions) |
| 588 webkit_root = os.path.normpath(os.path.join(REPOSITORY_ROOT, 'webkit')) | 591 webkit_root = os.path.normpath(os.path.join(REPOSITORY_ROOT, 'webkit')) |
| 589 WalkDirectory(os.path.join(webkit_root, 'glue'), actions, EXTENSIONS, | 592 WalkDirectory(os.path.join(webkit_root, 'glue'), actions, EXTENSIONS, |
| 590 GrepForActions) | 593 GrepForActions) |
| 591 WalkDirectory(os.path.join(webkit_root, 'port'), actions, EXTENSIONS, | 594 WalkDirectory(os.path.join(webkit_root, 'port'), actions, EXTENSIONS, |
| 592 GrepForActions) | 595 GrepForActions) |
| 593 | 596 |
| 594 def AddWebUIActions(actions): | 597 def AddWebUIActions(actions): |
| 595 """Add user actions defined in WebUI files. | 598 """Add user actions defined in WebUI files. |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 | 847 |
| 845 return PrettyPrint(actions, actions_dict, comment_nodes) | 848 return PrettyPrint(actions, actions_dict, comment_nodes) |
| 846 | 849 |
| 847 | 850 |
| 848 def main(argv): | 851 def main(argv): |
| 849 presubmit_util.DoPresubmitMain(argv, 'actions.xml', 'actions.old.xml', | 852 presubmit_util.DoPresubmitMain(argv, 'actions.xml', 'actions.old.xml', |
| 850 'extract_actions.py', UpdateXml) | 853 'extract_actions.py', UpdateXml) |
| 851 | 854 |
| 852 if '__main__' == __name__: | 855 if '__main__' == __name__: |
| 853 sys.exit(main(sys.argv)) | 856 sys.exit(main(sys.argv)) |
| OLD | NEW |