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

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

Issue 2120973002: [Payments] Show complete profiles first and limit to 4 suggestions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 5 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 #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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 // clear so that tests can synchronously verify that this data was cleared. 648 // clear so that tests can synchronously verify that this data was cleared.
649 server_credit_cards_.clear(); 649 server_credit_cards_.clear();
650 server_profiles_.clear(); 650 server_profiles_.clear();
651 } 651 }
652 652
653 void PersonalDataManager::AddServerCreditCardForTest( 653 void PersonalDataManager::AddServerCreditCardForTest(
654 std::unique_ptr<CreditCard> credit_card) { 654 std::unique_ptr<CreditCard> credit_card) {
655 server_credit_cards_.push_back(credit_card.release()); 655 server_credit_cards_.push_back(credit_card.release());
656 } 656 }
657 657
658 void PersonalDataManager::NotifyPersonalDataChangedForTests() {
659 NotifyPersonalDataChanged();
660 }
661
658 void PersonalDataManager::RemoveByGUID(const std::string& guid) { 662 void PersonalDataManager::RemoveByGUID(const std::string& guid) {
659 if (is_off_the_record_) 663 if (is_off_the_record_)
660 return; 664 return;
661 665
662 bool is_credit_card = FindByGUID<CreditCard>(local_credit_cards_, guid); 666 bool is_credit_card = FindByGUID<CreditCard>(local_credit_cards_, guid);
663 bool is_profile = !is_credit_card && 667 bool is_profile = !is_credit_card &&
664 FindByGUID<AutofillProfile>(web_profiles_, guid); 668 FindByGUID<AutofillProfile>(web_profiles_, guid);
665 if (!is_credit_card && !is_profile) 669 if (!is_credit_card && !is_profile)
666 return; 670 return;
667 671
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 if (profile_to_merge->IsVerified()) 1716 if (profile_to_merge->IsVerified())
1713 break; 1717 break;
1714 } 1718 }
1715 } 1719 }
1716 } 1720 }
1717 AutofillMetrics::LogNumberOfProfilesRemovedDuringDedupe( 1721 AutofillMetrics::LogNumberOfProfilesRemovedDuringDedupe(
1718 profiles_to_delete->size()); 1722 profiles_to_delete->size());
1719 } 1723 }
1720 1724
1721 } // namespace autofill 1725 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698