summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp7
-rw-r--r--WebKit/android/WebCoreSupport/autofill/WebAutoFill.h6
-rw-r--r--WebKit/android/jni/WebSettings.cpp5
3 files changed, 11 insertions, 7 deletions
diff --git a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
index 157a58a..ed42c7a 100644
--- a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
+++ b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp
@@ -162,11 +162,12 @@ bool WebAutoFill::enabled() const
return page ? page->settings()->autoFillEnabled() : false;
}
-void WebAutoFill::setProfile(const string16& fullName, const string16& emailAddress, const string16& companyName, const string16& addressLine1,
- const string16& addressLine2, const string16& city, const string16& state, const string16& zipCode,
- const string16& country, const string16& phoneNumber)
+void WebAutoFill::setProfile(int id, const string16& fullName, const string16& emailAddress, const string16& companyName,
+ const string16& addressLine1, const string16& addressLine2, const string16& city,
+ const string16& state, const string16& zipCode, const string16& country, const string16& phoneNumber)
{
AutoFillProfile autoFillProfile;
+ autoFillProfile.set_unique_id(id);
// Constants for AutoFill field types are found in external/chromium/chrome/browser/autofill/field_types.h.
autoFillProfile.SetInfo(AutoFillType(NAME_FULL), fullName);
diff --git a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h
index f5b2c68..46850e6 100644
--- a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h
+++ b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.h
@@ -63,9 +63,9 @@ public:
void setWebViewCore(WebViewCore* webViewCore) { mWebViewCore = webViewCore; }
bool enabled() const;
- void setProfile(const string16& fullName, const string16& emailAddress, const string16& companyName, const string16& addressLine1,
- const string16& addressLine2, const string16& city, const string16& state, const string16& zipCode,
- const string16& country, const string16& phoneNumber);
+ void setProfile(int id, const string16& fullName, const string16& emailAddress, const string16& companyName,
+ const string16& addressLine1, const string16& addressLine2, const string16& city,
+ const string16& state, const string16& zipCode, const string16& country, const string16& phoneNumber);
private:
OwnPtr<FormManager> mFormManager;
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