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

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

Issue 385963002: [Android] Support SPen events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/ContentView.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentView.java b/content/public/android/java/src/org/chromium/content/browser/ContentView.java
index ac54c16427643e9dac5981c6190ce6c08be2d646..8143661003c0024e597de103ecb9da1e01941427 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentView.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentView.java
@@ -129,6 +129,18 @@ public class ContentView extends FrameLayout
@Override
public boolean onTouchEvent(MotionEvent event) {
+ // S-Pen support: convert to normal stylus event handling
Yaron 2014/07/11 21:40:27 Should this code be in CVC instead? This codepath
Changwan Ryu 2014/07/11 22:14:20 OEMs can add the conversion logic in WebView.java
Yaron 2014/07/14 17:15:48 I guess I'm worried about other programmatic invoc
David Trainor- moved to gerrit 2014/07/15 00:38:08 We recently moved the logic from onTouchEvent here
Changwan Ryu 2014/07/15 01:05:07 Sounds good. Done.
+ final int spenActionDown = 11;
jdduke (slow) 2014/07/11 14:47:38 I have a few worries about this. Suppose Vendor
Changwan Ryu 2014/07/11 22:14:20 I think this is a valid concern. Let me add OEM ch
jdduke (slow) 2014/07/11 22:17:40 OK, to summarize some of the downstream and offlin
Changwan Ryu 2014/07/11 23:06:35 ApiCompatibilityUtils is mostly concerned about An
+ final int spenActionUp = 12;
+ final int spenActionMove = 13;
+ int action = event.getAction();
+ if (action == spenActionDown) {
+ event.setAction(MotionEvent.ACTION_DOWN);
+ } else if (action == spenActionUp) {
+ event.setAction(MotionEvent.ACTION_UP);
+ } else if (action == spenActionMove) {
+ event.setAction(MotionEvent.ACTION_MOVE);
+ }
return mContentViewCore.onTouchEvent(event);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698