Lines Matching refs:profile
60 void BindAutofillProfileToStatement(const AutofillProfile& profile,
62 DCHECK(guid::IsValidGUID(profile.guid()));
63 s->BindString(0, profile.guid());
65 string16 text = profile.GetInfo(COMPANY_NAME);
67 text = profile.GetInfo(ADDRESS_HOME_LINE1);
69 text = profile.GetInfo(ADDRESS_HOME_LINE2);
71 text = profile.GetInfo(ADDRESS_HOME_CITY);
73 text = profile.GetInfo(ADDRESS_HOME_STATE);
75 text = profile.GetInfo(ADDRESS_HOME_ZIP);
77 text = profile.GetInfo(ADDRESS_HOME_COUNTRY);
79 std::string country_code = profile.CountryCode();
85 AutofillProfile* profile = new AutofillProfile;
86 profile->set_guid(s.ColumnString(0));
87 DCHECK(guid::IsValidGUID(profile->guid()));
89 profile->SetInfo(COMPANY_NAME, s.ColumnString16(1));
90 profile->SetInfo(ADDRESS_HOME_LINE1, s.ColumnString16(2));
91 profile->SetInfo(ADDRESS_HOME_LINE2, s.ColumnString16(3));
92 profile->SetInfo(ADDRESS_HOME_CITY, s.ColumnString16(4));
93 profile->SetInfo(ADDRESS_HOME_STATE, s.ColumnString16(5));
94 profile->SetInfo(ADDRESS_HOME_ZIP, s.ColumnString16(6));
96 profile->SetCountryCode(s.ColumnString(8));
97 // Intentionally skip column 9, which stores the profile's modification date.
99 return profile;
147 AutofillProfile* profile) {
156 s.BindString(0, profile->guid());
162 DCHECK_EQ(profile->guid(), s.ColumnString(0));
167 profile->SetMultiInfo(NAME_FIRST, first_names);
168 profile->SetMultiInfo(NAME_MIDDLE, middle_names);
169 profile->SetMultiInfo(NAME_LAST, last_names);
174 AutofillProfile* profile) {
183 s.BindString(0, profile->guid());
187 DCHECK_EQ(profile->guid(), s.ColumnString(0));
190 profile->SetMultiInfo(EMAIL_ADDRESS, emails);
195 AutofillProfile* profile) {
204 s.BindString(0, profile->guid());
209 DCHECK_EQ(profile->guid(), s.ColumnString(0));
212 profile->SetMultiInfo(PHONE_HOME_WHOLE_NUMBER, numbers);
217 AutofillProfile* profile) {
226 s.BindString(0, profile->guid());
231 DCHECK_EQ(profile->guid(), s.ColumnString(0));
234 profile->SetMultiInfo(PHONE_FAX_WHOLE_NUMBER, numbers);
239 bool AddAutofillProfileNames(const AutofillProfile& profile,
242 profile.GetMultiInfo(NAME_FIRST, &first_names);
244 profile.GetMultiInfo(NAME_MIDDLE, &middle_names);
246 profile.GetMultiInfo(NAME_LAST, &last_names);
260 s.BindString(0, profile.guid());
273 bool AddAutofillProfileEmails(const AutofillProfile& profile,
276 profile.GetMultiInfo(EMAIL_ADDRESS, &emails);
288 s.BindString(0, profile.guid());
299 bool AddAutofillProfilePhones(const AutofillProfile& profile,
313 profile.GetMultiInfo(field_type, &numbers);
325 s.BindString(0, profile.guid());
337 bool AddAutofillProfilePieces(const AutofillProfile& profile,
339 if (!AddAutofillProfileNames(profile, db))
342 if (!AddAutofillProfileEmails(profile, db))
345 if (!AddAutofillProfilePhones(profile, kAutofillPhoneNumber, db))
348 if (!AddAutofillProfilePhones(profile, kAutofillFaxNumber, db))
888 bool AutofillTable::AddAutofillProfile(const AutofillProfile& profile) {
889 if (IsAutofillGUIDInTrash(profile.guid()))
902 BindAutofillProfileToStatement(profile, &s);
912 return AddAutofillProfilePieces(profile, db_);
916 AutofillProfile** profile) {
918 DCHECK(profile);
950 *profile = p.release();
969 AutofillProfile* profile = NULL;
970 if (!GetAutofillProfile(guid, &profile))
972 profiles->push_back(profile);
978 bool AutofillTable::UpdateAutofillProfile(const AutofillProfile& profile) {
979 DCHECK(guid::IsValidGUID(profile.guid()));
987 if (!GetAutofillProfile(profile.guid(), &tmp_profile))
992 if (old_profile->Compare(profile) == 0)
995 AutofillProfile new_profile(profile);
1017 bool AutofillTable::UpdateAutofillProfileMulti(const AutofillProfile& profile) {
1018 DCHECK(guid::IsValidGUID(profile.guid()));
1026 if (!GetAutofillProfile(profile.guid(), &tmp_profile))
1031 if (old_profile->CompareMulti(profile) == 0)
1045 BindAutofillProfileToStatement(profile, &s);
1046 s.BindString(10, profile.guid());
1053 if (!RemoveAutofillProfilePieces(profile.guid(), db_))
1056 return AddAutofillProfilePieces(profile, db_);
1553 // statements in this case! Profile corruption and data migration
1556 // The problem is that if a user has a profile which was created before
1558 // update this profile between the credit card addition and the addition
1560 // the user's profile in an incoherent state: The user will update from
1561 // a data profile set to be earlier than 22, and therefore pass through
1573 // profile will now see itself as being at version 22 -- but include a
1955 AutofillProfile profile;
1956 profile.set_guid(s.ColumnString(0));
1957 DCHECK(guid::IsValidGUID(profile.guid()));
1959 profile.SetInfo(NAME_FIRST, s.ColumnString16(1));
1960 profile.SetInfo(NAME_MIDDLE, s.ColumnString16(2));
1961 profile.SetInfo(NAME_LAST, s.ColumnString16(3));
1962 profile.SetInfo(EMAIL_ADDRESS, s.ColumnString16(4));
1963 profile.SetInfo(COMPANY_NAME, s.ColumnString16(5));
1964 profile.SetInfo(ADDRESS_HOME_LINE1, s.ColumnString16(6));
1965 profile.SetInfo(ADDRESS_HOME_LINE2, s.ColumnString16(7));
1966 profile.SetInfo(ADDRESS_HOME_CITY, s.ColumnString16(8));
1967 profile.SetInfo(ADDRESS_HOME_STATE, s.ColumnString16(9));
1968 profile.SetInfo(ADDRESS_HOME_ZIP, s.ColumnString16(10));
1969 profile.SetInfo(ADDRESS_HOME_COUNTRY, s.ColumnString16(11));
1970 profile.SetInfo(PHONE_HOME_WHOLE_NUMBER, s.ColumnString16(12));
1971 profile.SetInfo(PHONE_FAX_WHOLE_NUMBER, s.ColumnString16(13));
1982 s_insert.BindString(0, profile.guid());
1983 s_insert.BindString16(1, profile.GetInfo(COMPANY_NAME));
1984 s_insert.BindString16(2, profile.GetInfo(ADDRESS_HOME_LINE1));
1985 s_insert.BindString16(3, profile.GetInfo(ADDRESS_HOME_LINE2));
1986 s_insert.BindString16(4, profile.GetInfo(ADDRESS_HOME_CITY));
1987 s_insert.BindString16(5, profile.GetInfo(ADDRESS_HOME_STATE));
1988 s_insert.BindString16(6, profile.GetInfo(ADDRESS_HOME_ZIP));
1989 s_insert.BindString16(7, profile.GetInfo(ADDRESS_HOME_COUNTRY));
1996 if (!AddAutofillProfilePieces(profile, db_))
2105 AutofillProfile* profile = NULL;
2106 if (!GetAutofillProfile(guid, &profile))
2109 scoped_ptr<AutofillProfile> p(profile);
2125 // If the profile got merged trash the original.
2130 // An invalid profile, so trash it.