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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionProxyUma.java

Issue 2367403005: Snackbar for promoting Data Saver to existing users (Closed)
Patch Set: rename "data saving" to "data savings" for consistency Created 4 years, 2 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/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionProxyUma.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionProxyUma.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionProxyUma.java
index 8d261580a66306171348f5634b4314509d0a4431..903fde8136c924e95bb3afbd6b31322dfd9ec0a4 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionProxyUma.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionProxyUma.java
@@ -10,8 +10,14 @@ import org.chromium.base.metrics.RecordHistogram;
* Centralizes UMA data collection for the Data Reduction Proxy.
*/
public class DataReductionProxyUma {
- // Represent the possible user actions in the promo and settings menu. This must
- // remain in sync with DataReductionProxy.UIAction in
+
+ public static final String UI_ACTION_HISTOGRAM_NAME = "DataReductionProxy.UIAction";
+ public static final String SNACKBAR_HISTOGRAM_NAME =
+ "DataReductionProxy.SnackbarPromo.DataSavings";
+ public static final String PREVIEWS_HISTOGRAM_NAME = "Previews.ContextMenuAction.LoFi";
+
+ // Represent the possible user actions in the various data reduction promos and settings menu.
+ // This must remain in sync with DataReductionProxy.UIAction in
// tools/metrics/histograms/histograms.xml.
public static final int ACTION_ENABLED = 0;
// The value of 1 is reserved for an iOS-specific action. Values 2 and 3 are
@@ -25,7 +31,10 @@ public class DataReductionProxyUma {
public static final int ACTION_FRE_DISABLED = 10;
public static final int ACTION_INFOBAR_ENABLED = 11;
public static final int ACTION_INFOBAR_DISMISSED = 12;
- public static final int ACTION_INDEX_BOUNDARY = 13;
+ public static final int ACTION_SNACKBAR_LINK_CLICKED = 13;
+ public static final int ACTION_SNACKBAR_LINK_CLICKED_DISABLED = 14;
+ public static final int ACTION_SNACKBAR_DISMISSED = 15;
+ public static final int ACTION_INDEX_BOUNDARY = 16;
// Represent the possible Lo-Fi context menu user actions. This must remain in sync with
// Previews.ContextMenuAction.LoFi in tools/metrics/histograms/histograms.xml.
@@ -35,6 +44,7 @@ public class DataReductionProxyUma {
public static final int ACTION_LOFI_LOAD_IMAGES_CONTEXT_MENU_SHOWN = 3;
public static final int ACTION_LOFI_LOAD_IMAGES_CONTEXT_MENU_CLICKED = 4;
public static final int ACTION_LOFI_CONTEXT_MENU_INDEX_BOUNDARY = 5;
+
/**
* Record the DataReductionProxy.UIAction histogram.
* @param action User action at the promo, first run experience, or settings screen
@@ -42,18 +52,27 @@ public class DataReductionProxyUma {
public static void dataReductionProxyUIAction(int action) {
assert action >= 0 && action < ACTION_INDEX_BOUNDARY;
RecordHistogram.recordEnumeratedHistogram(
- "DataReductionProxy.UIAction", action,
+ UI_ACTION_HISTOGRAM_NAME, action,
DataReductionProxyUma.ACTION_INDEX_BOUNDARY);
}
/**
+ * Record the DataReductionProxy.SnackbarPromo.DataSavings histogram.
+ * @param promoDataSavingsMB The data savings in MB of the promo that was shown.
+ */
+ public static void dataReductionProxySnackbarPromo(int promoDataSavingsMB) {
+ RecordHistogram.recordCustomCountHistogram(
+ SNACKBAR_HISTOGRAM_NAME, promoDataSavingsMB, 1, 10000, 200);
+ }
+
+ /**
* Record the Previews.ContextMenuAction.LoFi histogram.
* @param action LoFi user action on the context menu
*/
public static void previewsLoFiContextMenuAction(int action) {
assert action >= 0 && action < ACTION_LOFI_CONTEXT_MENU_INDEX_BOUNDARY;
RecordHistogram.recordEnumeratedHistogram(
- "Previews.ContextMenuAction.LoFi", action,
+ PREVIEWS_HISTOGRAM_NAME, action,
ACTION_LOFI_CONTEXT_MENU_INDEX_BOUNDARY);
}
}

Powered by Google App Engine
This is Rietveld 408576698