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

Unified Diff: chrome/browser/translate/translate_infobar_delegate.cc

Issue 15646003: Translate: UMA for "Show original" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (rebase) Created 7 years, 7 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/translate_infobar_delegate.cc
diff --git a/chrome/browser/translate/translate_infobar_delegate.cc b/chrome/browser/translate/translate_infobar_delegate.cc
index 19290079016fe76be8dfa31b11ca844c2712929c..7803af4aef8cecc7917ee3816ecbcc0219a511bb 100644
--- a/chrome/browser/translate/translate_infobar_delegate.cc
+++ b/chrome/browser/translate/translate_infobar_delegate.cc
@@ -25,7 +25,11 @@ using content::NavigationEntry;
namespace {
-const char kTranslateShowErrorInfobar[] = "Translate.ShowErrorInfobar";
+const char kDeclineTranslate[] = "Translate.DeclineTranslate";
+const char kCloseInfobar[] = "Translate.DeclineTranslateCloseInfobar";
+const char kRevertTranslation[] = "Translate.RevertTranslation";
+const char kShowErrorInfobar[] = "Translate.ShowErrorInfobar";
+const char kPerformTranslate[] = "Translate.Translate";
} // namespace
@@ -87,12 +91,14 @@ void TranslateInfoBarDelegate::Translate() {
original_language_code(),
target_language_code());
- UMA_HISTOGRAM_COUNTS("Translate.Translate", 1);
+ UMA_HISTOGRAM_COUNTS(kPerformTranslate, 1);
}
void TranslateInfoBarDelegate::RevertTranslation() {
TranslateManager::GetInstance()->RevertTranslation(web_contents());
RemoveSelf();
+
+ UMA_HISTOGRAM_COUNTS(kRevertTranslation, 1);
}
void TranslateInfoBarDelegate::ReportLanguageDetectionError() {
@@ -115,7 +121,7 @@ void TranslateInfoBarDelegate::TranslationDeclined() {
TranslateTabHelper::FromWebContents(web_contents());
translate_tab_helper->language_state().set_translation_declined(true);
- UMA_HISTOGRAM_COUNTS("Translate.DeclineTranslate", 1);
+ UMA_HISTOGRAM_COUNTS(kDeclineTranslate, 1);
}
bool TranslateInfoBarDelegate::InTranslateNavigation() {
@@ -194,7 +200,7 @@ string16 TranslateInfoBarDelegate::GetMessageInfoBarText() {
}
DCHECK_EQ(TRANSLATION_ERROR, infobar_type_);
- UMA_HISTOGRAM_ENUMERATION(kTranslateShowErrorInfobar,
+ UMA_HISTOGRAM_ENUMERATION(kShowErrorInfobar,
error_type_,
TranslateErrors::TRANSLATE_ERROR_MAX);
switch (error_type_) {
@@ -390,7 +396,7 @@ void TranslateInfoBarDelegate::InfoBarDismissed() {
// The user closed the infobar without clicking the translate button.
TranslationDeclined();
- UMA_HISTOGRAM_COUNTS("Translate.DeclineTranslateCloseInfobar", 1);
+ UMA_HISTOGRAM_COUNTS(kCloseInfobar, 1);
}
int TranslateInfoBarDelegate::GetIconID() const {
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698