| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // This is opaque to the client. | 160 // This is opaque to the client. |
| 161 // status Server's status of this card. | 161 // status Server's status of this card. |
| 162 // TODO(brettw) define constants for this. | 162 // TODO(brettw) define constants for this. |
| 163 // name_on_card | 163 // name_on_card |
| 164 // type Type of the credit card. This is one of the | 164 // type Type of the credit card. This is one of the |
| 165 // kSyncCardType* strings. | 165 // kSyncCardType* strings. |
| 166 // last_four Last four digits of the card number. For de-duping | 166 // last_four Last four digits of the card number. For de-duping |
| 167 // with locally stored cards and generating descriptions. | 167 // with locally stored cards and generating descriptions. |
| 168 // exp_month Expiration month: 1-12 | 168 // exp_month Expiration month: 1-12 |
| 169 // exp_year Four-digit year: 2017 | 169 // exp_year Four-digit year: 2017 |
| 170 // billing_address_id The guid string that identifies the local profile which | 170 // billing_address_id The string that identifies the local or server profile |
| 171 // is the billing address for this card. Can be null in the | 171 // which is the billing address for this card. Can be null |
| 172 // database, but always returned as an empty string in | 172 // in the database, but always returned as an empty string |
| 173 // CreditCard. Added in version 67. | 173 // in CreditCard. Added in version 67. |
| 174 // | 174 // |
| 175 // unmasked_credit_cards | 175 // unmasked_credit_cards |
| 176 // When a masked credit credit card is unmasked and the | 176 // When a masked credit credit card is unmasked and the |
| 177 // full number is downloaded, it will be stored here. | 177 // full number is downloaded, it will be stored here. |
| 178 // | 178 // |
| 179 // id Server ID. This can be joined with the id in the | 179 // id Server ID. This can be joined with the id in the |
| 180 // masked_credit_cards table to get the rest of the data. | 180 // masked_credit_cards table to get the rest of the data. |
| 181 // card_number_encrypted | 181 // card_number_encrypted |
| 182 // Full card number, encrypted. | 182 // Full card number, encrypted. |
| 183 // use_count DEPRECATED in version 65. See server_card_metadata. | 183 // use_count DEPRECATED in version 65. See server_card_metadata. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 // of the profile to remove. | 332 // of the profile to remove. |
| 333 virtual bool RemoveAutofillProfile(const std::string& guid); | 333 virtual bool RemoveAutofillProfile(const std::string& guid); |
| 334 | 334 |
| 335 // Retrieves a profile with guid |guid|. | 335 // Retrieves a profile with guid |guid|. |
| 336 std::unique_ptr<AutofillProfile> GetAutofillProfile(const std::string& guid); | 336 std::unique_ptr<AutofillProfile> GetAutofillProfile(const std::string& guid); |
| 337 | 337 |
| 338 // Retrieves local/server profiles in the database. | 338 // Retrieves local/server profiles in the database. |
| 339 virtual bool GetAutofillProfiles( | 339 virtual bool GetAutofillProfiles( |
| 340 std::vector<std::unique_ptr<AutofillProfile>>* profiles); | 340 std::vector<std::unique_ptr<AutofillProfile>>* profiles); |
| 341 virtual bool GetServerProfiles( | 341 virtual bool GetServerProfiles( |
| 342 std::vector<std::unique_ptr<AutofillProfile>>* profiles); | 342 std::vector<std::unique_ptr<AutofillProfile>>* profiles) const; |
| 343 | 343 |
| 344 // Sets the server profiles. All old profiles are deleted and replaced with | 344 // Sets the server profiles. All old profiles are deleted and replaced with |
| 345 // the given ones. | 345 // the given ones. |
| 346 void SetServerProfiles(const std::vector<AutofillProfile>& profiles); | 346 void SetServerProfiles(const std::vector<AutofillProfile>& profiles); |
| 347 | 347 |
| 348 // Records a single credit card in the credit_cards table. | 348 // Records a single credit card in the credit_cards table. |
| 349 bool AddCreditCard(const CreditCard& credit_card); | 349 bool AddCreditCard(const CreditCard& credit_card); |
| 350 | 350 |
| 351 // Updates the database values for the specified credit card. | 351 // Updates the database values for the specified credit card. |
| 352 bool UpdateCreditCard(const CreditCard& credit_card); | 352 bool UpdateCreditCard(const CreditCard& credit_card); |
| 353 | 353 |
| 354 // Removes a row from the credit_cards table. |guid| is the identifier of the | 354 // Removes a row from the credit_cards table. |guid| is the identifier of the |
| 355 // credit card to remove. | 355 // credit card to remove. |
| 356 bool RemoveCreditCard(const std::string& guid); | 356 bool RemoveCreditCard(const std::string& guid); |
| 357 | 357 |
| 358 // Retrieves a credit card with guid |guid|. | 358 // Retrieves a credit card with guid |guid|. |
| 359 std::unique_ptr<CreditCard> GetCreditCard(const std::string& guid); | 359 std::unique_ptr<CreditCard> GetCreditCard(const std::string& guid); |
| 360 | 360 |
| 361 // Retrieves the local/server credit cards in the database. | 361 // Retrieves the local/server credit cards in the database. |
| 362 virtual bool GetCreditCards( | 362 virtual bool GetCreditCards( |
| 363 std::vector<std::unique_ptr<CreditCard>>* credit_cards); | 363 std::vector<std::unique_ptr<CreditCard>>* credit_cards); |
| 364 virtual bool GetServerCreditCards( | 364 virtual bool GetServerCreditCards( |
| 365 std::vector<std::unique_ptr<CreditCard>>* credit_cards); | 365 std::vector<std::unique_ptr<CreditCard>>* credit_cards) const; |
| 366 | 366 |
| 367 // Replaces all server credit cards with the given vector. Unmasked cards | 367 // Replaces all server credit cards with the given vector. Unmasked cards |
| 368 // present in the new list will be preserved (even if the input is MASKED). | 368 // present in the new list will be preserved (even if the input is MASKED). |
| 369 void SetServerCreditCards(const std::vector<CreditCard>& credit_cards); | 369 void SetServerCreditCards(const std::vector<CreditCard>& credit_cards); |
| 370 | 370 |
| 371 // Cards synced from the server may be "masked" (only last 4 digits | 371 // Cards synced from the server may be "masked" (only last 4 digits |
| 372 // available) or "unmasked" (everything is available). These functions set | 372 // available) or "unmasked" (everything is available). These functions set |
| 373 // that state. | 373 // that state. |
| 374 bool UnmaskServerCreditCard(const CreditCard& masked, | 374 bool UnmaskServerCreditCard(const CreditCard& masked, |
| 375 const base::string16& full_number); | 375 const base::string16& full_number); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 bool InitServerAddressMetadataTable(); | 546 bool InitServerAddressMetadataTable(); |
| 547 bool InitAutofillSyncMetadataTable(); | 547 bool InitAutofillSyncMetadataTable(); |
| 548 bool InitModelTypeStateTable(); | 548 bool InitModelTypeStateTable(); |
| 549 | 549 |
| 550 DISALLOW_COPY_AND_ASSIGN(AutofillTable); | 550 DISALLOW_COPY_AND_ASSIGN(AutofillTable); |
| 551 }; | 551 }; |
| 552 | 552 |
| 553 } // namespace autofill | 553 } // namespace autofill |
| 554 | 554 |
| 555 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 555 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| OLD | NEW |