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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsMetricsReporter.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsMetricsReporter.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsMetricsReporter.java
new file mode 100644
index 0000000000000000000000000000000000000000..9165a0187f44bb9a7d263731952c372e1e2ea661
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsMetricsReporter.java
@@ -0,0 +1,67 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.suggestions;
+
+import android.util.Pair;
+
+import org.chromium.chrome.browser.ntp.snippets.CategoryInt;
+import org.chromium.chrome.browser.ntp.snippets.SnippetArticle;
+
+/**
+ * Exposes UMA related methods.
+ */
+public interface SuggestionsMetricsReporter {
+ /**
+ * Returns the rank of suggestion related elements.
+ */
+ interface SuggestionRanker {
+ /** @return The [rankInSection, globalRank] pair for the provided suggestion. */
+ Pair<Integer, Integer> getSuggestionRank(SnippetArticle suggestion);
+
+ /** @return The rank pair for the action item of the section for the provided 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.
+ int getActionItemRank(@CategoryInt int category);
+ }
+
+ void setRanker(SuggestionRanker ranker);
+
+ /**
+ * Tracks per-page-load metrics for content suggestions.
+ * @param categories The categories of content suggestions.
+ * @param suggestionsPerCategory The number of content suggestions in each category.
+ */
+ void onPageShown(int[] categories, int[] suggestionsPerCategory);
+
+ /**
+ * Tracks impression metrics for a content suggestion.
+ * @param suggestion The content suggestion that was shown to the user.
+ */
+ void onSuggestionShown(SnippetArticle suggestion);
+
+ /**
+ * Tracks interaction metrics for a content suggestion.
+ * @param suggestion The content suggestion that the user opened.
+ * @param windowOpenDisposition How the suggestion was opened (current tab, new tab,
+ * new window etc).
+ */
+ void onSuggestionOpened(SnippetArticle suggestion, int windowOpenDisposition);
+
+ /**
+ * Tracks impression metrics for the long-press menu for a content suggestion.
+ * @param suggestion The content suggestion for which the long-press menu was opened.
+ */
+ void onSuggestionMenuOpened(SnippetArticle suggestion);
+
+ /**
+ * Tracks impression metrics for a category's action button ("More").
+ * @param category The category for which the action button was shown.
+ */
+ void onMoreButtonShown(@CategoryInt int category);
+
+ /**
+ * Tracks click metrics for a category's action button ("More").
+ * @param category The category for which the action button was clicked.
+ */
+ void onMoreButtonClicked(@CategoryInt int category);
+}

Powered by Google App Engine
This is Rietveld 408576698