Commit 831c67da authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

GestureNav: Histogram for gesture UI type

This CL adds a new histogram entry that tells us which gesture
navigation UI (among Chrome's own gesture and OS-provided one)
is used. It is logged on Chrome startup in the devices that has
the Chrome gesture UI is enabled to get an idea on how many devices
have OS gesture vs. Chrome's own UI.

Bug: 1128629
Change-Id: I8062aa8372a1db9050345fb9bb79e10920cb8a2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2448713
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarDonn Denman <donnd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817747}
parent 04b5f37f
......@@ -17,7 +17,7 @@ import java.lang.annotation.RetentionPolicy;
*/
class GestureNavMetrics {
// Used to record the UMA histogram GestureNavigation. This definition should be
// in sync with the enum "GestureNavigationDirection" in tools/metrics/histograms/enum.xml.
// in sync with the enum "GestureNavigationDirection" in tools/metrics/histograms/enums.xml.
@IntDef({GestureNavigationDirection.BACK, GestureNavigationDirection.FORWARD})
@Retention(RetentionPolicy.SOURCE)
private @interface GestureNavigationDirection {
......@@ -27,6 +27,18 @@ class GestureNavMetrics {
int NUM_ENTRIES = 2;
}
// Should be in sync with the enum "GestureNavigationType" in
// tools/metrics/histograms/enums.xml.
@SuppressWarnings("unused")
@IntDef({GestureNavigationType.CHROME, GestureNavigationType.SYSTEM})
@Retention(RetentionPolicy.SOURCE)
private @interface GestureNavigationType {
int SYSTEM = 0;
int CHROME = 1;
int NUM_ENTRIES = 2;
}
private GestureNavMetrics() {}
/**
......@@ -47,4 +59,15 @@ class GestureNavMetrics {
static void recordUserAction(String name) {
RecordUserAction.record("BackMenu_" + name);
}
/**
* Records UMA histogram that tells which gesture navigation type is being used.
* @param isChromeGesture {@code true} if Chrome's own UI is in use.
*/
static void logGestureType(boolean isChromeGesture) {
// true -> GestureNavigationType.CHROME
// false -> GestureNavigationType.SYSTEM
// This histogram is logged at Chrome startup.
RecordHistogram.recordBooleanHistogram("GestureNavigation.Type", isChromeGesture);
}
}
......@@ -161,6 +161,7 @@ public class HistoryNavigationCoordinator
insetObserverView.addObserver(this);
}
layoutManager.addSceneOverlay(mOverscrollGlowOverlay);
GestureNavMetrics.logGestureType(isFeatureEnabled());
}
private boolean isNativePage() {
......
......@@ -34141,6 +34141,11 @@ Called by update_feature_policy_enum.py.-->
<int value="1" label="Gesture navigation forward"/>
</enum>
<enum name="GestureNavigationType">
<int value="0" label="OS system Gesture navigation"/>
<int value="1" label="Chrome custom Gesture navigation"/>
</enum>
<enum name="GesturePredictionResult">
<int value="0" label="Gesture occured and was predicted"/>
<int value="1" label="Gesture occured but was not predicted"/>
......@@ -5443,7 +5443,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</histogram>
<histogram name="GestureNavigation.Activated" enum="GestureNavigationDirection"
expires_after="2021-03-28">
expires_after="2021-12-28">
<owner>jinsukkim@chromium.org</owner>
<owner>chrome-android-app@chromium.org</owner>
<summary>
......@@ -5455,7 +5455,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</histogram>
<histogram name="GestureNavigation.Cancelled" enum="GestureNavigationDirection"
expires_after="2021-03-28">
expires_after="2021-12-28">
<owner>jinsukkim@chromium.org</owner>
<owner>chrome-android-app@chromium.org</owner>
<summary>
......@@ -5466,7 +5466,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</histogram>
<histogram name="GestureNavigation.Completed" enum="GestureNavigationDirection"
expires_after="2021-03-28">
expires_after="2021-12-28">
<owner>jinsukkim@chromium.org</owner>
<owner>chrome-android-app@chromium.org</owner>
<summary>
......@@ -5476,7 +5476,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</histogram>
<histogram name="GestureNavigation.Reversed" enum="GestureNavigationDirection"
expires_after="2021-03-28">
expires_after="2021-12-28">
<owner>jinsukkim@chromium.org</owner>
<owner>chrome-android-app@chromium.org</owner>
<summary>
......@@ -5529,6 +5529,18 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</histogram>
<histogram name="GestureNavigation.Type" enum="GestureNavigationType"
expires_after="2021-12-28">
<owner>jinsukkim@chromium.org</owner>
<owner>chrome-android-app@chromium.org</owner>
<summary>
Gesture navigation type. It can be either Chrome's own gesture UI that
supports back and forward navigation or OS-provided default system gesture
navigation that supports only back action on both left and right edge. This
is recorded on Chrome startup at the feature component initialization.
</summary>
</histogram>
<histogram name="Gpu.GL.ProgramBuildTime" units="ms" expires_after="M82">
<owner>ccameron@chromium.org</owner>
<owner>graphics-dev@chromium.org</owner>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment