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_BROWSER_METRICS_H_ |
6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_METRICS_H_ | 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_BROWSER_METRICS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 namespace TranslateManagerMetrics { | 10 namespace TranslateBrowserMetrics { |
11 | 11 |
12 // 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. |
13 // 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. |
14 enum MetricsNameIndex { | 14 enum MetricsNameIndex { |
15 UMA_INITIATION_STATUS, | 15 UMA_INITIATION_STATUS, |
16 UMA_LANGUAGE_DETECTION_ERROR, | 16 UMA_LANGUAGE_DETECTION_ERROR, |
17 UMA_SERVER_REPORTED_UNSUPPORTED_LANGUAGE, | |
18 UMA_UNSUPPORTED_LANGUAGE_AT_INITIATION, | 17 UMA_UNSUPPORTED_LANGUAGE_AT_INITIATION, |
| 18 UMA_UNDISPLAYABLE_LANGUAGE, |
19 UMA_MAX, | 19 UMA_MAX, |
20 }; | 20 }; |
21 | 21 |
22 // 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 |
23 // decide the next browser action. | 23 // decide the next browser action. |
24 enum InitiationStatusType { | 24 enum InitiationStatusType { |
25 INITIATION_STATUS_DISABLED_BY_PREFS, | 25 INITIATION_STATUS_DISABLED_BY_PREFS, |
26 INITIATION_STATUS_DISABLED_BY_SWITCH, | 26 INITIATION_STATUS_DISABLED_BY_SWITCH, |
27 INITIATION_STATUS_DISABLED_BY_CONFIG, | 27 INITIATION_STATUS_DISABLED_BY_CONFIG, |
28 INITIATION_STATUS_LANGUAGE_IS_NOT_SUPPORTED, | 28 INITIATION_STATUS_LANGUAGE_IS_NOT_SUPPORTED, |
29 INITIATION_STATUS_URL_IS_NOT_SUPPORTED, | 29 INITIATION_STATUS_URL_IS_NOT_SUPPORTED, |
30 INITIATION_STATUS_SIMILAR_LANGUAGES, | 30 INITIATION_STATUS_SIMILAR_LANGUAGES, |
31 INITIATION_STATUS_ACCEPT_LANGUAGES, | 31 INITIATION_STATUS_ACCEPT_LANGUAGES, |
32 | 32 |
33 INITIATION_STATUS_AUTO_BY_CONFIG, | 33 INITIATION_STATUS_AUTO_BY_CONFIG, |
34 INITIATION_STATUS_AUTO_BY_LINK, | 34 INITIATION_STATUS_AUTO_BY_LINK, |
35 INITIATION_STATUS_SHOW_INFOBAR, | 35 INITIATION_STATUS_SHOW_INFOBAR, |
36 | 36 |
37 INITIATION_STATUS_MAX, | 37 INITIATION_STATUS_MAX, |
38 }; | 38 }; |
39 | 39 |
40 // 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 |
41 // browser action. | 41 // browser action. |
42 void ReportInitiationStatus(InitiationStatusType type); | 42 void ReportInitiationStatus(InitiationStatusType type); |
43 | 43 |
44 // 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. |
45 void ReportLanguageDetectionError(); | 45 void ReportLanguageDetectionError(); |
46 | 46 |
47 // Called when it turns out that translating page is in unsupported language. | 47 void ReportUnsupportedLanguageAtInitiation(const std::string& language); |
48 void ReportUnsupportedLanguage(); | |
49 | 48 |
50 void ReportUnsupportedLanguageAtInitiation(const std::string& language); | 49 // Called when Chrome Translate server sends the language list which includes |
| 50 // a undisplayable language in the user's locale. |
| 51 void ReportUndisplayableLanguage(const std::string& language); |
51 | 52 |
52 // Provides UMA entry names for unit tests. | 53 // Provides UMA entry names for unit tests. |
53 const char* GetMetricsName(MetricsNameIndex index); | 54 const char* GetMetricsName(MetricsNameIndex index); |
54 | 55 |
55 } // namespace TranslateManagerMetrics | 56 } // namespace TranslateBrowserMetrics |
56 | 57 |
57 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_METRICS_H_ | 58 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_BROWSER_METRICS_H_ |
OLD | NEW |