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

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

Issue 387903003: Add metrics for tracking UX impact of non-static CLD data providers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use histos instead of actions Created 6 years, 5 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/renderer/translate/translate_helper.h
diff --git a/chrome/renderer/translate/translate_helper.h b/chrome/renderer/translate/translate_helper.h
index 1c357bf9e606308f1a6f2d9ff8fc487733b2c55e..a4530c4ad3aff6e1e54192e8f545d6eaa737b029 100644
--- a/chrome/renderer/translate/translate_helper.h
+++ b/chrome/renderer/translate/translate_helper.h
@@ -113,6 +113,13 @@ class TranslateHelper : public content::RenderViewObserver {
FRIEND_TEST_ALL_PREFIXES(TranslateHelperTest, SimilarLanguageCode);
FRIEND_TEST_ALL_PREFIXES(TranslateHelperTest, WellKnownWrongConfiguration);
+ enum LanguageDetectionTiming {
+ ON_TIME, // Language detection was performed as soon as it was requested
+ DEFERRED, // Language detection couldn't be performed when it was requested
+ RESUMED, // A deferred language detection attempt was completed later
+ kLanguageDetectionTimingMax // bounding value for this enum
Alexei Svitkine (slow) 2014/07/16 14:50:40 Nit: Use same naming convention as for the other e
andrewhayden 2014/07/17 08:36:19 This is copied from the same place the rest of thi
+ };
+
// Converts language code to the one used in server supporting list.
static void ConvertLanguageCodeSynonym(std::string* code);
@@ -167,6 +174,11 @@ class TranslateHelper : public content::RenderViewObserver {
// Callback triggered when CLD data becomes available.
void OnCldDataAvailable();
+ // Record the timing of language detection, immediately sending an IPC-based
jar (doing other things) 2014/07/16 16:44:44 nit: perhaps better would be to aggregate these re
andrewhayden 2014/07/17 08:36:19 Totally agree, but again very far out of scope for
+ // histogram delta update to the browser process in case the hosting renderer
+ // process terminates before the metrics would otherwise be transferred.
+ void RecordLanguageDetectionTiming(LanguageDetectionTiming);
+
// An ever-increasing sequence number of the current page, used to match up
// translation requests with responses.
int page_seq_no_;
« no previous file with comments | « no previous file | chrome/renderer/translate/translate_helper.cc » ('j') | chrome/renderer/translate/translate_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698