Commit 04d925bd authored by Shimi Zhang's avatar Shimi Zhang Committed by Commit Bot

AW: scheduleInvalidate() when native want the handles to show.

|PopupTouchHandleDrawable| is reacting to both native and Java for its
visibility. When WebView is moved under other window/view, Java side
will hide the handles and set their visiblity to |INVISIBLE|.

Previously, Java setOrigin() only do invalidation when the view is
visible, but if we do a selection and move the selection to under other
window, and then do another selection, the visiblity will be preserved,
so handles are not showing again. Native treated the second selection as
selection handles moved event, there is no need to update the visibility
from native's perspective.

We should scheduleInvalidate() when native thinks the handle should be
visible, scheduleInvalidate() will calculate the real visiblitiy against
the current view hierarchy and do invalidation if necessary.

Bug: 808701
Change-Id: I50dfa80d0299fd4692abba2c33b8a335bd455372
Reviewed-on: https://chromium-review.googlesource.com/1026834Reviewed-by: default avatarPedro Amaral <amaralp@chromium.org>
Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553789}
parent 4334c213
......@@ -588,7 +588,7 @@ public class PopupTouchHandleDrawable extends View implements DisplayAndroidObse
if (mOriginXDip == originXDip && mOriginYDip == originYDip && !mRotationChanged) return;
mOriginXDip = originXDip;
mOriginYDip = originYDip;
if (getVisibility() == VISIBLE || mRotationChanged) {
if (mVisible || mRotationChanged) {
if (mRotationChanged) mRotationChanged = false;
scheduleInvalidate();
}
......
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