| 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 | 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 Loading... |
| 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 } |
| OLD | NEW |