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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 475633002: Pass TouchMajor to HitTestResult (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 6 years, 2 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
Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index cb996fa2002677f431d198bf7989e9a65589d556..1827952ebfd079f2416cc1e19467e200b3129451 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -2347,11 +2347,16 @@ public class AwContents {
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
int actionIndex = event.getActionIndex();
+ // The length of major/minor axis of the touch area ellipse.
+ float touchMajor = event.getToolMajor(actionIndex) / (float) mDIPScale;
+ float touchMinor = event.getToolMinor(actionIndex) / (float) mDIPScale;
jdduke (slow) 2014/10/30 19:54:58 I wouldn't use touchMinor here, as then you'd also
hush (inactive) 2014/11/04 01:55:57 Okay. In this case, I am basically treating the t
// Note this will trigger IPC back to browser even if nothing is
// hit.
nativeRequestNewHitTestDataAt(mNativeAwContents,
(int) Math.round(event.getX(actionIndex) / mDIPScale),
- (int) Math.round(event.getY(actionIndex) / mDIPScale));
+ (int) Math.round(event.getY(actionIndex) / mDIPScale),
+ touchMajor,
+ touchMinor);
}
if (mOverScrollGlow != null) {
@@ -2565,7 +2570,8 @@ public class AwContents {
private native byte[] nativeGetCertificate(long nativeAwContents);
// Coordinates in desity independent pixels.
- private native void nativeRequestNewHitTestDataAt(long nativeAwContents, int x, int y);
+ private native void nativeRequestNewHitTestDataAt(long nativeAwContents, int x, int y,
+ float touchMajor, float touchMinor);
private native void nativeUpdateLastHitTestData(long nativeAwContents);
private native void nativeOnSizeChanged(long nativeAwContents, int w, int h, int ow, int oh);

Powered by Google App Engine
This is Rietveld 408576698