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..6fcb2d7fe3202d0049ea19a33db73d397cd2533e 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,13 @@ 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"; |
+ 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 +30,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 +43,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 +51,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 histogram. |
+ * @param contentLength The content length in MB of the promo that was shown. |
+ */ |
+ public static void dataReductionProxySnackbarPromo(int contentLength) { |
+ RecordHistogram.recordCustomCountHistogram( |
+ SNACKBAR_HISTOGRAM_NAME, contentLength, 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); |
} |
} |