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

Side by Side Diff: components/autofill/core/browser/webdata/autofill_table.h

Issue 2626843004: [Payments] Add billing_address_id and has_converted to autofill_table (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 // Sync-specific metadata for autofill records. 239 // Sync-specific metadata for autofill records.
240 // 240 //
241 // storage_key A string that uniquely identifies the metadata record 241 // storage_key A string that uniquely identifies the metadata record
242 // as well as the corresponding autofill record. 242 // as well as the corresponding autofill record.
243 // value The serialized EntityMetadata record. 243 // value The serialized EntityMetadata record.
244 // 244 //
245 // autofill_model_type_state 245 // autofill_model_type_state
246 // Single row table that contains the sync ModelTypeState 246 // Single row table that contains the sync ModelTypeState
247 // for the autofill model type. 247 // for the autofill model type.
248 // 248 //
249 // value The serialized ModelTypeState record. 249 // value The serialized ModelTypeState record.
please use gerrit instead 2017/01/11 19:23:03 You must add the new fields to this comment block.
sebsg 2017/01/12 15:36:31 Seems somehow I ctr-Z them.... thanks for spotting
250 250
251 class AutofillTable : public WebDatabaseTable { 251 class AutofillTable : public WebDatabaseTable {
252 public: 252 public:
253 AutofillTable(); 253 AutofillTable();
254 ~AutofillTable() override; 254 ~AutofillTable() override;
255 255
256 // Retrieves the AutofillTable* owned by |db|. 256 // Retrieves the AutofillTable* owned by |db|.
257 static AutofillTable* FromWebDatabase(WebDatabase* db); 257 static AutofillTable* FromWebDatabase(WebDatabase* db);
258 258
259 // WebDatabaseTable: 259 // WebDatabaseTable:
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
376 bool MaskServerCreditCard(const std::string& id); 376 bool MaskServerCreditCard(const std::string& id);
377 377
378 bool UpdateServerCardUsageStats(const CreditCard& credit_card); 378 bool UpdateServerCardMetadata(const CreditCard& credit_card);
379 bool UpdateServerAddressUsageStats(const AutofillProfile& profile); 379 bool UpdateServerAddressMetadata(const AutofillProfile& profile);
380
381 bool UpdateServerCardBillingAddress(const CreditCard& credit_card);
382 380
383 // Deletes all data from the server card and profile tables. Returns true if 381 // Deletes all data from the server card and profile tables. Returns true if
384 // any data was deleted, false if not (so false means "commit not needed" 382 // any data was deleted, false if not (so false means "commit not needed"
385 // rather than "error"). 383 // rather than "error").
386 bool ClearAllServerData(); 384 bool ClearAllServerData();
387 385
388 // Removes rows from autofill_profiles and credit_cards if they were created 386 // Removes rows from autofill_profiles and credit_cards if they were created
389 // on or after |delete_begin| and strictly before |delete_end|. Returns the 387 // on or after |delete_begin| and strictly before |delete_end|. Returns the
390 // list of deleted profile guids in |profile_guids|. Return value is true if 388 // list of deleted profile guids in |profile_guids|. Return value is true if
391 // all rows were successfully removed. Returns false on database error. In 389 // all rows were successfully removed. Returns false on database error. In
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 bool MigrateToVersion57AddFullNameField(); 452 bool MigrateToVersion57AddFullNameField();
455 bool MigrateToVersion60AddServerCards(); 453 bool MigrateToVersion60AddServerCards();
456 bool MigrateToVersion61AddUsageStats(); 454 bool MigrateToVersion61AddUsageStats();
457 bool MigrateToVersion62AddUsageStatsForUnmaskedCards(); 455 bool MigrateToVersion62AddUsageStatsForUnmaskedCards();
458 bool MigrateToVersion63AddServerRecipientName(); 456 bool MigrateToVersion63AddServerRecipientName();
459 bool MigrateToVersion64AddUnmaskDate(); 457 bool MigrateToVersion64AddUnmaskDate();
460 bool MigrateToVersion65AddServerMetadataTables(); 458 bool MigrateToVersion65AddServerMetadataTables();
461 bool MigrateToVersion66AddCardBillingAddress(); 459 bool MigrateToVersion66AddCardBillingAddress();
462 bool MigrateToVersion67AddMaskedCardBillingAddress(); 460 bool MigrateToVersion67AddMaskedCardBillingAddress();
463 bool MigrateToVersion70AddSyncMetadata(); 461 bool MigrateToVersion70AddSyncMetadata();
462 bool MigrateToVersion71AddServerCardMetadataBillingAddress();
464 463
465 // Max data length saved in the table, AKA the maximum length allowed for 464 // Max data length saved in the table, AKA the maximum length allowed for
466 // form data. 465 // form data.
467 // Copied to components/autofill/ios/browser/resources/autofill_controller.js. 466 // Copied to components/autofill/ios/browser/resources/autofill_controller.js.
468 static const size_t kMaxDataLength; 467 static const size_t kMaxDataLength;
469 468
470 private: 469 private:
471 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill); 470 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill);
472 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_AddChanges); 471 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_AddChanges);
473 FRIEND_TEST_ALL_PREFIXES( 472 FRIEND_TEST_ALL_PREFIXES(
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 bool InitServerAddressMetadataTable(); 545 bool InitServerAddressMetadataTable();
547 bool InitAutofillSyncMetadataTable(); 546 bool InitAutofillSyncMetadataTable();
548 bool InitModelTypeStateTable(); 547 bool InitModelTypeStateTable();
549 548
550 DISALLOW_COPY_AND_ASSIGN(AutofillTable); 549 DISALLOW_COPY_AND_ASSIGN(AutofillTable);
551 }; 550 };
552 551
553 } // namespace autofill 552 } // namespace autofill
554 553
555 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ 554 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698