| 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) 2012 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, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 actions.add(dir + 'HistoryClick' + str(i)) | 126 actions.add(dir + 'HistoryClick' + str(i)) |
| 127 actions.add(dir + 'ChapterClick' + str(i)) | 127 actions.add(dir + 'ChapterClick' + str(i)) |
| 128 | 128 |
| 129 # Actions for new_tab_ui.cc. | 129 # Actions for new_tab_ui.cc. |
| 130 for i in range(1, 10): | 130 for i in range(1, 10): |
| 131 actions.add('MostVisited%d' % i) | 131 actions.add('MostVisited%d' % i) |
| 132 | 132 |
| 133 # Actions for safe_browsing_blocking_page.cc. | 133 # Actions for safe_browsing_blocking_page.cc. |
| 134 for interstitial in ('Phishing', 'Malware', 'Multiple'): | 134 for interstitial in ('Phishing', 'Malware', 'Multiple'): |
| 135 for action in ('Show', 'Proceed', 'DontProceed', 'ForcedDontProceed'): | 135 for action in ('Show', 'Proceed', 'DontProceed', 'ForcedDontProceed'): |
| 136 actions.add('SBInterstitial%s%s' % (interstitial, action)) | 136 for group in ('', '_V1', '_V2'): |
| 137 actions.add('SBInterstitial%s%s%s' % (interstitial, action, group)) |
| 137 | 138 |
| 138 # Actions for language_options_handler.cc (Chrome OS specific). | 139 # Actions for language_options_handler.cc (Chrome OS specific). |
| 139 for input_method_id in INPUT_METHOD_IDS: | 140 for input_method_id in INPUT_METHOD_IDS: |
| 140 actions.add('LanguageOptions_DisableInputMethod_%s' % input_method_id) | 141 actions.add('LanguageOptions_DisableInputMethod_%s' % input_method_id) |
| 141 actions.add('LanguageOptions_EnableInputMethod_%s' % input_method_id) | 142 actions.add('LanguageOptions_EnableInputMethod_%s' % input_method_id) |
| 142 actions.add('InputMethodOptions_Open_%s' % input_method_id) | 143 actions.add('InputMethodOptions_Open_%s' % input_method_id) |
| 143 for language_code in LANGUAGE_CODES: | 144 for language_code in LANGUAGE_CODES: |
| 144 actions.add('LanguageOptions_UiLanguageChange_%s' % language_code) | 145 actions.add('LanguageOptions_UiLanguageChange_%s' % language_code) |
| 145 actions.add('LanguageOptions_SpellCheckLanguageChange_%s' % language_code) | 146 actions.add('LanguageOptions_SpellCheckLanguageChange_%s' % language_code) |
| 146 | 147 |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 else: | 443 else: |
| 443 print action | 444 print action |
| 444 | 445 |
| 445 if hash_output: | 446 if hash_output: |
| 446 print "Done. Do not forget to add chromeactions.txt to your changelist" | 447 print "Done. Do not forget to add chromeactions.txt to your changelist" |
| 447 return 0 | 448 return 0 |
| 448 | 449 |
| 449 | 450 |
| 450 if '__main__' == __name__: | 451 if '__main__' == __name__: |
| 451 sys.exit(main(sys.argv)) | 452 sys.exit(main(sys.argv)) |
| OLD | NEW |