From 96027bf9f9621433909777b481964fdbd9258f85 Mon Sep 17 00:00:00 2001 From: George Mount Date: Mon, 2 Apr 2012 10:26:02 -0700 Subject: Don't show keyboard on focus change. Bug 6270400 Framework Change: I2aa65b405b3a394b55821a4d688afeb22244c2c7 Change-Id: I1f06b7220e22665f5932928855c81eca6534bf2f --- Source/WebKit/android/jni/WebViewCore.cpp | 10 ++++++---- Source/WebKit/android/jni/WebViewCore.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'Source/WebKit/android') diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index da780cf..8f7efe2 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -3496,6 +3496,7 @@ void WebViewCore::initializeTextInput(WebCore::Node* node, bool fake) { if (node) { if (isTextInput(node)) { + bool showKeyboard = true; initEditField(node); WebCore::RenderTextControl* rtc = toRenderTextControl(node); if (rtc && node->hasTagName(HTMLNames::inputTag)) { @@ -3512,10 +3513,11 @@ void WebViewCore::initializeTextInput(WebCore::Node* node, bool fake) autoFill->formFieldFocused(inputElement); } #endif - } else if (!fake) { - requestKeyboard(false); - } + } else + showKeyboard = false; } + if (!fake) + requestKeyboard(showKeyboard); } else if (!fake && !nodeIsPlugin(node)) { // not a text entry field, put away the keyboard. clearTextEntry(); @@ -3533,7 +3535,7 @@ void WebViewCore::focusNodeChanged(WebCore::Node* newFocus) if (!javaObject.get()) return; if (isTextInput(newFocus)) - initializeTextInput(newFocus); + initializeTextInput(newFocus, true); HitTestResult focusHitResult; focusHitResult.setInnerNode(newFocus); focusHitResult.setInnerNonSharedNode(newFocus); diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h index efdf612..23568bb 100644 --- a/Source/WebKit/android/jni/WebViewCore.h +++ b/Source/WebKit/android/jni/WebViewCore.h @@ -695,7 +695,7 @@ namespace android { * it is a text input field then initEditField is called and * auto-fill information is requested for HTML form input fields. */ - void initializeTextInput(WebCore::Node* node, bool fake = false); + void initializeTextInput(WebCore::Node* node, bool fake); /** * Gets the input type a Node. NONE is returned if it isn't an -- cgit v1.1