summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/personal_data_manager_mac.mm
diff options
context:
space:
mode:
authordhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-22 21:35:45 +0000
committerdhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-22 21:35:45 +0000
commitf6798320c6e4c14b7bb14b15fd7f1587e07d1e51 (patch)
tree6d277ee2f63582d14efc701ba2483848028d5fea /chrome/browser/autofill/personal_data_manager_mac.mm
parent6a9210a9f8e6416ac2b6f016ce9465ce0e8479c5 (diff)
downloadchromium_src-f6798320c6e4c14b7bb14b15fd7f1587e07d1e51.zip
chromium_src-f6798320c6e4c14b7bb14b15fd7f1587e07d1e51.tar.gz
chromium_src-f6798320c6e4c14b7bb14b15fd7f1587e07d1e51.tar.bz2
AutoFill Mac fails to fill Address Book card data
Changes the Mac implementation of auxiliary profile retrieval (Address Book data) to properly manage unique ids assigned to profiles originating from the Address Book. BUG=49657 TEST=PersonalDataManagerTest.*, and manual steps of (1) load a fillable HTML form, (2) click fillable field, (3) pick profile originating from Address Book, (4) observe that it fills the form. Review URL: http://codereview.chromium.org/3055011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53390 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/personal_data_manager_mac.mm')
-rw-r--r--chrome/browser/autofill/personal_data_manager_mac.mm22
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/autofill/personal_data_manager_mac.mm b/chrome/browser/autofill/personal_data_manager_mac.mm
index ff199af..b2bf60d 100644
--- a/chrome/browser/autofill/personal_data_manager_mac.mm
+++ b/chrome/browser/autofill/personal_data_manager_mac.mm
@@ -250,6 +250,28 @@ void AuxiliaryProfilesImpl::GetAddressBookPhoneNumbers(
// Populate |auxiliary_profiles_| with the Address Book data.
void PersonalDataManager::LoadAuxiliaryProfiles() {
+ AutoLock lock(unique_ids_lock_);
+
+ // Before loading new auxiliary profiles remove the unique ids from the
+ // id pools. The |GetAddressBookMeCard()| call below clears the
+ // |auxiliary_profiles_|.
+ unique_auxiliary_profile_ids_.clear();
+ for (ScopedVector<AutoFillProfile>::iterator iter
+ = auxiliary_profiles_.begin();
+ iter != auxiliary_profiles_.end(); ++iter) {
+ if ((*iter)->unique_id() != 0) {
+ unique_ids_.erase((*iter)->unique_id());
+ }
+ }
+
AuxiliaryProfilesImpl impl(&auxiliary_profiles_);
impl.GetAddressBookMeCard();
+
+ // For newly fetched auxiliary profiles, ensure that we have unique ids set.
+ for (ScopedVector<AutoFillProfile>::iterator iter
+ = auxiliary_profiles_.begin();
+ iter != auxiliary_profiles_.end(); ++iter) {
+ (*iter)->set_unique_id(
+ CreateNextUniqueIDFor(&unique_auxiliary_profile_ids_));
+ }
}