Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.chrome.browser.suggestions; | |
| 6 | |
| 7 import android.annotation.IntDef; | |
| 8 | |
| 9 import org.chromium.base.metrics.RecordHistogram; | |
| 10 | |
| 11 import java.lang.annotation.Retention; | |
| 12 import java.lang.annotation.RetentionPolicy; | |
| 13 | |
| 14 /** | |
| 15 * Centralises the UMA recording related to content suggestions. | |
| 16 * TODO(https://crbug.com/707767): Move relevant methods from SnippetsBridge and NewTabPageUma here. | |
| 17 */ | |
| 18 public final class ContentSuggestionsUma { | |
| 19 private ContentSuggestionsUma() {} | |
| 20 | |
| 21 private static final String REMOTE_SUGGESTIONS_PREF_TOGGLE_HISTOGRAM_NAME = ""; | |
|
Michael van Ouwerkerk
2017/04/04 14:09:47
No name?
dgn
2017/04/04 19:02:54
Done.
| |
| 22 | |
| 23 @IntDef({PREFERENCE_TOGGLE_ON_TO_ON, PREFERENCE_TOGGLE_ON_TO_OFF, PREFERENCE _TOGGLE_OFF_TO_ON, | |
| 24 PREFERENCE_TOGGLE_OFF_TO_OFF}) | |
| 25 @Retention(RetentionPolicy.SOURCE) | |
| 26 public @interface PreferenceToggle {} | |
| 27 public static final int PREFERENCE_TOGGLE_ON_TO_ON = 0; | |
| 28 public static final int PREFERENCE_TOGGLE_ON_TO_OFF = 1; | |
| 29 public static final int PREFERENCE_TOGGLE_OFF_TO_ON = 2; | |
| 30 public static final int PREFERENCE_TOGGLE_OFF_TO_OFF = 3; | |
| 31 private static final int PREFERENCE_TOGGLE_INDEX_BOUNDARY = 4; | |
| 32 | |
| 33 public static void remoteSuggestionsPreferencesUIAction(@PreferenceToggle in t action) { | |
|
Michael van Ouwerkerk
2017/04/04 14:09:47
maybe rename to something like recordPreferencesCh
dgn
2017/04/04 19:02:54
Ack
| |
| 34 RecordHistogram.recordEnumeratedHistogram(REMOTE_SUGGESTIONS_PREF_TOGGLE _HISTOGRAM_NAME, | |
| 35 action, PREFERENCE_TOGGLE_INDEX_BOUNDARY); | |
| 36 } | |
| 37 } | |
| OLD | NEW |