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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 53283003: Added UMA stat for tracking accidental navigations on double tap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 739a66ab7a2fb0074f31d921dd8aa60857e11c7b..6f423ffadd1b63567c01a74630a27da672b2101e 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -459,6 +459,21 @@ public class ContentViewCore
private ViewAndroid mViewAndroid;
+ public enum UMAActionAfterDoubleTap {
bulach 2013/11/04 18:22:31 can't have enums on android java, it's really frow
Rick Byers 2013/11/04 18:34:41 Sorry, my bad - I asked bokan to switch to using r
bokan 2013/11/04 20:01:08 Done.
+ NAVIGATE_BACK(0), NAVIGATE_STOP(1), NO_ACTION(2), COUNT(3);
+
+ private final int value;
+ private UMAActionAfterDoubleTap(int value) { this.value = value; }
+ public int getValue() { return value; }
+ }
+
+ public enum UMASingleTapType {
+ DELAYED_TAP(0), UNDELAYED_TAP(1), COUNT(2);
+
+ private final int value;
+ private UMASingleTapType(int value) { this.value = value; }
+ public int getValue() { return value; }
+ }
/**
* Constructs a new ContentViewCore. Embedders must call initialize() after constructing
@@ -1323,6 +1338,10 @@ public class ContentViewCore
}
}
+ public void reportActionAfterDoubleTapUMA(UMAActionAfterDoubleTap type) {
+ mContentViewGestureHandler.reportActionAfterDoubleTapUMA(type);
+ }
+
@Override
public boolean sendGesture(int type, long timeMs, int x, int y, Bundle b) {
if (offerGestureToEmbedder(type)) return false;
@@ -1394,6 +1413,24 @@ public class ContentViewCore
}
@Override
+ public void sendSingleTapUMA(UMASingleTapType type) {
+ nativeSendSingleTapUma(
+ mNativeContentViewCore,
+ type.getValue(),
+ UMASingleTapType.COUNT.getValue());
+ }
+
+ @Override
+ public void sendActionAfterDoubleTapUMA(UMAActionAfterDoubleTap type,
+ boolean clickDelayEnabled) {
+ nativeSendActionAfterDoubleTapUma(
+ mNativeContentViewCore,
+ type.getValue(),
+ clickDelayEnabled,
+ UMAActionAfterDoubleTap.COUNT.getValue());
+ }
+
+ @Override
public void onSentLastGestureForVSync(long eventTimeMs) {
if (isVSyncNotificationEnabled()) {
mDidSignalVSyncUsingInputEvent = true;
@@ -3375,4 +3412,10 @@ public class ContentViewCore
private native void nativeSetAccessibilityEnabled(
int nativeContentViewCoreImpl, boolean enabled);
+
+ private native void nativeSendSingleTapUma(int nativeContentViewCoreImpl,
+ int type, int count);
+
+ private native void nativeSendActionAfterDoubleTapUma(int nativeContentViewCoreImpl,
+ int type, boolean hasDelay, int count);
}

Powered by Google App Engine
This is Rietveld 408576698