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

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

Issue 660663002: Clear pending events upon main frame navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates Created 6 years, 1 month 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 6e4155c04220df4d79f2c0df59e0f90ec7f46bab..db0e9556769580d5375b6489e467ef4c1f0b59a2 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
@@ -718,8 +718,8 @@ public class ContentViewCore
boolean isNavigationToDifferentPage, boolean isFragmentNavigation) {
if (!isNavigationToDifferentPage) return;
hidePopupsAndClearSelection();
+ if (mNativeContentViewCore != 0) nativeResetPendingInput(mNativeContentViewCore);
resetScrollInProgress();
- resetGestureDetection();
}
@Override
@@ -1107,10 +1107,6 @@ public class ContentViewCore
|| eventAction == MotionEvent.ACTION_POINTER_UP;
}
- public void setIgnoreRemainingTouchEvents() {
- resetGestureDetection();
- }
-
public boolean isScrollInProgress() {
return mTouchScrollInProgress || mPotentiallyActiveFlingCount > 0;
}
@@ -1349,11 +1345,6 @@ public class ContentViewCore
return mActionMode != null;
}
- private void resetGestureDetection() {
- if (mNativeContentViewCore == 0) return;
- nativeResetGestureDetection(mNativeContentViewCore);
- }
-
/**
* @see View#onAttachedToWindow()
*/
@@ -1507,7 +1498,10 @@ public class ContentViewCore
* @see View#onWindowFocusChanged(boolean)
*/
public void onWindowFocusChanged(boolean hasWindowFocus) {
- if (!hasWindowFocus) resetGestureDetection();
+ if (!hasWindowFocus) {
+ if (mNativeContentViewCore == 0) return;
+ nativeCancelActiveTouchSequence(mNativeContentViewCore);
+ }
}
public void onFocusChanged(boolean gainFocus) {
@@ -3000,7 +2994,9 @@ public class ContentViewCore
private native void nativeHideTextHandles(long nativeContentViewCoreImpl);
- private native void nativeResetGestureDetection(long nativeContentViewCoreImpl);
+ private native void nativeCancelActiveTouchSequence(long nativeContentViewCoreImpl);
+
+ private native void nativeResetPendingInput(long nativeContentViewCoreImpl);
private native void nativeSetDoubleTapSupportEnabled(
long nativeContentViewCoreImpl, boolean enabled);
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_base.cc ('k') | content/public/test/test_renderer_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698