Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: components/translate/core/common/translate_metrics.h

Issue 2825943002: Removed translate MetricsNameIndex. (Closed)
Patch Set: Removed duplicate comment Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/translate/core/common/translate_metrics.h
diff --git a/components/translate/core/common/translate_metrics.h b/components/translate/core/common/translate_metrics.h
index b1cf988907b4a6689aaf1817fa481bf386dc3c40..dd3883060484c9297ba01baf7ef28993665a919f 100644
--- a/components/translate/core/common/translate_metrics.h
+++ b/components/translate/core/common/translate_metrics.h
@@ -11,22 +11,24 @@
namespace translate {
-// An indexing type to query each UMA entry name via GetMetricsName() function.
-// Note: |kMetricsEntries| should be updated when a new entry is added here.
-enum MetricsNameIndex {
- UMA_LANGUAGE_DETECTION,
- UMA_CONTENT_LANGUAGE,
- UMA_HTML_LANG,
- UMA_LANGUAGE_VERIFICATION,
- UMA_TIME_TO_BE_READY,
- UMA_TIME_TO_LOAD,
- UMA_TIME_TO_TRANSLATE,
- UMA_USER_ACTION_DURATION,
- UMA_PAGE_SCHEME,
- UMA_SIMILAR_LANGUAGE_MATCH,
- UMA_LANGUAGE_DETECTION_CONFLICT,
- UMA_MAX,
-};
+// Internals exposed for testing purposes. Should not be relied on by client
+// code.
+namespace metrics_internal {
droger 2017/04/19 08:26:49 Optional: I think the namespace is not even needed
martis 2017/04/20 02:57:29 I'm not aware of namespaces increasing the size of
+
+// Constant string values to indicate UMA names.
+extern const char* kRenderer4LanguageDetection;
droger 2017/04/19 08:26:49 extern const char kRenderer4LanguageDetection[] is
martis 2017/04/20 02:57:29 As far as I know, that syntax can only be used whe
droger 2017/04/20 07:30:30 No. Please do like I said in my first comment. Yo
+extern const char* kTranslateContentLanguage;
+extern const char* kTranslateHtmlLang;
+extern const char* kTranslateLanguageVerification;
+extern const char* kTranslateTimeToBeReady;
+extern const char* kTranslateTimeToLoad;
+extern const char* kTranslateTimeToTranslate;
+extern const char* kTranslateUserActionDuration;
+extern const char* kTranslatePageScheme;
+extern const char* kTranslateSimilarLanguageMatch;
+extern const char* kTranslateLanguageDetectionConflict;
+
+} // namespace metrics_internal
// A page may provide a Content-Language HTTP header or a META tag.
// TranslateHelper checks if a server provides a valid Content-Language.
@@ -102,9 +104,6 @@ void ReportSimilarLanguageMatch(bool match);
void ReportLanguageDetectionConflict(const std::string& page_lang,
const std::string& cld_lang);
-// Gets UMA name for an entry specified by |index|.
-const char* GetMetricsName(MetricsNameIndex index);
-
} // namespace translate
#endif // COMPONENTS_TRANSLATE_CORE_COMMON_TRANSLATE_METRICS_H_

Powered by Google App Engine
This is Rietveld 408576698