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

Unified Diff: components/autofill/core/browser/personal_data_manager.h

Issue 2855943002: Offer to save card locally if user manually enters same card number as (Closed)
Patch Set: Creates separate tests for duplicating masked server card and not duplicating full server card. Created 3 years, 8 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/personal_data_manager.h
diff --git a/components/autofill/core/browser/personal_data_manager.h b/components/autofill/core/browser/personal_data_manager.h
index 70f2aa2ec7da6fafe41dfe8e362223a27913d7a8..c2ca03c8810c6e757425b3ea43a46df91e65f908 100644
--- a/components/autofill/core/browser/personal_data_manager.h
+++ b/components/autofill/core/browser/personal_data_manager.h
@@ -105,10 +105,15 @@ class PersonalDataManager : public KeyedService,
// a local credit card entry *and* |should_return_local_card| is true, the
// data is stored into |imported_credit_card| so that we can prompt the user
// whether to upload it.
- // Returns |true| if sufficient address or credit card data was found.
- bool ImportFormData(const FormStructure& form,
- bool should_return_local_card,
- std::unique_ptr<CreditCard>* imported_credit_card);
+ // |imported_credit_card_matches_masked_server_credit_card| is set to |true|
+ // if the |TypeAndLastFourDigits| in |imported_credit_card| matches the
+ // |TypeAndLastFourDigits| in a saved masked server card. Returns |true| if
+ // sufficient address or credit card data was found.
+ bool ImportFormData(
+ const FormStructure& form,
+ bool should_return_local_card,
+ std::unique_ptr<CreditCard>* imported_credit_card,
+ bool* imported_credit_card_matches_masked_server_credit_card);
// Called to indicate |data_model| was used (to fill in a form). Updates
// the database accordingly. Can invalidate |data_model|, particularly if
@@ -475,11 +480,16 @@ class PersonalDataManager : public KeyedService,
// Go through the |form| fields and attempt to extract a new credit card in
// |imported_credit_card|, or update an existing card.
// |should_return_local_card| will indicate whether |imported_credit_card| is
- // filled even if an existing card was updated. Success is defined as having a
+ // filled even if an existing card was updated.
+ // |imported_credit_card_matches_masked_server_credit_card| will indicate
+ // whether |imported_credit_card| is filled even if an existing masked server
+ // card as the same |TypeAndLastFourDigits|. Success is defined as having a
// new card to import, or having merged with an existing card.
- bool ImportCreditCard(const FormStructure& form,
- bool should_return_local_card,
- std::unique_ptr<CreditCard>* imported_credit_card);
+ bool ImportCreditCard(
+ const FormStructure& form,
+ bool should_return_local_card,
+ std::unique_ptr<CreditCard>* imported_credit_card,
+ bool* imported_credit_card_matches_masked_server_credit_card);
// Functionally equivalent to GetProfiles(), but also records metrics if
// |record_metrics| is true. Metrics should be recorded when the returned
« no previous file with comments | « components/autofill/core/browser/autofill_merge_unittest.cc ('k') | components/autofill/core/browser/personal_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698