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 org.chromium.chrome.browser.ntp.cards.ActionItem; |
| 8 import org.chromium.chrome.browser.ntp.snippets.CategoryInt; |
| 9 import org.chromium.chrome.browser.ntp.snippets.SnippetArticle; |
| 10 |
| 11 /** |
| 12 * Exposes UMA related methods. |
| 13 */ |
| 14 public interface SuggestionsMetricsReporter { |
| 15 /** |
| 16 * Tracks per-page-load metrics for content suggestions. |
| 17 * @param categories The categories of content suggestions. |
| 18 * @param suggestionsPerCategory The number of content suggestions in each c
ategory. |
| 19 */ |
| 20 void onPageShown(int[] categories, int[] suggestionsPerCategory); |
| 21 |
| 22 /** |
| 23 * Tracks impression metrics for a content suggestion. |
| 24 * @param suggestion The content suggestion that was shown to the user. |
| 25 */ |
| 26 void onSuggestionShown(SnippetArticle suggestion); |
| 27 |
| 28 /** |
| 29 * Tracks interaction metrics for a content suggestion. |
| 30 * @param suggestion The content suggestion that the user opened. |
| 31 * @param windowOpenDisposition How the suggestion was opened (current tab,
new tab, |
| 32 * new window etc). |
| 33 */ |
| 34 void onSuggestionOpened(SnippetArticle suggestion, int windowOpenDisposition
); |
| 35 |
| 36 /** |
| 37 * Tracks impression metrics for the long-press menu for a content suggestio
n. |
| 38 * @param suggestion The content suggestion for which the long-press menu wa
s opened. |
| 39 */ |
| 40 void onSuggestionMenuOpened(SnippetArticle suggestion); |
| 41 |
| 42 /** |
| 43 * Tracks impression metrics for a category's action button ("More"). |
| 44 * @param category The action button that was shown. |
| 45 */ |
| 46 void onMoreButtonShown(@CategoryInt ActionItem category); |
| 47 |
| 48 /** |
| 49 * Tracks click metrics for a category's action button ("More"). |
| 50 * @param category The action button that was clicked. |
| 51 */ |
| 52 void onMoreButtonClicked(@CategoryInt ActionItem category); |
| 53 |
| 54 /** Sets the ranker to use to compute some of the reported metrics. */ |
| 55 void setRanker(SuggestionsRanker suggestionsRanker); |
| 56 } |
OLD | NEW |