From bc17d11c07d97392bb41b9d707726bec5c8cb64d Mon Sep 17 00:00:00 2001 From: George Mount Date: Wed, 20 Jun 2012 16:22:50 -0700 Subject: Remove updateTextfield for changing passwords. The UI no longer needs to know about password field changes as it is not required like it was with the removed WebTextView. Change-Id: I16a6bb44c31c83c5c3e9cb70f2bc865d5eb2732c --- Source/WebCore/html/HTMLInputElement.cpp | 6 +----- Source/WebCore/html/HTMLTextAreaElement.cpp | 2 +- Source/WebCore/platform/android/PlatformBridge.h | 2 +- Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp | 4 ++-- Source/WebKit/android/jni/WebViewCore.cpp | 15 ++++----------- Source/WebKit/android/jni/WebViewCore.h | 8 ++------ 6 files changed, 11 insertions(+), 26 deletions(-) diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp index 36cdf51..4ede2a8 100644 --- a/Source/WebCore/html/HTMLInputElement.cpp +++ b/Source/WebCore/html/HTMLInputElement.cpp @@ -444,10 +444,6 @@ void HTMLInputElement::setType(const String& type) void HTMLInputElement::updateType() { OwnPtr newType = InputType::create(this, fastGetAttribute(typeAttr)); -#ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS - if (newType->isPasswordField() && document()->focusedNode() == this) - PlatformBridge::updateTextfield(document()->view(), this, true, String()); -#endif bool hadType = m_hasType; m_hasType = true; if (m_inputType->formControlType() == newType->formControlType()) @@ -912,7 +908,7 @@ void HTMLInputElement::setValue(const String& value, bool sendChangeEvent) unsigned max = m_data.value().length(); #ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS // Make sure our UI side textfield changes to match the RenderTextControl - PlatformBridge::updateTextfield(document()->view(), this, false, value); + PlatformBridge::updateTextfield(document()->view(), this, value); #endif if (document()->focusedNode() == this) InputElement::updateSelectionRange(this, this, max, max); diff --git a/Source/WebCore/html/HTMLTextAreaElement.cpp b/Source/WebCore/html/HTMLTextAreaElement.cpp index 5b12a14..50471d1 100644 --- a/Source/WebCore/html/HTMLTextAreaElement.cpp +++ b/Source/WebCore/html/HTMLTextAreaElement.cpp @@ -329,7 +329,7 @@ void HTMLTextAreaElement::setValueCommon(const String& value) if (document()->focusedNode() == this) { #ifdef ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS // Make sure our UI side textfield changes to match the RenderTextControl - PlatformBridge::updateTextfield(document()->view(), this, false, value); + PlatformBridge::updateTextfield(document()->view(), this, value); #endif unsigned endOfString = m_value.length(); setSelectionRange(endOfString, endOfString); diff --git a/Source/WebCore/platform/android/PlatformBridge.h b/Source/WebCore/platform/android/PlatformBridge.h index e48e50c..5af5d2d 100644 --- a/Source/WebCore/platform/android/PlatformBridge.h +++ b/Source/WebCore/platform/android/PlatformBridge.h @@ -132,7 +132,7 @@ public: // Update the viewport meta data. static void updateViewport(FrameView*); - static void updateTextfield(FrameView*, Node*, bool changeToPassword, const WTF::String& text); + static void updateTextfield(FrameView*, Node*, const WTF::String& text); static void setScrollPosition(ScrollView*, int x, int y); diff --git a/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp b/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp index 56e7e24..864b27d 100644 --- a/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp +++ b/Source/WebKit/android/WebCoreSupport/PlatformBridge.cpp @@ -164,10 +164,10 @@ void PlatformBridge::updateViewport(FrameView* frameView) webViewCore->updateViewport(); } -void PlatformBridge::updateTextfield(FrameView* frameView, Node* nodePtr, bool changeToPassword, const WTF::String& text) +void PlatformBridge::updateTextfield(FrameView* frameView, Node* nodePtr, const WTF::String& text) { android::WebViewCore* webViewCore = android::WebViewCore::getWebViewCore(frameView); - webViewCore->updateTextfield(nodePtr, changeToPassword, text); + webViewCore->updateTextfield(nodePtr, text); } void PlatformBridge::setScrollPosition(ScrollView* scrollView, int x, int y) { diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index b0317c06..954a361 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -470,7 +470,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m m_javaGlue->m_updateViewport = GetJMethod(env, clazz, "updateViewport", "()V"); m_javaGlue->m_sendNotifyProgressFinished = GetJMethod(env, clazz, "sendNotifyProgressFinished", "()V"); m_javaGlue->m_sendViewInvalidate = GetJMethod(env, clazz, "sendViewInvalidate", "(IIII)V"); - m_javaGlue->m_updateTextfield = GetJMethod(env, clazz, "updateTextfield", "(IZLjava/lang/String;I)V"); + m_javaGlue->m_updateTextfield = GetJMethod(env, clazz, "updateTextfield", "(ILjava/lang/String;I)V"); m_javaGlue->m_updateTextSelection = GetJMethod(env, clazz, "updateTextSelection", "(IIIII)V"); m_javaGlue->m_updateTextSizeAndScroll = GetJMethod(env, clazz, "updateTextSizeAndScroll", "(IIIII)V"); m_javaGlue->m_clearTextEntry = GetJMethod(env, clazz, "clearTextEntry", "()V"); @@ -2991,7 +2991,7 @@ void WebViewCore::passToJs(int generation, const WTF::String& current, WTF::String test = getInputText(focus); if (test != current) { // If the text changed during the key event, update the UI text field. - updateTextfield(focus, false, test); + updateTextfield(focus, test); } // Now that the selection has settled down, send it. updateTextSelection(); @@ -3894,8 +3894,7 @@ void WebViewCore::updateTextSizeAndScroll(WebCore::Node* node) checkException(env); } -void WebViewCore::updateTextfield(WebCore::Node* ptr, bool changeToPassword, - const WTF::String& text) +void WebViewCore::updateTextfield(WebCore::Node* ptr, const WTF::String& text) { JNIEnv* env = JSC::Bindings::getJNIEnv(); AutoJObject javaObject = m_javaGlue->object(env); @@ -3903,15 +3902,9 @@ void WebViewCore::updateTextfield(WebCore::Node* ptr, bool changeToPassword, return; if (m_blockTextfieldUpdates) return; - if (changeToPassword) { - env->CallVoidMethod(javaObject.get(), m_javaGlue->m_updateTextfield, - (int) ptr, true, 0, m_textGeneration); - checkException(env); - return; - } jstring string = wtfStringToJstring(env, text); env->CallVoidMethod(javaObject.get(), m_javaGlue->m_updateTextfield, - (int) ptr, false, string, m_textGeneration); + (int) ptr, string, m_textGeneration); env->DeleteLocalRef(string); checkException(env); } diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h index def09d7..9d07e5f 100644 --- a/Source/WebKit/android/jni/WebViewCore.h +++ b/Source/WebKit/android/jni/WebViewCore.h @@ -202,13 +202,9 @@ namespace android { /** * Tell the java side to update the focused textfield * @param pointer Pointer to the node for the input field. - * @param changeToPassword If true, we are changing the textfield to - * a password field, and ignore the WTF::String - * @param text If changeToPassword is false, this is the new text that - * should go into the textfield. + * @param text This is the new text that should go into the textfield. */ - void updateTextfield(WebCore::Node* pointer, - bool changeToPassword, const WTF::String& text); + void updateTextfield(WebCore::Node* pointer, const WTF::String& text); /** * Tell the java side to update the current selection in the focused -- cgit v1.1