OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_METRICS_H_ | 5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_METRICS_H_ |
6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_METRICS_H_ | 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_METRICS_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
8 namespace TranslateManagerMetrics { | 10 namespace TranslateManagerMetrics { |
9 | 11 |
10 // An indexing type to query each UMA entry name via GetMetricsName() function. | 12 // An indexing type to query each UMA entry name via GetMetricsName() function. |
11 // Note: |kMetricsEntries| should be updated when a new entry is added here. | 13 // Note: |kMetricsEntries| should be updated when a new entry is added here. |
12 enum MetricsNameIndex { | 14 enum MetricsNameIndex { |
13 UMA_INITIATION_STATUS, | 15 UMA_INITIATION_STATUS, |
14 UMA_LANGUAGE_DETECTION_ERROR, | 16 UMA_LANGUAGE_DETECTION_ERROR, |
15 UMA_SERVER_REPORTED_UNSUPPORTED_LANGUAGE, | 17 UMA_SERVER_REPORTED_UNSUPPORTED_LANGUAGE, |
| 18 UMA_LOCALES_ON_DISABLED_BY_PREFS, |
16 UMA_MAX, | 19 UMA_MAX, |
17 }; | 20 }; |
18 | 21 |
19 // When Chrome Translate is ready to translate a page, one of following reason | 22 // When Chrome Translate is ready to translate a page, one of following reason |
20 // decide the next browser action. | 23 // decide the next browser action. |
21 enum InitiationStatusType { | 24 enum InitiationStatusType { |
22 INITIATION_STATUS_DISABLED_BY_PREFS, | 25 INITIATION_STATUS_DISABLED_BY_PREFS, |
23 INITIATION_STATUS_DISABLED_BY_SWITCH, | 26 INITIATION_STATUS_DISABLED_BY_SWITCH, |
24 INITIATION_STATUS_DISABLED_BY_CONFIG, | 27 INITIATION_STATUS_DISABLED_BY_CONFIG, |
25 INITIATION_STATUS_LANGUAGE_IS_NOT_SUPPORTED, | 28 INITIATION_STATUS_LANGUAGE_IS_NOT_SUPPORTED, |
(...skipping 11 matching lines...) Expand all Loading... |
37 // Called when Chrome Translate is initiated to report a reason of the next | 40 // Called when Chrome Translate is initiated to report a reason of the next |
38 // browser action. | 41 // browser action. |
39 void ReportInitiationStatus(InitiationStatusType type); | 42 void ReportInitiationStatus(InitiationStatusType type); |
40 | 43 |
41 // Called when Chrome opens the URL so that the user sends an error feedback. | 44 // Called when Chrome opens the URL so that the user sends an error feedback. |
42 void ReportLanguageDetectionError(); | 45 void ReportLanguageDetectionError(); |
43 | 46 |
44 // Called when it turns out that translating page is in unsupported language. | 47 // Called when it turns out that translating page is in unsupported language. |
45 void ReportUnsupportedLanguage(); | 48 void ReportUnsupportedLanguage(); |
46 | 49 |
| 50 void ReportLocalesOnDisabledByPrefs(const std::string& locale); |
| 51 |
47 // Provides UMA entry names for unit tests. | 52 // Provides UMA entry names for unit tests. |
48 const char* GetMetricsName(MetricsNameIndex index); | 53 const char* GetMetricsName(MetricsNameIndex index); |
49 | 54 |
50 } // namespace TranslateManagerMetrics | 55 } // namespace TranslateManagerMetrics |
51 | 56 |
52 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_METRICS_H_ | 57 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_METRICS_H_ |
OLD | NEW |