OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.ntp; | 5 package org.chromium.chrome.browser.ntp; |
6 | 6 |
7 import android.os.SystemClock; | 7 import android.os.SystemClock; |
8 import android.support.annotation.IntDef; | 8 import android.support.annotation.IntDef; |
9 | 9 |
10 import org.chromium.base.metrics.RecordHistogram; | 10 import org.chromium.base.metrics.RecordHistogram; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 public static final int ACTION_OPENED_MOST_VISITED_ENTRY = 3; | 42 public static final int ACTION_OPENED_MOST_VISITED_ENTRY = 3; |
43 // User opened a recently closed tab | 43 // User opened a recently closed tab |
44 public static final int ACTION_OPENED_RECENTLY_CLOSED_ENTRY = 4; | 44 public static final int ACTION_OPENED_RECENTLY_CLOSED_ENTRY = 4; |
45 // User opened a bookmark | 45 // User opened a bookmark |
46 public static final int ACTION_OPENED_BOOKMARK = 5; | 46 public static final int ACTION_OPENED_BOOKMARK = 5; |
47 // User opened a foreign session (from recent tabs section) | 47 // User opened a foreign session (from recent tabs section) |
48 public static final int ACTION_OPENED_FOREIGN_SESSION = 6; | 48 public static final int ACTION_OPENED_FOREIGN_SESSION = 6; |
49 // User navigated to the webpage for a snippet shown on the NTP. | 49 // User navigated to the webpage for a snippet shown on the NTP. |
50 public static final int ACTION_OPENED_SNIPPET = 7; | 50 public static final int ACTION_OPENED_SNIPPET = 7; |
51 // User clicked on an interest item. | 51 // User clicked on an interest item. |
52 public static final int ACTION_CLICKED_INTEREST = 8; | 52 public static final int ACTION_CLICKED_INTEREST = 8; |
Marc Treib
2016/10/11 12:18:14
Unrelated, but: This is unused. Maybe remove it, o
Michael van Ouwerkerk
2016/10/11 15:21:31
I added a TODO for removing it and cleaning up his
| |
53 // User clicked on the "learn more" link in the footer. | 53 // User clicked on the "learn more" link in the footer. |
54 public static final int ACTION_CLICKED_LEARN_MORE = 9; | 54 public static final int ACTION_CLICKED_LEARN_MORE = 9; |
55 // User clicked on the "Refresh" button in the "all dismissed" state. | |
56 public static final int ACTION_CLICKED_ALL_DISMISSED_REFRESH = 10; | |
55 // The number of possible actions | 57 // The number of possible actions |
56 private static final int NUM_ACTIONS = 10; | 58 private static final int NUM_ACTIONS = 11; |
57 | 59 |
58 // User navigated to a page using the omnibox. | 60 // User navigated to a page using the omnibox. |
59 private static final int RAPPOR_ACTION_NAVIGATED_USING_OMNIBOX = 0; | 61 private static final int RAPPOR_ACTION_NAVIGATED_USING_OMNIBOX = 0; |
60 // User navigated to a page using one of the suggested tiles. | 62 // User navigated to a page using one of the suggested tiles. |
61 public static final int RAPPOR_ACTION_VISITED_SUGGESTED_TILE = 1; | 63 public static final int RAPPOR_ACTION_VISITED_SUGGESTED_TILE = 1; |
62 | 64 |
63 // Regular NTP impression (usually when a new tab is opened) | 65 // Regular NTP impression (usually when a new tab is opened) |
64 public static final int NTP_IMPRESSION_REGULAR = 0; | 66 public static final int NTP_IMPRESSION_REGULAR = 0; |
65 | 67 |
66 // Potential NTP impressions (instead of blank page if no tab is open) | 68 // Potential NTP impressions (instead of blank page if no tab is open) |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 private void endRecording(Tab removeObserverFromTab) { | 269 private void endRecording(Tab removeObserverFromTab) { |
268 if (removeObserverFromTab != null) removeObserverFromTab.removeObser ver(this); | 270 if (removeObserverFromTab != null) removeObserverFromTab.removeObser ver(this); |
269 RecordUserAction.record("MobileNTP.Snippets.VisitEnd"); | 271 RecordUserAction.record("MobileNTP.Snippets.VisitEnd"); |
270 long visitTimeMs = SystemClock.elapsedRealtime() - mStartTimeMs; | 272 long visitTimeMs = SystemClock.elapsedRealtime() - mStartTimeMs; |
271 RecordHistogram.recordLongTimesHistogram( | 273 RecordHistogram.recordLongTimesHistogram( |
272 "NewTabPage.Snippets.VisitDuration", visitTimeMs, TimeUnit.M ILLISECONDS); | 274 "NewTabPage.Snippets.VisitDuration", visitTimeMs, TimeUnit.M ILLISECONDS); |
273 SnippetsBridge.onSuggestionTargetVisited(mCategory, visitTimeMs); | 275 SnippetsBridge.onSuggestionTargetVisited(mCategory, visitTimeMs); |
274 } | 276 } |
275 } | 277 } |
276 } | 278 } |
OLD | NEW |