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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsMetrics.java

Issue 2846233003: 📰 Record user actions on the NTP and Home sheet (Closed)
Patch Set: Address bauerb@'s comment Created 3 years, 7 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/SuggestionsMetrics.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsMetrics.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsMetrics.java
new file mode 100644
index 0000000000000000000000000000000000000000..fa64959c56832b0d46598f9a1f39b8dec2155b08
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsMetrics.java
@@ -0,0 +1,46 @@
+// 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 org.chromium.base.metrics.RecordUserAction;
+
+/**
+ * Exposes methods to report suggestions related events, for UMA or Fetch scheduling purposes.
+ */
+public abstract class SuggestionsMetrics {
+ private SuggestionsMetrics() {}
+
+ // UI Element interactions
+
+ public static void recordSurfaceVisible() {
+ RecordUserAction.record("Suggestions.SurfaceVisible");
+ }
+
+ public static void recordSurfaceHidden() {
+ RecordUserAction.record("Suggestions.SurfaceHidden");
+ }
+
+ public static void recordTileTapped() {
+ RecordUserAction.record("Suggestions.Tile.Tapped");
+ }
+
+ public static void recordCardTapped() {
+ RecordUserAction.record("Suggestions.Card.Tapped");
+ }
+
+ public static void recordCardActionTapped() {
+ RecordUserAction.record("Suggestions.Card.ActionTapped");
+ }
+
+ public static void recordCardSwipedAway() {
+ RecordUserAction.record("Suggestions.Card.SwipedAway");
+ }
+
+ // Effect/Purpose of the interactions. Most are recorded in |content_suggestions_metrics.h|
+
+ public static void recordActionViewAll() {
+ RecordUserAction.record("Suggestions.Category.ViewAll");
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698