From e60cb7f914acbfc7aca6cb9848b8247078d0b3ad Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Wed, 25 Aug 2010 14:56:00 -0400 Subject: [PATCH] simplify cursor ring draw state; fix null check Rename jni call to note that, when pressing the dpad, the cursor ring is to shown for a short time. The old name suggested that this was tracking whether the link was followed. Fix an unrelated change (from gingerbread, automated merge unlikely to succeed) to check for a null WebChromeClient. Requires a companion change in external/webkit http://b/2135321 (rename jni call) http://b/2945171 (null check) Change-Id: I9d4a92dbba1f92da8dc8cde755a2066de59514f9 --- core/java/android/webkit/WebView.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 5d9ab90ae004f..da9a3255584e7 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3355,7 +3355,8 @@ public class WebView extends AbsoluteLayout setUpSelect(); if (mNativeClass != 0 && nativeWordSelection(x, y)) { nativeSetExtendSelection(); - getWebChromeClient().onSelectionStart(this); + WebChromeClient client = getWebChromeClient(); + if (client != null) client.onSelectionStart(this); return true; } notifySelectDialogDismissed(); @@ -4088,7 +4089,7 @@ public class WebView extends AbsoluteLayout return true; } clearTextEntry(); - nativeSetFollowedLink(true); + nativeShowCursorTimed(); if (!mCallbackProxy.uiOverrideUrlLoading(nativeCursorText())) { mWebViewCore.sendMessage(EventHub.CLICK, data.mFrame, nativeCursorNodePointer()); @@ -4175,7 +4176,8 @@ public class WebView extends AbsoluteLayout */ public void selectionDone() { if (mSelectingText) { - getWebChromeClient().onSelectionDone(this); + WebChromeClient client = getWebChromeClient(); + if (client != null) client.onSelectionDone(this); invalidate(); // redraw without selection notifySelectDialogDismissed(); } @@ -7327,9 +7329,9 @@ public class WebView extends AbsoluteLayout private native void nativeSetExtendSelection(); private native void nativeSetFindIsEmpty(); private native void nativeSetFindIsUp(boolean isUp); - private native void nativeSetFollowedLink(boolean followed); private native void nativeSetHeightCanMeasure(boolean measure); private native void nativeSetBaseLayer(int layer); + private native void nativeShowCursorTimed(); private native void nativeReplaceBaseContent(int content); private native void nativeCopyBaseContentToPicture(Picture pict); private native boolean nativeHasContent();