| 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 # a result of the reset prompt. | 594 # a result of the reset prompt. |
| 595 actions.add('AutomaticReset_WebUIBanner_BannerShown') | 595 actions.add('AutomaticReset_WebUIBanner_BannerShown') |
| 596 actions.add('AutomaticReset_WebUIBanner_ManuallyClosed') | 596 actions.add('AutomaticReset_WebUIBanner_ManuallyClosed') |
| 597 actions.add('AutomaticReset_WebUIBanner_ResetClicked') | 597 actions.add('AutomaticReset_WebUIBanner_ResetClicked') |
| 598 | 598 |
| 599 # These actions relate to the the automatic settings reset banner shown as | 599 # These actions relate to the the automatic settings reset banner shown as |
| 600 # a result of settings hardening. | 600 # a result of settings hardening. |
| 601 actions.add('AutomaticSettingsReset_WebUIBanner_BannerShown') | 601 actions.add('AutomaticSettingsReset_WebUIBanner_BannerShown') |
| 602 actions.add('AutomaticSettingsReset_WebUIBanner_ManuallyClosed') | 602 actions.add('AutomaticSettingsReset_WebUIBanner_ManuallyClosed') |
| 603 actions.add('AutomaticSettingsReset_WebUIBanner_LearnMoreClicked') | 603 actions.add('AutomaticSettingsReset_WebUIBanner_LearnMoreClicked') |
| 604 actions.add('AutomaticSettingsReset_WebUIBanner_ResetClicked') |
| 604 | 605 |
| 605 | 606 |
| 606 class Error(Exception): | 607 class Error(Exception): |
| 607 pass | 608 pass |
| 608 | 609 |
| 609 | 610 |
| 610 def _ExtractText(parent_dom, tag_name): | 611 def _ExtractText(parent_dom, tag_name): |
| 611 """Extract the text enclosed by |tag_name| under |parent_dom| | 612 """Extract the text enclosed by |tag_name| under |parent_dom| |
| 612 | 613 |
| 613 Args: | 614 Args: |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 | 830 |
| 830 with open(actions_xml_path, 'wb') as f: | 831 with open(actions_xml_path, 'wb') as f: |
| 831 f.write(pretty) | 832 f.write(pretty) |
| 832 print ('Updated %s. Don\'t forget to add it to your changelist' % | 833 print ('Updated %s. Don\'t forget to add it to your changelist' % |
| 833 actions_xml_path) | 834 actions_xml_path) |
| 834 return 0 | 835 return 0 |
| 835 | 836 |
| 836 | 837 |
| 837 if '__main__' == __name__: | 838 if '__main__' == __name__: |
| 838 sys.exit(main(sys.argv)) | 839 sys.exit(main(sys.argv)) |
| OLD | NEW |