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

Side by Side Diff: tools/metrics/actions/extract_actions.py

Issue 411273006: Incorporate reset button in post-automatic-reset settings-banner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style nit++ Created 6 years, 4 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
« no previous file with comments | « tools/metrics/actions/actions.xml ('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 # 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
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
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))
OLDNEW
« no previous file with comments | « tools/metrics/actions/actions.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698