diff options
author | Ben Murdoch <benm@google.com> | 2010-10-20 14:16:14 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-10-20 14:20:48 +0100 |
commit | f1b7fe47bddde1b9a0a1646dc2f1f78705169e05 (patch) | |
tree | 6b56ceadacd9f1867e076d3697f0eb2d5638b3b5 /WebKit/android/jni/WebSettings.cpp | |
parent | db17cf1782eab2488aab0933add6c79b21639c08 (diff) | |
download | external_webkit-f1b7fe47bddde1b9a0a1646dc2f1f78705169e05.zip external_webkit-f1b7fe47bddde1b9a0a1646dc2f1f78705169e05.tar.gz external_webkit-f1b7fe47bddde1b9a0a1646dc2f1f78705169e05.tar.bz2 |
Fix AutoFill after merge to Chromium merge to 7.0.540.0
Chromium now seems to enforce that profile unique ids cannot be
zero (as the default ctor leaves them). Read the correct id from
the Java WebSettings.AutoFillProfile class.
Requires a corresponding change in frameworks/base:
I88cd1e91b8c6043c732a1709a89fda4a3c9f921f.
Change-Id: I736220dccd8d68c395d6742e38a063da4140a13b
Diffstat (limited to 'WebKit/android/jni/WebSettings.cpp')
-rw-r--r-- | WebKit/android/jni/WebSettings.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp index 113a463..e3f59c3 100644 --- a/WebKit/android/jni/WebSettings.cpp +++ b/WebKit/android/jni/WebSettings.cpp @@ -129,6 +129,7 @@ struct FieldIds { mAutoFillEnabled = env->GetFieldID(clazz, "mAutoFillEnabled", "Z"); mAutoFillProfile = env->GetFieldID(clazz, "mAutoFillProfile", "Landroid/webkit/WebSettings$AutoFillProfile;"); jclass autoFillProfileClass = env->FindClass("android/webkit/WebSettings$AutoFillProfile"); + mAutoFillProfileUniqueId = env->GetFieldID(autoFillProfileClass, "mUniqueId", "I"); mAutoFillProfileFullName = env->GetFieldID(autoFillProfileClass, "mFullName", "Ljava/lang/String;"); mAutoFillProfileEmailAddress = env->GetFieldID(autoFillProfileClass, "mEmailAddress", "Ljava/lang/String;"); mAutoFillProfileCompanyName = env->GetFieldID(autoFillProfileClass, "mCompanyName", "Ljava/lang/String;"); @@ -249,6 +250,7 @@ struct FieldIds { #if ENABLE(WEB_AUTOFILL) jfieldID mAutoFillEnabled; jfieldID mAutoFillProfile; + jfieldID mAutoFillProfileUniqueId; jfieldID mAutoFillProfileFullName; jfieldID mAutoFillProfileEmailAddress; jfieldID mAutoFillProfileCompanyName; @@ -285,6 +287,7 @@ inline string16 getStringFieldAsString16(JNIEnv* env, jobject autoFillProfile, j void syncAutoFillProfile(JNIEnv* env, jobject autoFillProfile, WebAutoFill* webAutoFill) { + int id = env->GetIntField(autoFillProfile, gFieldIds->mAutoFillProfileUniqueId); string16 fullName = getStringFieldAsString16(env, autoFillProfile, gFieldIds->mAutoFillProfileFullName); string16 emailAddress = getStringFieldAsString16(env, autoFillProfile, gFieldIds->mAutoFillProfileEmailAddress); string16 companyName = getStringFieldAsString16(env, autoFillProfile, gFieldIds->mAutoFillProfileCompanyName); @@ -296,7 +299,7 @@ void syncAutoFillProfile(JNIEnv* env, jobject autoFillProfile, WebAutoFill* webA string16 country = getStringFieldAsString16(env, autoFillProfile, gFieldIds->mAutoFillProfileCountry); string16 phoneNumber = getStringFieldAsString16(env, autoFillProfile, gFieldIds->mAutoFillProfilePhoneNumber); - webAutoFill->setProfile(fullName, emailAddress, companyName, addressLine1, addressLine2, city, state, zipCode, country, phoneNumber); + webAutoFill->setProfile(id, fullName, emailAddress, companyName, addressLine1, addressLine2, city, state, zipCode, country, phoneNumber); } #endif |