} 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;
}
struct JavaGlue {
jweak m_obj;
jmethodID m_calcOurContentVisibleRectF;
- jmethodID m_clearTextEntry;
jmethodID m_overrideLoading;
jmethodID m_scrollBy;
jmethodID m_sendMoveFocus;
m_javaGlue.m_obj = env->NewWeakGlobalRef(javaWebView);
m_javaGlue.m_scrollBy = GetJMethod(env, clazz, "setContentScrollBy", "(IIZ)Z");
m_javaGlue.m_calcOurContentVisibleRectF = GetJMethod(env, clazz, "calcOurContentVisibleRectF", "(Landroid/graphics/RectF;)V");
- m_javaGlue.m_clearTextEntry = GetJMethod(env, clazz, "clearTextEntry", "(Z)V");
m_javaGlue.m_overrideLoading = GetJMethod(env, clazz, "overrideLoading", "(Ljava/lang/String;)V");
m_javaGlue.m_sendMoveFocus = GetJMethod(env, clazz, "sendMoveFocus", "(II)V");
m_javaGlue.m_sendMoveMouse = GetJMethod(env, clazz, "sendMoveMouse", "(IIII)V");
viewInvalidate();
}
-void clearTextEntry()
-{
- DEBUG_NAV_UI_LOGD("%s", __FUNCTION__);
- JNIEnv* env = JSC::Bindings::getJNIEnv();
- env->CallVoidMethod(m_javaGlue.object(env).get(),
- m_javaGlue.m_clearTextEntry, true);
- checkException(env);
-}
-
#if DUMP_NAV_CACHE
void debugDump()
{
sendMotionUp(frame ? (WebCore::Frame*) frame->framePointer() : 0,
0, x, y);
viewInvalidate();
- clearTextEntry();
return pageScrolled;
}
DBG_NAV_LOGD("CachedNode:%p (%d) x=%d y=%d rx=%d ry=%d", result,
}
viewInvalidate();
if (!result->isTextInput()) {
- clearTextEntry();
if (!result->isSelect() && !result->isContentEditable())
setFollowedLink(true);
if (syntheticLink)