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

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

Issue 2916873004: Quick fix for logging. (Closed)
Patch Set: updates Created 3 years, 6 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/browser/translate/chrome_translate_client.cc
diff --git a/chrome/browser/translate/chrome_translate_client.cc b/chrome/browser/translate/chrome_translate_client.cc
index c29d82fc79b9440dc06d7cac05cc956683739d89..5ae31ae20e54d05f033805b5cabde7c2716ecebf 100644
--- a/chrome/browser/translate/chrome_translate_client.cc
+++ b/chrome/browser/translate/chrome_translate_client.cc
@@ -86,9 +86,12 @@ void LogLanguageDetectionEvent(
// If entry is null, we don't record the page.
// The navigation entry can be null in situations like download or initial
// blank page.
- if (entry != nullptr) {
+ DCHECK(web_contents);
+ if (entry != nullptr &&
+ TranslateService::IsTranslatableURL(entry->GetVirtualURL())) {
user_event_service->RecordUserEvent(
- translate::ConstructLanguageDetectionEvent(details));
+ translate::ConstructLanguageDetectionEvent(
+ entry->GetTimestamp().ToInternalValue(), details));
}
}
« no previous file with comments | « chrome/browser/translate/chrome_translate_client.h ('k') | chrome/browser/translate/chrome_translate_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698