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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsMetricsReporter.java

Issue 2618893003: 📰 Tweak the suggestion ranks for UMA to handle fetchMore (Closed)
Patch Set: rebase and fix findbugs warning Created 3 years, 11 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 unified diff | Download patch
OLDNEW
(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.util.Pair;
8
9 import org.chromium.chrome.browser.ntp.snippets.CategoryInt;
10 import org.chromium.chrome.browser.ntp.snippets.SnippetArticle;
11
12 /**
13 * Exposes UMA related methods.
14 */
15 public interface SuggestionsMetricsReporter {
16 /**
17 * Returns the rank of suggestion related elements.
18 */
19 interface SuggestionRanker {
20 /** @return The [rankInSection, globalRank] pair for the provided sugges tion. */
21 Pair<Integer, Integer> getSuggestionRank(SnippetArticle suggestion);
22
23 /** @return The rank pair for the action item of the section for the pro vided category. */
Bernhard Bauer 2017/01/13 10:56:07 This method doesn't return a pair.
dgn 2017/01/13 11:24:04 Oops thanks, done.
24 int getActionItemRank(@CategoryInt int category);
25 }
26
27 void setRanker(SuggestionRanker ranker);
28
29 /**
30 * Tracks per-page-load metrics for content suggestions.
31 * @param categories The categories of content suggestions.
32 * @param suggestionsPerCategory The number of content suggestions in each c ategory.
33 */
34 void onPageShown(int[] categories, int[] suggestionsPerCategory);
35
36 /**
37 * Tracks impression metrics for a content suggestion.
38 * @param suggestion The content suggestion that was shown to the user.
39 */
40 void onSuggestionShown(SnippetArticle suggestion);
41
42 /**
43 * Tracks interaction metrics for a content suggestion.
44 * @param suggestion The content suggestion that the user opened.
45 * @param windowOpenDisposition How the suggestion was opened (current tab, new tab,
46 * new window etc).
47 */
48 void onSuggestionOpened(SnippetArticle suggestion, int windowOpenDisposition );
49
50 /**
51 * Tracks impression metrics for the long-press menu for a content suggestio n.
52 * @param suggestion The content suggestion for which the long-press menu wa s opened.
53 */
54 void onSuggestionMenuOpened(SnippetArticle suggestion);
55
56 /**
57 * Tracks impression metrics for a category's action button ("More").
58 * @param category The category for which the action button was shown.
59 */
60 void onMoreButtonShown(@CategoryInt int category);
61
62 /**
63 * Tracks click metrics for a category's action button ("More").
64 * @param category The category for which the action button was clicked.
65 */
66 void onMoreButtonClicked(@CategoryInt int category);
67 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698