Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: components/autofill/core/browser/webdata/autofill_table.cc

Issue 2658843004: [Autofill] Convert wallet addresses to local autofill profiles. (Closed)
Patch Set: Change how to get server cards Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/webdata/autofill_table.cc
diff --git a/components/autofill/core/browser/webdata/autofill_table.cc b/components/autofill/core/browser/webdata/autofill_table.cc
index 3178f0a1fbfdb50cecf0d59dffc34b737863198a..bd342ffb0f509a76d59fa44d82a5e20657c2d81e 100644
--- a/components/autofill/core/browser/webdata/autofill_table.cc
+++ b/components/autofill/core/browser/webdata/autofill_table.cc
@@ -949,21 +949,22 @@ bool AutofillTable::GetServerProfiles(
sql::Statement s(db_->GetUniqueStatement(
"SELECT "
- "id,"
- "use_count,"
- "use_date,"
- "recipient_name,"
- "company_name,"
- "street_address,"
- "address_1," // ADDRESS_HOME_STATE
- "address_2," // ADDRESS_HOME_CITY
- "address_3," // ADDRESS_HOME_DEPENDENT_LOCALITY
- "address_4," // Not supported in AutofillProfile yet.
- "postal_code," // ADDRESS_HOME_ZIP
- "sorting_code," // ADDRESS_HOME_SORTING_CODE
- "country_code," // ADDRESS_HOME_COUNTRY
- "phone_number," // PHONE_HOME_WHOLE_NUMBER
- "language_code "
+ "id,"
+ "use_count,"
+ "use_date,"
+ "recipient_name,"
+ "company_name,"
+ "street_address,"
+ "address_1," // ADDRESS_HOME_STATE
+ "address_2," // ADDRESS_HOME_CITY
+ "address_3," // ADDRESS_HOME_DEPENDENT_LOCALITY
+ "address_4," // Not supported in AutofillProfile yet.
+ "postal_code," // ADDRESS_HOME_ZIP
+ "sorting_code," // ADDRESS_HOME_SORTING_CODE
+ "country_code," // ADDRESS_HOME_COUNTRY
+ "phone_number," // PHONE_HOME_WHOLE_NUMBER
+ "language_code, "
+ "has_converted "
"FROM server_addresses addresses "
"LEFT OUTER JOIN server_address_metadata USING (id)"));
@@ -991,6 +992,7 @@ bool AutofillTable::GetServerProfiles(
profile->SetRawInfo(ADDRESS_HOME_COUNTRY, s.ColumnString16(index++));
base::string16 phone_number = s.ColumnString16(index++);
profile->set_language_code(s.ColumnString(index++));
+ profile->set_has_converted(s.ColumnBool(index++));
// SetInfo instead of SetRawInfo so the constituent pieces will be parsed
// for these data types.
@@ -1054,6 +1056,9 @@ void AutofillTable::SetServerProfiles(
insert.Run();
insert.Reset(true);
+
+ // Save the use count and use date of the profile.
+ UpdateServerAddressMetadata(profile);
}
// Delete metadata that's no longer relevant.
@@ -1410,7 +1415,7 @@ bool AutofillTable::UpdateServerAddressMetadata(
"VALUES (?,?,?,?)"));
s.BindInt64(0, profile.use_count());
s.BindInt64(1, profile.use_date().ToInternalValue());
- s.BindBool(2, false);
+ s.BindBool(2, profile.has_converted());
s.BindString(3, profile.server_id());
s.Run();

Powered by Google App Engine
This is Rietveld 408576698