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

Unified Diff: chrome/common/translate/translate_common_metrics.h

Issue 25531002: Move language detection to a component (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Run translate unittests on iOS Created 7 years, 2 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: chrome/common/translate/translate_common_metrics.h
diff --git a/chrome/common/translate/translate_common_metrics.h b/chrome/common/translate/translate_common_metrics.h
deleted file mode 100644
index 0faed7f72f36a1aec003e22a7d13fc07728a198d..0000000000000000000000000000000000000000
--- a/chrome/common/translate/translate_common_metrics.h
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_COMMON_TRANSLATE_TRANSLATE_COMMON_METRICS_H_
-#define CHROME_COMMON_TRANSLATE_TRANSLATE_COMMON_METRICS_H_
-
-#include <string>
-
-#include "base/time/time.h"
-
-namespace TranslateCommonMetrics {
-
-// 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_MAX,
-};
-
-// A page may provide a Content-Language HTTP header or a META tag.
-// TranslateHelper checks if a server provides a valid Content-Language.
-enum LanguageCheckType {
- LANGUAGE_NOT_PROVIDED,
- LANGUAGE_VALID,
- LANGUAGE_INVALID,
- LANGUAGE_MAX,
-};
-
-// When a valid Content-Language is provided, TranslateHelper checks if a
-// server provided Content-Language matches to a language CLD determined.
-enum LanguageVerificationType {
- LANGUAGE_VERIFICATION_CLD_DISABLED, // obsolete
- LANGUAGE_VERIFICATION_CLD_ONLY,
- LANGUAGE_VERIFICATION_UNKNOWN,
- LANGUAGE_VERIFICATION_CLD_AGREE,
- LANGUAGE_VERIFICATION_CLD_DISAGREE,
- LANGUAGE_VERIFICATION_TRUST_CLD,
- LANGUAGE_VERIFICATION_CLD_COMPLEMENT_SUB_CODE,
- LANGUAGE_VERIFICATION_MAX,
-};
-
-// Scheme type of pages Chrome is going to translate.
-enum SchemeType {
- SCHEME_HTTP,
- SCHEME_HTTPS,
- SCHEME_OTHERS,
- SCHEME_MAX,
-};
-
-// Called after TranslateHelper verifies a server providing Content-Language
-// header. |provided_code| contains a Content-Language header value which a
-// server provides. It can be empty string when a server doesn't provide it.
-// |revised_code| is a value modified by format error corrector.
-void ReportContentLanguage(const std::string& provided_code,
- const std::string& revised_code);
-
-// Called after TranslateHelper verifies a page providing html lang attribute.
-// |provided_code| contains a html lang attribute which a page provides. It can
-// be empty string when a page doesn't provide it. |revised_code| is a value
-// modified by format error corrector.
-void ReportHtmlLang(const std::string& provided_code,
- const std::string& revised_code);
-
-// Called when CLD verifies Content-Language header.
-void ReportLanguageVerification(LanguageVerificationType type);
-
-// Called when the Translate Element library is ready.
-void ReportTimeToBeReady(double time_in_msec);
-
-// Called when the Translate Element library is loaded.
-void ReportTimeToLoad(double time_in_msec);
-
-// Called when a page translation is finished.
-void ReportTimeToTranslate(double time_in_msec);
-
-// Called when a translation is triggered.
-void ReportUserActionDuration(base::TimeTicks begin, base::TimeTicks end);
-
-// Called when a translation is triggered.
-void ReportPageScheme(const std::string& scheme);
-
-// Called when CLD detects page language.
-void ReportLanguageDetectionTime(base::TimeTicks begin, base::TimeTicks end);
-
-// Called when CLD agreed on a language which is different, but in the similar
-// language list.
-void ReportSimilarLanguageMatch(bool match);
-
-// Gets UMA name for an entry specified by |index|.
-const char* GetMetricsName(MetricsNameIndex index);
-
-} // namespace TranslateCommonMetrics
-
-#endif // CHROME_COMMON_TRANSLATE_TRANSLATE_COMMON_METRICS_H_
« no previous file with comments | « chrome/common/translate/language_detection_util_unittest.cc ('k') | chrome/common/translate/translate_common_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698