OLD | NEW |
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 import org.chromium.chrome.browser.preferences.ChromePreferenceManager; |
11 | 11 |
12 /** | 12 /** |
13 * 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. |
14 */ | 14 */ |
15 public abstract class SuggestionsMetrics { | 15 public abstract class SuggestionsMetrics { |
16 private SuggestionsMetrics() {} | 16 private SuggestionsMetrics() {} |
17 | 17 |
18 // UI Element interactions | 18 // UI Element interactions |
19 | 19 |
20 public static void recordSurfaceVisible() { | 20 public static void recordSurfaceVisible() { |
21 if (!ChromePreferenceManager.getInstance().getSuggestionsSurfaceShown())
{ | 21 if (!ChromePreferenceManager.getInstance().getSuggestionsSurfaceShown())
{ |
22 RecordUserAction.record("Suggestions.FirstTimeSurfaceVisible"); | 22 RecordUserAction.record("Suggestions.FirstTimeSurfaceVisible"); |
23 ChromePreferenceManager.getInstance().setSuggestionsSurfaceShown(); | 23 ChromePreferenceManager.getInstance().setSuggestionsSurfaceShown(); |
24 } | 24 } |
25 | 25 |
26 RecordUserAction.record("Suggestions.SurfaceVisible"); | 26 RecordUserAction.record("Suggestions.SurfaceVisible"); |
27 } | 27 } |
28 | 28 |
| 29 public static void recordSurfaceHalfVisible() { |
| 30 RecordUserAction.record("Suggestions.SurfaceHalfVisible"); |
| 31 } |
| 32 |
| 33 public static void recordSurfaceFullyVisible() { |
| 34 RecordUserAction.record("Suggestions.SurfaceFullyVisible"); |
| 35 } |
| 36 |
29 public static void recordSurfaceHidden() { | 37 public static void recordSurfaceHidden() { |
30 RecordUserAction.record("Suggestions.SurfaceHidden"); | 38 RecordUserAction.record("Suggestions.SurfaceHidden"); |
31 } | 39 } |
32 | 40 |
33 public static void recordTileTapped() { | 41 public static void recordTileTapped() { |
34 RecordUserAction.record("Suggestions.Tile.Tapped"); | 42 RecordUserAction.record("Suggestions.Tile.Tapped"); |
35 } | 43 } |
36 | 44 |
37 public static void recordCardTapped() { | 45 public static void recordCardTapped() { |
38 RecordUserAction.record("Suggestions.Card.Tapped"); | 46 RecordUserAction.record("Suggestions.Card.Tapped"); |
(...skipping 26 matching lines...) Expand all Loading... |
65 | 73 |
66 RecordUserAction.record("Suggestions.ScrolledAfterOpen"); | 74 RecordUserAction.record("Suggestions.ScrolledAfterOpen"); |
67 mFired = true; | 75 mFired = true; |
68 } | 76 } |
69 | 77 |
70 public void reset() { | 78 public void reset() { |
71 mFired = false; | 79 mFired = false; |
72 } | 80 } |
73 } | 81 } |
74 } | 82 } |
OLD | NEW |