Chromium Code Reviews| Index: components/autofill/core/browser/webdata/autofill_table.h |
| diff --git a/components/autofill/core/browser/webdata/autofill_table.h b/components/autofill/core/browser/webdata/autofill_table.h |
| index 872d127b393bade1cd3d96b71c364c3b8a18dc64..54e3103d6644f0f7675492dd8a4682c6e14fb704 100644 |
| --- a/components/autofill/core/browser/webdata/autofill_table.h |
| +++ b/components/autofill/core/browser/webdata/autofill_table.h |
| @@ -149,7 +149,8 @@ struct FormFieldData; |
| // This table contains "masked" credit card information |
| // about credit cards stored on the server. It consists |
| // of a short description and an ID, but not full payment |
| -// information. Writing to this table is only done by sync. |
| +// information. Writing to this table is done by sync and |
| +// on successful save of card to the server. |
| // When a server card is unmasked, it will stay here and |
| // will additionally be added in unmasked_credit_cards. |
| // |
| @@ -167,7 +168,9 @@ struct FormFieldData; |
| // |
| // unmasked_credit_cards |
| // When a masked credit credit card is unmasked and the |
| -// full number is downloaded, it will be stored here. |
| +// full number is downloaded or when the full number is |
| +// available on saving card to serevr, it will be stored |
|
Jared Saul
2017/04/21 23:29:10
s/serevr/server
(nit: s/on/upon)
csashi
2017/04/21 23:39:50
Done.
|
| +// here. |
| // |
| // id Server ID. This can be joined with the id in the |
| // masked_credit_cards table to get the rest of the data. |
| @@ -356,6 +359,9 @@ class AutofillTable : public WebDatabaseTable { |
| // credit card to remove. |
| bool RemoveCreditCard(const std::string& guid); |
| + // Adds to the masked_credit_cards and unmasked_credit_cards table. |
|
Jared Saul
2017/04/21 23:29:10
nit: s/table/tables
csashi
2017/04/21 23:39:50
Done.
|
| + bool AddServerCreditCard(const CreditCard& credit_card); |
| + |
| // Retrieves a credit card with guid |guid|. |
| std::unique_ptr<CreditCard> GetCreditCard(const std::string& guid); |
| @@ -531,6 +537,17 @@ class AutofillTable : public WebDatabaseTable { |
| // Checks if the guid is in the trash. |
| bool IsAutofillGUIDInTrash(const std::string& guid); |
| + // Adds to |masked_credit_cards| and updates |server_card_metadata|. |
| + void AddMaskedCreditCards(const std::vector<CreditCard>& credit_cards); |
| + |
| + // Adds to |unmasked_credit_cards|. |
| + void AddUnmaskedCreditCard(const std::string& id, |
| + const base::string16& full_number); |
| + |
| + // Deletes server credit cards by |id|. Returns true if a row was deleted. |
| + bool DeleteFromMaskedCreditCards(const std::string& id); |
| + bool DeleteFromUnmaskedCreditCards(const std::string& id); |
| + |
| bool InitMainTable(); |
| bool InitCreditCardsTable(); |
| bool InitDatesTable(); |