summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni/WebViewCore.cpp
diff options
context:
space:
mode:
authorLeon Scroggins III <scroggo@google.com>2010-08-12 12:15:11 -0400
committerLeon Scroggins III <scroggo@google.com>2010-08-16 12:41:56 -0400
commitb5ad4377a34797bcff13da57e3b05587b8938353 (patch)
tree84a97ab5fe680760b4db7a9032f8af77cacd6530 /WebKit/android/jni/WebViewCore.cpp
parent96b9354838038389fdab0383662e91575e3daa6c (diff)
downloadexternal_webkit-b5ad4377a34797bcff13da57e3b05587b8938353.zip
external_webkit-b5ad4377a34797bcff13da57e3b05587b8938353.tar.gz
external_webkit-b5ad4377a34797bcff13da57e3b05587b8938353.tar.bz2
Move check to clear the text input to the webcore thread.
Originally written in response to bug 2835685, which was fixed in https://android-git.corp.google.com/g/#change,61059 WebViewCore.cpp: Send a message to clear the text input/remove the soft keyboard if the click results in no text input field being in focus. WebView.cpp: Remove the old checks to clear the WebTextView, which is now done in WebViewCore.cpp. This makes clearing it consistent with the checks for opening the WebTextView. Change-Id: I06ba7aadc95302c90af67da16edccd46896fcdbf
Diffstat (limited to 'WebKit/android/jni/WebViewCore.cpp')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 31c6120..6cd1280 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -2498,10 +2498,23 @@ bool WebViewCore::handleMouseClick(WebCore::Frame* framePtr, WebCore::Node* node
} else {
requestKeyboard(false);
}
- } else if (focusNode->isContentEditable()) {
- setFocusControllerActive(framePtr, true);
- requestKeyboard(true);
+ } else {
+ // If the focusNode is contentEditable, show the keyboard and enable
+ // the focus controller so the user can type. Otherwise hide the
+ // keyboard and disable the focus controller because no text input
+ // is needed.
+ bool keyboard = focusNode->isContentEditable();
+ setFocusControllerActive(framePtr, keyboard);
+ if (keyboard) {
+ requestKeyboard(true);
+ } else {
+ clearTextEntry();
+ }
}
+ } else {
+ // There is no focusNode, so the keyboard is not needed.
+ setFocusControllerActive(framePtr, false);
+ clearTextEntry();
}
return handled;
}