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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.content.res.Configuration; 8 import android.content.res.Configuration;
9 import android.graphics.Canvas; 9 import android.graphics.Canvas;
10 import android.graphics.Rect; 10 import android.graphics.Rect;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 public boolean dispatchKeyEvent(KeyEvent event) { 122 public boolean dispatchKeyEvent(KeyEvent event) {
123 if (isFocused()) { 123 if (isFocused()) {
124 return mContentViewCore.dispatchKeyEvent(event); 124 return mContentViewCore.dispatchKeyEvent(event);
125 } else { 125 } else {
126 return super.dispatchKeyEvent(event); 126 return super.dispatchKeyEvent(event);
127 } 127 }
128 } 128 }
129 129
130 @Override 130 @Override
131 public boolean onTouchEvent(MotionEvent event) { 131 public boolean onTouchEvent(MotionEvent event) {
132 // 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.
133 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
134 final int spenActionUp = 12;
135 final int spenActionMove = 13;
136 int action = event.getAction();
137 if (action == spenActionDown) {
138 event.setAction(MotionEvent.ACTION_DOWN);
139 } else if (action == spenActionUp) {
140 event.setAction(MotionEvent.ACTION_UP);
141 } else if (action == spenActionMove) {
142 event.setAction(MotionEvent.ACTION_MOVE);
143 }
132 return mContentViewCore.onTouchEvent(event); 144 return mContentViewCore.onTouchEvent(event);
133 } 145 }
134 146
135 /** 147 /**
136 * Mouse move events are sent on hover enter, hover move and hover exit. 148 * Mouse move events are sent on hover enter, hover move and hover exit.
137 * They are sent on hover exit because sometimes it acts as both a hover 149 * They are sent on hover exit because sometimes it acts as both a hover
138 * move and hover exit. 150 * move and hover exit.
139 */ 151 */
140 @Override 152 @Override
141 public boolean onHoverEvent(MotionEvent event) { 153 public boolean onHoverEvent(MotionEvent event) {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 327
316 @Override 328 @Override
317 public boolean super_awakenScrollBars(int startDelay, boolean invalidate) { 329 public boolean super_awakenScrollBars(int startDelay, boolean invalidate) {
318 return super.awakenScrollBars(startDelay, invalidate); 330 return super.awakenScrollBars(startDelay, invalidate);
319 } 331 }
320 332
321 //////////////////////////////////////////////////////////////////////////// /////////////////// 333 //////////////////////////////////////////////////////////////////////////// ///////////////////
322 // End Implementation of ContentViewCore.InternalAccessDelega te // 334 // End Implementation of ContentViewCore.InternalAccessDelega te //
323 //////////////////////////////////////////////////////////////////////////// /////////////////// 335 //////////////////////////////////////////////////////////////////////////// ///////////////////
324 } 336 }
OLDNEW
« 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