Commit e2d2b8ec authored by jdduke's avatar jdduke Committed by Commit bot

aw: Keep selection handles when flinging

Currently, PopupWindow-based selection handles are hidden when scrolling
begins. However, WebView uses an entirely separate code path for flings,
about which PopupWindow knows nothing. Thus, the handles could
re-appear in the middle of a View-driven fling.

Expose whether such a fling is active via the ContentViewClient, making
such information available to the selection handle visibility logic.
This ensures the handles stay hidden for the duration of the fling.

Review URL: https://codereview.chromium.org/958673003

Cr-Commit-Position: refs/heads/master@{#318080}
parent 5fa486e2
...@@ -133,4 +133,9 @@ public class AwContentViewClient extends ContentViewClient implements ContentVid ...@@ -133,4 +133,9 @@ public class AwContentViewClient extends ContentViewClient implements ContentVid
public boolean isJavascriptEnabled() { public boolean isJavascriptEnabled() {
return mAwSettings != null && mAwSettings.getJavaScriptEnabled(); return mAwSettings != null && mAwSettings.getJavaScriptEnabled();
} }
@Override
public boolean isExternalFlingActive() {
return mAwContents.isFlingActive();
}
} }
...@@ -2250,7 +2250,7 @@ public class AwContents implements SmartClipProvider, ...@@ -2250,7 +2250,7 @@ public class AwContents implements SmartClipProvider,
} }
@CalledByNative @CalledByNative
private boolean isFlingActive() { public boolean isFlingActive() {
return mScrollOffsetManager.isFlingActive(); return mScrollOffsetManager.isFlingActive();
} }
......
...@@ -162,6 +162,14 @@ public class ContentViewClient { ...@@ -162,6 +162,14 @@ public class ContentViewClient {
return true; return true;
} }
/**
* @return Whether an externally managed (i.e., not compositor-driven) fling
* of this ContentView is active.
*/
public boolean isExternalFlingActive() {
return false;
}
/** /**
* Check whether a key should be propagated to the embedder or not. * Check whether a key should be propagated to the embedder or not.
* We need to send almost every key to Blink. However: * We need to send almost every key to Blink. However:
......
...@@ -1180,7 +1180,9 @@ public class ContentViewCore ...@@ -1180,7 +1180,9 @@ public class ContentViewCore
} }
public boolean isScrollInProgress() { public boolean isScrollInProgress() {
return mTouchScrollInProgress || mPotentiallyActiveFlingCount > 0; return mTouchScrollInProgress
|| mPotentiallyActiveFlingCount > 0
|| getContentViewClient().isExternalFlingActive();
} }
@SuppressWarnings("unused") @SuppressWarnings("unused")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment