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

Unified Diff: chrome/browser/ui/android/infobars/translate_infobar.cc

Issue 2968103002: Adds logging to indicate infobar creation in the native library, (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | components/translate/core/browser/translate_browser_metrics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/infobars/translate_infobar.cc
diff --git a/chrome/browser/ui/android/infobars/translate_infobar.cc b/chrome/browser/ui/android/infobars/translate_infobar.cc
index b49efe28f6204e1e77e39d550bb96b02679ea77d..ad43cd3d88f12eb8c21f73b9043a1429815d648f 100644
--- a/chrome/browser/ui/android/infobars/translate_infobar.cc
+++ b/chrome/browser/ui/android/infobars/translate_infobar.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/translate/android/translate_utils.h"
#include "chrome/browser/translate/chrome_translate_client.h"
#include "chrome/browser/ui/android/infobars/translate_compact_infobar.h"
+#include "components/translate/core/browser/translate_browser_metrics.h"
#include "components/translate/core/browser/translate_infobar_delegate.h"
#include "jni/TranslateInfoBar_jni.h"
@@ -28,12 +29,19 @@ using base::android::ScopedJavaLocalRef;
std::unique_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar(
std::unique_ptr<translate::TranslateInfoBarDelegate> delegate) const {
+ // Log metric to track how many times a brand new infobar was created to
+ // prompt the user to translate.
+ if (delegate.get()->translate_step() ==
+ translate::TRANSLATE_STEP_BEFORE_TRANSLATE) {
+ translate::TranslateBrowserMetrics::ReportInitiationStatus(
+ translate::TranslateBrowserMetrics::INITIATION_STATUS_CREATE_INFOBAR);
+ }
+
if (base::FeatureList::IsEnabled(translate::kTranslateCompactUI))
return base::MakeUnique<TranslateCompactInfoBar>(std::move(delegate));
- else
- return base::MakeUnique<TranslateInfoBar>(std::move(delegate));
-}
+ return base::MakeUnique<TranslateInfoBar>(std::move(delegate));
+}
// TranslateInfoBar -----------------------------------------------------------
« no previous file with comments | « no previous file | components/translate/core/browser/translate_browser_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698