Chromium Code Reviews| 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 026f9b45308f48da1e0c1f50d99e942cc844f698..5ba29e8d17ad8c2673c8b382b8665e4f1592db77 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,19 @@ public class ContentViewCore |
| private ViewAndroid mViewAndroid; |
| + public static class UMAUserAction { |
|
Rick Byers
2013/11/01 14:45:09
Can't you use a Java enum type here? Looks like w
bokan
2013/11/01 18:52:44
Changed.
|
| + // Enum for "action after double tap" UMA stat. |
| + // Be sure to update histograms.xml if you update these. |
| + public static final int NAVIGATE_BACK = 0; |
| + public static final int NAVIGATE_STOP = 1; |
| + public static final int NO_ACTION = 2; |
| + public static final int ACTION_AFTER_DOUBLE_TAP_UMA_COUNT = 3; |
| + |
| + // Not passed to UMA stats - used internally only |
|
Rick Byers
2013/11/01 14:45:09
Seems kind of hacky to include these in the enum..
bokan
2013/11/01 18:52:44
I cleaned it up. PTAL
|
| + public static final int DOUBLE_TAP = 100; |
| + public static final int DELAYED_TAP = 101; |
| + } |
| + |
| /** |
| * Constructs a new ContentViewCore. Embedders must call initialize() after constructing |
| @@ -1323,6 +1336,10 @@ public class ContentViewCore |
| } |
| } |
| + public void reportActionForUMA(int actionType) { |
| + mContentViewGestureHandler.reportActionForUMA(actionType); |
| + } |
| + |
| @Override |
| public boolean sendGesture(int type, long timeMs, int x, int y, Bundle b) { |
| if (offerGestureToEmbedder(type)) return false; |
| @@ -1394,6 +1411,23 @@ public class ContentViewCore |
| } |
| @Override |
| + public void sendUserActionUMA(int actionType, boolean clickDelayEnabled) { |
|
Rick Byers
2013/11/01 14:45:09
Is it not possible/easy to call into native direct
bokan
2013/11/01 18:52:44
I don't think it has a binding class, there's an i
|
| + int doubleTapEnumCount = |
| + UMAUserAction.ACTION_AFTER_DOUBLE_TAP_UMA_COUNT; |
| + |
| + if (actionType < doubleTapEnumCount) { |
| + nativeSendActionAfterDoubleTapUma( |
| + mNativeContentViewCore, |
| + actionType, |
| + clickDelayEnabled, |
| + doubleTapEnumCount); |
| + } else if (actionType |
| + == UMAUserAction.DELAYED_TAP) { |
| + nativeSendDelayedTapUma(mNativeContentViewCore); |
| + } |
| + } |
| + |
| + @Override |
| public void onSentLastGestureForVSync(long eventTimeMs) { |
| if (isVSyncNotificationEnabled()) { |
| mDidSignalVSyncUsingInputEvent = true; |
| @@ -3368,4 +3402,9 @@ public class ContentViewCore |
| private native void nativeSetAccessibilityEnabled( |
| int nativeContentViewCoreImpl, boolean enabled); |
| + |
| + private native void nativeSendDelayedTapUma(int nativeContentViewCoreImpl); |
| + |
| + private native void nativeSendActionAfterDoubleTapUma(int nativeContentViewCoreImpl, |
| + int type, boolean hasDelay, int count); |
| } |