diff options
author | Ben Murdoch <benm@google.com> | 2010-11-18 19:56:26 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-11-22 10:12:28 +0000 |
commit | 773b60fc73d12638ccaf718eeec88ec891c015a8 (patch) | |
tree | 325ae18ee405b2b0d8cc0cbb9fb3e97766afeb36 /WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp | |
parent | dd60d15092d3abe1e3a47faa87386d6e9ea96c30 (diff) | |
download | external_webkit-773b60fc73d12638ccaf718eeec88ec891c015a8.zip external_webkit-773b60fc73d12638ccaf718eeec88ec891c015a8.tar.gz external_webkit-773b60fc73d12638ccaf718eeec88ec891c015a8.tar.bz2 |
Merge Chromium at r65505: Update use of AutoFillProfile.
With this new Chromium merge, unique profile ids have been
deprecated and profile previews are obtained through the
Label function rather that PreviewSummary.
WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp:
WebKit/android/jni/WebSettings.cpp:
WebKit/android/WebCoreSupport/autofill/WebAutoFill.h:
http://src.chromium.org/viewvc/chrome?view=rev&revision=63806
http://src.chromium.org/viewvc/chrome?view=rev&revision=65100
Change-Id: I8af86c8be8627e17b13edf66349d9df8f85638a1
Diffstat (limited to 'WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp')
-rw-r--r-- | WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp index f258f2f..8bb34e3 100644 --- a/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp +++ b/WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp @@ -138,7 +138,7 @@ void WebAutoFill::querySuccessful(int queryId, const string16& value, const stri mUniqueIdMap[queryId] = uniqueId; ASSERT(mWebViewCore); - mWebViewCore->setWebTextViewAutoFillable(queryId, mAutoFillProfile->PreviewSummary()); + mWebViewCore->setWebTextViewAutoFillable(queryId, mAutoFillProfile->Label()); } void WebAutoFill::fillFormFields(int queryId) @@ -172,12 +172,11 @@ bool WebAutoFill::enabled() const return page ? page->settings()->autoFillEnabled() : false; } -void WebAutoFill::setProfile(int id, const string16& fullName, const string16& emailAddress, const string16& companyName, +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) { mAutoFillProfile.set(new AutoFillProfile()); - mAutoFillProfile->set_unique_id(id); // Constants for AutoFill field types are found in external/chromium/chrome/browser/autofill/field_types.h. mAutoFillProfile->SetInfo(AutoFillType(NAME_FULL), fullName); @@ -193,20 +192,26 @@ void WebAutoFill::setProfile(int id, const string16& fullName, const string16& e std::vector<AutoFillProfile> profiles; profiles.push_back(*mAutoFillProfile); + updateProfileLabel(); mTabContents->profile()->GetPersonalDataManager()->SetProfiles(&profiles); } +bool WebAutoFill::updateProfileLabel() +{ + std::vector<AutoFillProfile*> profiles; + profiles.push_back(mAutoFillProfile.get()); + return AutoFillProfile::AdjustInferredLabels(&profiles); +} + void WebAutoFill::clearProfiles() { if (!mAutoFillProfile) return; // For now Chromium only ever knows about one profile, so we can just - // remove it by unique id. If we support multiple profiles in the future + // remove it. If we support multiple profiles in the future // we need to remove them all here. - int uniqueProfileId = mAutoFillProfile->unique_id(); - if (uniqueProfileId != NO_PROFILE_SET) - mTabContents->profile()->GetPersonalDataManager()->RemoveProfile(uniqueProfileId); - mAutoFillProfile.set(0); + std::string profileGuid = mAutoFillProfile->guid(); + mTabContents->profile()->GetPersonalDataManager()->RemoveProfile(profileGuid); } } |