| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // This is opaque to the client. | 154 // This is opaque to the client. |
| 155 // status Server's status of this card. | 155 // status Server's status of this card. |
| 156 // TODO(brettw) define constants for this. | 156 // TODO(brettw) define constants for this. |
| 157 // name_on_card | 157 // name_on_card |
| 158 // type Type of the credit card. This is one of the | 158 // type Type of the credit card. This is one of the |
| 159 // kSyncCardType* strings. | 159 // kSyncCardType* strings. |
| 160 // last_four Last four digits of the card number. For de-duping | 160 // last_four Last four digits of the card number. For de-duping |
| 161 // with locally stored cards and generating descriptions. | 161 // with locally stored cards and generating descriptions. |
| 162 // exp_month Expiration month: 1-12 | 162 // exp_month Expiration month: 1-12 |
| 163 // exp_year Four-digit year: 2017 | 163 // exp_year Four-digit year: 2017 |
| 164 // billing_address_id The guid string that identifies the local profile which |
| 165 // is the billing address for this card. Can be null in the |
| 166 // database, but always returned as an empty string in |
| 167 // CreditCard. Added in version 67. |
| 164 // | 168 // |
| 165 // unmasked_credit_cards | 169 // unmasked_credit_cards |
| 166 // When a masked credit credit card is unmasked and the | 170 // When a masked credit credit card is unmasked and the |
| 167 // full number is downloaded, it will be stored here. | 171 // full number is downloaded, it will be stored here. |
| 168 // | 172 // |
| 169 // id Server ID. This can be joined with the id in the | 173 // id Server ID. This can be joined with the id in the |
| 170 // masked_credit_cards table to get the rest of the data. | 174 // masked_credit_cards table to get the rest of the data. |
| 171 // card_number_encrypted | 175 // card_number_encrypted |
| 172 // Full card number, encrypted. | 176 // Full card number, encrypted. |
| 173 // use_count DEPRECATED in version 65. See server_card_metadata. | 177 // use_count DEPRECATED in version 65. See server_card_metadata. |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 // Cards synced from the server may be "masked" (only last 4 digits | 353 // Cards synced from the server may be "masked" (only last 4 digits |
| 350 // available) or "unmasked" (everything is available). These functions set | 354 // available) or "unmasked" (everything is available). These functions set |
| 351 // that state. | 355 // that state. |
| 352 bool UnmaskServerCreditCard(const CreditCard& masked, | 356 bool UnmaskServerCreditCard(const CreditCard& masked, |
| 353 const base::string16& full_number); | 357 const base::string16& full_number); |
| 354 bool MaskServerCreditCard(const std::string& id); | 358 bool MaskServerCreditCard(const std::string& id); |
| 355 | 359 |
| 356 bool UpdateServerCardUsageStats(const CreditCard& credit_card); | 360 bool UpdateServerCardUsageStats(const CreditCard& credit_card); |
| 357 bool UpdateServerAddressUsageStats(const AutofillProfile& profile); | 361 bool UpdateServerAddressUsageStats(const AutofillProfile& profile); |
| 358 | 362 |
| 363 bool UpdateServerCardBillingAddress(const CreditCard& credit_card); |
| 364 |
| 359 // Deletes all data from the server card and profile tables. Returns true if | 365 // Deletes all data from the server card and profile tables. Returns true if |
| 360 // any data was deleted, false if not (so false means "commit not needed" | 366 // any data was deleted, false if not (so false means "commit not needed" |
| 361 // rather than "error"). | 367 // rather than "error"). |
| 362 bool ClearAllServerData(); | 368 bool ClearAllServerData(); |
| 363 | 369 |
| 364 // Removes rows from autofill_profiles and credit_cards if they were created | 370 // Removes rows from autofill_profiles and credit_cards if they were created |
| 365 // on or after |delete_begin| and strictly before |delete_end|. Returns the | 371 // on or after |delete_begin| and strictly before |delete_end|. Returns the |
| 366 // list of deleted profile guids in |profile_guids|. Return value is true if | 372 // list of deleted profile guids in |profile_guids|. Return value is true if |
| 367 // all rows were successfully removed. Returns false on database error. In | 373 // all rows were successfully removed. Returns false on database error. In |
| 368 // that case, the output vector state is undefined, and may be partially | 374 // that case, the output vector state is undefined, and may be partially |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 bool MigrateToVersion55MergeAutofillDatesTable(); | 412 bool MigrateToVersion55MergeAutofillDatesTable(); |
| 407 bool MigrateToVersion56AddProfileLanguageCodeForFormatting(); | 413 bool MigrateToVersion56AddProfileLanguageCodeForFormatting(); |
| 408 bool MigrateToVersion57AddFullNameField(); | 414 bool MigrateToVersion57AddFullNameField(); |
| 409 bool MigrateToVersion60AddServerCards(); | 415 bool MigrateToVersion60AddServerCards(); |
| 410 bool MigrateToVersion61AddUsageStats(); | 416 bool MigrateToVersion61AddUsageStats(); |
| 411 bool MigrateToVersion62AddUsageStatsForUnmaskedCards(); | 417 bool MigrateToVersion62AddUsageStatsForUnmaskedCards(); |
| 412 bool MigrateToVersion63AddServerRecipientName(); | 418 bool MigrateToVersion63AddServerRecipientName(); |
| 413 bool MigrateToVersion64AddUnmaskDate(); | 419 bool MigrateToVersion64AddUnmaskDate(); |
| 414 bool MigrateToVersion65AddServerMetadataTables(); | 420 bool MigrateToVersion65AddServerMetadataTables(); |
| 415 bool MigrateToVersion66AddCardBillingAddress(); | 421 bool MigrateToVersion66AddCardBillingAddress(); |
| 422 bool MigrateToVersion67AddMaskedCardBillingAddress(); |
| 416 | 423 |
| 417 // Max data length saved in the table, AKA the maximum length allowed for | 424 // Max data length saved in the table, AKA the maximum length allowed for |
| 418 // form data. | 425 // form data. |
| 419 // Copied to components/autofill/ios/browser/resources/autofill_controller.js. | 426 // Copied to components/autofill/ios/browser/resources/autofill_controller.js. |
| 420 static const size_t kMaxDataLength; | 427 static const size_t kMaxDataLength; |
| 421 | 428 |
| 422 private: | 429 private: |
| 423 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill); | 430 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill); |
| 424 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_AddChanges); | 431 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_AddChanges); |
| 425 FRIEND_TEST_ALL_PREFIXES( | 432 FRIEND_TEST_ALL_PREFIXES( |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 bool InitServerCardMetadataTable(); | 497 bool InitServerCardMetadataTable(); |
| 491 bool InitServerAddressesTable(); | 498 bool InitServerAddressesTable(); |
| 492 bool InitServerAddressMetadataTable(); | 499 bool InitServerAddressMetadataTable(); |
| 493 | 500 |
| 494 DISALLOW_COPY_AND_ASSIGN(AutofillTable); | 501 DISALLOW_COPY_AND_ASSIGN(AutofillTable); |
| 495 }; | 502 }; |
| 496 | 503 |
| 497 } // namespace autofill | 504 } // namespace autofill |
| 498 | 505 |
| 499 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 506 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| OLD | NEW |