OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_METRICS_H_ | |
6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_METRICS_H_ | |
7 | |
8 #include <string> | |
9 | |
10 namespace TranslateManagerMetrics { | |
11 | |
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. | |
14 enum MetricsNameIndex { | |
15 UMA_INITIATION_STATUS, | |
16 UMA_LANGUAGE_DETECTION_ERROR, | |
17 UMA_SERVER_REPORTED_UNSUPPORTED_LANGUAGE, | |
18 UMA_UNSUPPORTED_LANGUAGE_AT_INITIATION, | |
19 UMA_LOCALES_ON_DISABLED_BY_PREFS, | |
20 UMA_MAX, | |
21 }; | |
22 | |
23 // When Chrome Translate is ready to translate a page, one of following reason | |
24 // decide the next browser action. | |
25 enum InitiationStatusType { | |
26 INITIATION_STATUS_DISABLED_BY_PREFS, | |
27 INITIATION_STATUS_DISABLED_BY_SWITCH, | |
28 INITIATION_STATUS_DISABLED_BY_CONFIG, | |
29 INITIATION_STATUS_LANGUAGE_IS_NOT_SUPPORTED, | |
30 INITIATION_STATUS_URL_IS_NOT_SUPPORTED, | |
31 INITIATION_STATUS_SIMILAR_LANGUAGES, | |
32 INITIATION_STATUS_ACCEPT_LANGUAGES, | |
33 | |
34 INITIATION_STATUS_AUTO_BY_CONFIG, | |
35 INITIATION_STATUS_AUTO_BY_LINK, | |
36 INITIATION_STATUS_SHOW_INFOBAR, | |
37 | |
38 INITIATION_STATUS_MAX, | |
39 }; | |
40 | |
41 // Called when Chrome Translate is initiated to report a reason of the next | |
42 // browser action. | |
43 void ReportInitiationStatus(InitiationStatusType type); | |
44 | |
45 // Called when Chrome opens the URL so that the user sends an error feedback. | |
46 void ReportLanguageDetectionError(); | |
47 | |
48 // Called when it turns out that translating page is in unsupported language. | |
49 void ReportUnsupportedLanguage(); | |
50 | |
51 void ReportUnsupportedLanguageAtInitiation(const std::string& language); | |
52 | |
53 void ReportLocalesOnDisabledByPrefs(const std::string& locale); | |
54 | |
55 // Provides UMA entry names for unit tests. | |
56 const char* GetMetricsName(MetricsNameIndex index); | |
57 | |
58 } // namespace TranslateManagerMetrics | |
59 | |
60 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_METRICS_H_ | |
OLD | NEW |