| Index: chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
|
| index 93576f161af44d0c5f51efe839f430b64d2cc9b4..87e457bebf7903feaae2711693e3810b91e5d987 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
|
| @@ -84,6 +84,29 @@ public class LaunchMetrics {
|
| }
|
| }
|
|
|
| + /** Caches a set of enumerated histogram samples. */
|
| + public static class EnumeratedHistogramSample extends CachedHistogram {
|
| + private final List<Integer> mSamples = new ArrayList<Integer>();
|
| + private final int mMaxValue;
|
| +
|
| + public EnumeratedHistogramSample(String histogramName, int maxValue) {
|
| + super(histogramName);
|
| + mMaxValue = maxValue;
|
| + }
|
| +
|
| + public void record(int sample) {
|
| + mSamples.add(sample);
|
| + }
|
| +
|
| + @Override
|
| + protected void commitAndClear() {
|
| + for (Integer sample : mSamples) {
|
| + RecordHistogram.recordEnumeratedHistogram(mHistogramName, sample, mMaxValue);
|
| + }
|
| + mSamples.clear();
|
| + }
|
| + }
|
| +
|
| // Each list item is a pair of the url and where it was added from e.g. from the add to
|
| // homescreen menu item, an app banner, or unknown. The mapping of int source values to
|
| // their string names is found in the C++ ShortcutInfo struct.
|
|
|