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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java

Issue 2750503004: Add metric to record users opening a new NTP. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | tools/metrics/actions/actions.xml » ('j') | tools/metrics/actions/actions.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
index 3b3bb8822a169659229e92db6f9068fe6a5f8152..a6f2d9ae91c8df7ddb924d650bde59a36e0624f2 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
@@ -98,6 +98,9 @@ public class NewTabPage
// The timestamp at which this NTP was last shown to the user.
private long mLastShownTimeNs;
+ // False until the NTP has been shown to the user for the first time.
+ private boolean mHasBeenShownBefore;
+
private boolean mIsLoaded;
// Whether destroy() has been called.
@@ -507,6 +510,11 @@ public class NewTabPage
private void recordNTPShown() {
mLastShownTimeNs = System.nanoTime();
RecordUserAction.record("MobileNTPShown");
+ if (mHasBeenShownBefore) {
Michael van Ouwerkerk 2017/03/13 16:42:56 I don't understand the intention of this variable
dgn 2017/03/13 16:46:11 nit: the java style is inline return
fhorschig 2017/03/13 16:57:47 Sorry, I didn't check the git-cl-format output.
fhorschig 2017/03/13 16:57:47 Yes, inverted the logic again. Thanks for spotting
+ return;
+ }
+ RecordUserAction.record("MobileNTPVisitedAgain");
+ mHasBeenShownBefore = true;
}
private void recordNTPInteractionTime() {
« no previous file with comments | « no previous file | tools/metrics/actions/actions.xml » ('j') | tools/metrics/actions/actions.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698