diff options
author | Leon Scroggins <scroggo@google.com> | 2009-06-24 17:12:00 -0400 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2009-06-30 10:28:55 -0400 |
commit | 27f7f5ac11a4ac3d56176d6f9a8b238108dfab9d (patch) | |
tree | 2829be29c0c6bae2bbcb4815d61a88b1dcda65a8 /WebKit/android | |
parent | 24b57a61ed96705e09649fef8b88c35b048f528e (diff) | |
download | external_webkit-27f7f5ac11a4ac3d56176d6f9a8b238108dfab9d.zip external_webkit-27f7f5ac11a4ac3d56176d6f9a8b238108dfab9d.tar.gz external_webkit-27f7f5ac11a4ac3d56176d6f9a8b238108dfab9d.tar.bz2 |
Make the caret/selection draw when gaining window focus.
When the WebView loses WindowFocus, we stop drawing the
selection. We need to resume drawing it, especially for
the context menu, which steals WindowFocus. Corresponds
to a change in frameworks.
Diffstat (limited to 'WebKit/android')
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 10b34ad..dd81eab 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -1399,6 +1399,7 @@ void WebViewCore::setSelection(int start, int end) } rtc->setSelectionRange(start, end); focus->document()->frame()->revealSelection(); + setFocusControllerActive(true); } void WebViewCore::deleteSelection(int start, int end) @@ -1428,7 +1429,6 @@ void WebViewCore::replaceTextfieldText(int oldStart, WebCore::TypingCommand::insertText(focus->document(), replace, false); setSelection(start, end); - setFocusControllerActive(true); } void WebViewCore::passToJs(int generation, const WebCore::String& current, @@ -2098,15 +2098,15 @@ static void PassToJs(JNIEnv *env, jobject obj, PlatformKeyboardEvent(keyCode, keyValue, 0, down, cap, fn, sym)); } -static void SetFocusControllerInactive(JNIEnv *env, jobject obj) +static void SetFocusControllerActive(JNIEnv *env, jobject obj, jboolean active) { #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter); #endif - LOGV("webviewcore::nativeSetFocusControllerInactive()\n"); + LOGV("webviewcore::nativeSetFocusControllerActive()\n"); WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj); - LOG_ASSERT(viewImpl, "viewImpl not set in nativeSetFocusControllerInactive"); - viewImpl->setFocusControllerActive(false); + LOG_ASSERT(viewImpl, "viewImpl not set in nativeSetFocusControllerActive"); + viewImpl->setFocusControllerActive(active); } static void SaveDocumentState(JNIEnv *env, jobject obj, jint frame) @@ -2516,8 +2516,8 @@ static JNINativeMethod gJavaWebViewCoreMethods[] = { (void*) MoveMouseIfLatest }, { "passToJs", "(ILjava/lang/String;IIZZZZ)V", (void*) PassToJs } , - { "nativeSetFocusControllerInactive", "()V", - (void*) SetFocusControllerInactive }, + { "nativeSetFocusControllerActive", "(Z)V", + (void*) SetFocusControllerActive }, { "nativeSaveDocumentState", "(I)V", (void*) SaveDocumentState }, { "nativeFindAddress", "(Ljava/lang/String;Z)Ljava/lang/String;", |