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

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

Issue 2878773002: 📰 Add user action for the first time the UI is shown (Closed)
Patch Set: rebase, remove not_user_triggered 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.suggestions; 5 package org.chromium.chrome.browser.suggestions;
6 6
7 import android.support.v7.widget.RecyclerView; 7 import android.support.v7.widget.RecyclerView;
8 8
9 import org.chromium.base.metrics.RecordUserAction; 9 import org.chromium.base.metrics.RecordUserAction;
10 import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
10 11
11 /** 12 /**
12 * Exposes methods to report suggestions related events, for UMA or Fetch schedu ling purposes. 13 * Exposes methods to report suggestions related events, for UMA or Fetch schedu ling purposes.
13 */ 14 */
14 public abstract class SuggestionsMetrics { 15 public abstract class SuggestionsMetrics {
15 private SuggestionsMetrics() {} 16 private SuggestionsMetrics() {}
16 17
17 // UI Element interactions 18 // UI Element interactions
18 19
19 public static void recordSurfaceVisible() { 20 public static void recordSurfaceVisible() {
21 if (!ChromePreferenceManager.getInstance().getSuggestionsSurfaceShown()) {
22 RecordUserAction.record("Suggestions.FirstTimeSurfaceVisible");
23 ChromePreferenceManager.getInstance().setSuggestionsSurfaceShown();
24 }
25
20 RecordUserAction.record("Suggestions.SurfaceVisible"); 26 RecordUserAction.record("Suggestions.SurfaceVisible");
21 } 27 }
22 28
23 public static void recordSurfaceHidden() { 29 public static void recordSurfaceHidden() {
24 RecordUserAction.record("Suggestions.SurfaceHidden"); 30 RecordUserAction.record("Suggestions.SurfaceHidden");
25 } 31 }
26 32
27 public static void recordTileTapped() { 33 public static void recordTileTapped() {
28 RecordUserAction.record("Suggestions.Tile.Tapped"); 34 RecordUserAction.record("Suggestions.Tile.Tapped");
29 } 35 }
(...skipping 29 matching lines...) Expand all
59 65
60 RecordUserAction.record("Suggestions.ScrolledAfterOpen"); 66 RecordUserAction.record("Suggestions.ScrolledAfterOpen");
61 mFired = true; 67 mFired = true;
62 } 68 }
63 69
64 public void reset() { 70 public void reset() {
65 mFired = false; 71 mFired = false;
66 } 72 }
67 } 73 }
68 } 74 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698