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

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

Issue 2826303003: Let selection events bypass ContentViewCore (Closed)
Patch Set: comments Created 3 years, 8 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 68d484b08d3fa8644d8b3d7f837068f86a9549ff..280a342eb2aafcdfccbb3c1f69d780036e7126a8 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
@@ -834,6 +834,7 @@ public class ContentViewCore
private void onFlingStartEventConsumed() {
mPotentiallyActiveFlingCount++;
setTouchScrollInProgress(false);
+ mSelectionPopupController.setScrollInProgress(true);
for (mGestureStateListenersIterator.rewind();
mGestureStateListenersIterator.hasNext();) {
mGestureStateListenersIterator.next().onFlingStartGesture(
@@ -851,6 +852,7 @@ public class ContentViewCore
@CalledByNative
private void onScrollBeginEventAck() {
setTouchScrollInProgress(true);
+ mSelectionPopupController.setScrollInProgress(true);
updateGestureStateListener(GestureEventType.SCROLL_START);
}
@@ -868,6 +870,7 @@ public class ContentViewCore
@CalledByNative
private void onScrollEndEventAck() {
setTouchScrollInProgress(false);
+ mSelectionPopupController.setScrollInProgress(isScrollInProgress());
boliu 2017/04/20 23:16:49 put this inside setTouchScrollInProgress
Jinsuk Kim 2017/04/20 23:49:05 Done. Removed the others as they will be handled i
updateGestureStateListener(GestureEventType.SCROLL_END);
}
@@ -1584,13 +1587,6 @@ public class ContentViewCore
mPreserveSelectionOnNextLossOfFocus = true;
}
- @CalledByNative
- private void onSelectionEvent(
- int eventType, int xAnchor, int yAnchor, int left, int top, int right, int bottom) {
- mSelectionPopupController.onSelectionEvent(eventType, xAnchor, yAnchor,
- left, top, right, bottom, isScrollInProgress(), mTouchScrollInProgress);
- }
-
private void setTextHandlesTemporarilyHidden(boolean hide) {
if (mNativeContentViewCore == 0) return;
nativeSetTextHandlesTemporarilyHidden(mNativeContentViewCore, hide);
@@ -1772,12 +1768,6 @@ public class ContentViewCore
@SuppressWarnings("unused")
@CalledByNative
- private void onSelectionChanged(String text) {
- mSelectionPopupController.onSelectionChanged(text);
- }
-
- @SuppressWarnings("unused")
- @CalledByNative
private void performLongPressHapticFeedback() {
mContainerView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
}
@@ -2353,6 +2343,7 @@ public class ContentViewCore
setTouchScrollInProgress(false);
mPotentiallyActiveFlingCount = 0;
+ mSelectionPopupController.setScrollInProgress(false);
if (touchScrollInProgress) updateGestureStateListener(GestureEventType.SCROLL_END);
if (potentiallyActiveFlingCount > 0) updateGestureStateListener(GestureEventType.FLING_END);
}
@@ -2362,7 +2353,9 @@ public class ContentViewCore
// Note that mTouchScrollInProgress should normally be false at this
// point, but we reset it anyway as another failsafe.
setTouchScrollInProgress(false);
- if (mPotentiallyActiveFlingCount <= 0) return;
+ boolean flinging = mPotentiallyActiveFlingCount > 0;
+ mSelectionPopupController.setScrollInProgress(flinging);
boliu 2017/04/20 23:16:49 this makes no sense to me. what if mPotentiallyAct
Jinsuk Kim 2017/04/20 23:49:06 Bummer... fixed. Moved down setTouchScrollInProgr
+ if (!flinging) return;
mPotentiallyActiveFlingCount--;
updateGestureStateListener(GestureEventType.FLING_END);
}

Powered by Google App Engine
This is Rietveld 408576698