OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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, |
11 as well as generating the lists of possible actions in situations where | 11 as well as generating the lists of possible actions in situations where |
12 there are many possible actions. | 12 there are many possible actions. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 for i in range(1, 20): | 119 for i in range(1, 20): |
120 actions.add(dir + 'HistoryClick' + str(i)) | 120 actions.add(dir + 'HistoryClick' + str(i)) |
121 actions.add(dir + 'ChapterClick' + str(i)) | 121 actions.add(dir + 'ChapterClick' + str(i)) |
122 | 122 |
123 # Actions for new_tab_ui.cc. | 123 # Actions for new_tab_ui.cc. |
124 for i in range(1, 10): | 124 for i in range(1, 10): |
125 actions.add('MostVisited%d' % i) | 125 actions.add('MostVisited%d' % i) |
126 | 126 |
127 # Actions for safe_browsing_blocking_page.cc. | 127 # Actions for safe_browsing_blocking_page.cc. |
128 for interstitial in ('Phishing', 'Malware', 'Multiple'): | 128 for interstitial in ('Phishing', 'Malware', 'Multiple'): |
129 for action in ('Show', 'Proceed', 'DontProceed', 'ForcedDontProceed'): | 129 for action in ('Show', 'Proceed', 'DontProceed'): |
130 actions.add('SBInterstitial%s%s' % (interstitial, action)) | 130 actions.add('SBInterstitial%s%s' % (interstitial, action)) |
131 | 131 |
132 # Actions for language_options_handler.cc (Chrome OS specific). | 132 # Actions for language_options_handler.cc (Chrome OS specific). |
133 for input_method_id in INPUT_METHOD_IDS: | 133 for input_method_id in INPUT_METHOD_IDS: |
134 actions.add('LanguageOptions_DisableInputMethod_%s' % input_method_id) | 134 actions.add('LanguageOptions_DisableInputMethod_%s' % input_method_id) |
135 actions.add('LanguageOptions_EnableInputMethod_%s' % input_method_id) | 135 actions.add('LanguageOptions_EnableInputMethod_%s' % input_method_id) |
136 actions.add('InputMethodOptions_Open_%s' % input_method_id) | 136 actions.add('InputMethodOptions_Open_%s' % input_method_id) |
137 for language_code in LANGUAGE_CODES: | 137 for language_code in LANGUAGE_CODES: |
138 actions.add('LanguageOptions_UiLanguageChange_%s' % language_code) | 138 actions.add('LanguageOptions_UiLanguageChange_%s' % language_code) |
139 actions.add('LanguageOptions_SpellCheckLanguageChange_%s' % language_code) | 139 actions.add('LanguageOptions_SpellCheckLanguageChange_%s' % language_code) |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 else: | 446 else: |
447 print action | 447 print action |
448 | 448 |
449 if hash_output: | 449 if hash_output: |
450 print "Done. Do not forget to add chromeactions.txt to your changelist" | 450 print "Done. Do not forget to add chromeactions.txt to your changelist" |
451 return 0 | 451 return 0 |
452 | 452 |
453 | 453 |
454 if '__main__' == __name__: | 454 if '__main__' == __name__: |
455 sys.exit(main(sys.argv)) | 455 sys.exit(main(sys.argv)) |
OLD | NEW |