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

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

Issue 2939783002: Fixing mouse focus on WebView (Closed)
Patch Set: Created 3 years, 6 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: 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 8bf444f5ed53e72ca43ced352770cbbd734ce447..ba32dfeae36703d55571bed05091aa5286b9933f 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
@@ -861,10 +861,21 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa
if (type == GestureEventType.LONG_PRESS && offerLongPressToEmbedder()) {
return true;
}
- updateForTapOrPress(type, x, y);
+
+ if (!mPopupZoomer.isShowing()) mPopupZoomer.setLastTouch(x, y);
+
return false;
}
+ @SuppressWarnings("unused")
+ @CalledByNative
+ private void requestFocus() {
+ if (mContainerView.isFocusable() && mContainerView.isFocusableInTouchMode()
+ && !mContainerView.isFocused()) {
+ mContainerView.requestFocus();
+ }
+ }
+
@VisibleForTesting
public void sendDoubleTapForTest(long timeMs, int x, int y) {
if (mNativeContentViewCore == 0) return;
@@ -1439,22 +1450,6 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Displa
}
}
- private void updateForTapOrPress(int type, float xPix, float yPix) {
- if (type != GestureEventType.SINGLE_TAP_CONFIRMED
- && type != GestureEventType.SINGLE_TAP_UP
- && type != GestureEventType.LONG_PRESS
- && type != GestureEventType.LONG_TAP) {
- return;
- }
-
- if (mContainerView.isFocusable() && mContainerView.isFocusableInTouchMode()
- && !mContainerView.isFocused()) {
- mContainerView.requestFocus();
- }
-
- if (!mPopupZoomer.isShowing()) mPopupZoomer.setLastTouch(xPix, yPix);
- }
-
public void updateMultiTouchZoomSupport(boolean supportsMultiTouchZoom) {
if (mNativeContentViewCore == 0) return;
nativeSetMultiTouchZoomSupportEnabled(mNativeContentViewCore, supportsMultiTouchZoom);

Powered by Google App Engine
This is Rietveld 408576698