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

Side by Side Diff: components/autofill/core/browser/personal_data_manager.cc

Issue 2189563002: Use server ID to identify server cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « components/autofill/core/browser/credit_card.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "components/autofill/core/browser/personal_data_manager.h" 5 #include "components/autofill/core/browser/personal_data_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 624
625 void PersonalDataManager::UpdateServerCardBillingAddress( 625 void PersonalDataManager::UpdateServerCardBillingAddress(
626 const CreditCard& credit_card) { 626 const CreditCard& credit_card) {
627 DCHECK_NE(CreditCard::LOCAL_CARD, credit_card.record_type()); 627 DCHECK_NE(CreditCard::LOCAL_CARD, credit_card.record_type());
628 628
629 if (!database_.get()) 629 if (!database_.get())
630 return; 630 return;
631 631
632 CreditCard* existing_credit_card = nullptr; 632 CreditCard* existing_credit_card = nullptr;
633 for (auto* server_card : server_credit_cards_) { 633 for (auto* server_card : server_credit_cards_) {
634 if (credit_card.guid() == server_card->guid()) { 634 if (credit_card.server_id() == server_card->server_id()) {
635 existing_credit_card = server_card; 635 existing_credit_card = server_card;
636 break; 636 break;
637 } 637 }
638 } 638 }
639 if (!existing_credit_card 639 if (!existing_credit_card
640 || existing_credit_card->billing_address_id() == 640 || existing_credit_card->billing_address_id() ==
641 credit_card.billing_address_id()) { 641 credit_card.billing_address_id()) {
642 return; 642 return;
643 } 643 }
644 644
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1755 if (profile_to_merge->IsVerified()) 1755 if (profile_to_merge->IsVerified())
1756 break; 1756 break;
1757 } 1757 }
1758 } 1758 }
1759 } 1759 }
1760 AutofillMetrics::LogNumberOfProfilesRemovedDuringDedupe( 1760 AutofillMetrics::LogNumberOfProfilesRemovedDuringDedupe(
1761 profiles_to_delete->size()); 1761 profiles_to_delete->size());
1762 } 1762 }
1763 1763
1764 } // namespace autofill 1764 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/credit_card.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698