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

Unified Diff: chrome/renderer/translate/translate_helper.cc

Issue 14798008: Translate: add UMA to measure duration time of infobar user action (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 | « chrome/renderer/translate/translate_helper.h ('k') | chrome/renderer/translate/translate_helper_metrics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/translate/translate_helper.cc
diff --git a/chrome/renderer/translate/translate_helper.cc b/chrome/renderer/translate/translate_helper.cc
index 161e1f6ac901ce337dd875a90414c8f073ffc706..3ebd7cbcfcc8c392b5efaf7ebad6bdee892285d0 100644
--- a/chrome/renderer/translate/translate_helper.cc
+++ b/chrome/renderer/translate/translate_helper.cc
@@ -126,6 +126,8 @@ void TranslateHelper::PageCaptured(const string16& contents) {
if (language.empty())
return;
+ language_determined_time_ = base::TimeTicks::Now();
+
Send(new ChromeViewHostMsg_TranslateLanguageDetermined(
routing_id(), language, IsPageTranslatable(&document)));
}
@@ -438,6 +440,9 @@ void TranslateHelper::OnTranslatePage(int page_id,
source_lang : kAutoDetectionLanguage;
target_lang_ = target_lang;
+ TranslateHelperMetrics::ReportUserActionDuration(language_determined_time_,
+ base::TimeTicks::Now());
+
if (!IsTranslateLibAvailable()) {
// Evaluate the script to add the translation related method to the global
// context of the page.
« no previous file with comments | « chrome/renderer/translate/translate_helper.h ('k') | chrome/renderer/translate/translate_helper_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698