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

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

Issue 770333006: Autofill - change presentation of credit card suggestions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve merge conflict Created 6 years 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 <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <iterator> 9 #include <iterator>
10 10
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 base::string16::npos != 652 base::string16::npos !=
653 creditcard_field_value.find(field_contents)))) { 653 creditcard_field_value.find(field_contents)))) {
654 // Make a new suggestion. 654 // Make a new suggestion.
655 suggestions.push_back(Suggestion()); 655 suggestions.push_back(Suggestion());
656 Suggestion* suggestion = &suggestions.back(); 656 Suggestion* suggestion = &suggestions.back();
657 657
658 // If the value is the card number, the label is the expiration date. 658 // If the value is the card number, the label is the expiration date.
659 // Otherwise the label is the card number, or if that is empty the 659 // Otherwise the label is the card number, or if that is empty the
660 // cardholder name. The label should never repeat the value. 660 // cardholder name. The label should never repeat the value.
661 if (type.GetStorableType() == CREDIT_CARD_NUMBER) { 661 if (type.GetStorableType() == CREDIT_CARD_NUMBER) {
662 creditcard_field_value = credit_card->ObfuscatedNumber(); 662 creditcard_field_value = credit_card->TypeAndLastFourDigits();
663 suggestion->label = credit_card->GetInfo( 663 suggestion->label = credit_card->GetInfo(
664 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_); 664 AutofillType(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR), app_locale_);
665 } else if (credit_card->number().empty()) { 665 } else if (credit_card->number().empty()) {
666 if (type.GetStorableType() != CREDIT_CARD_NAME) { 666 if (type.GetStorableType() != CREDIT_CARD_NAME) {
667 suggestion->label = 667 suggestion->label =
668 credit_card->GetInfo(AutofillType(CREDIT_CARD_NAME), app_locale_); 668 credit_card->GetInfo(AutofillType(CREDIT_CARD_NAME), app_locale_);
669 } 669 }
670 } else { 670 } else {
671 suggestion->label = kCreditCardPrefix; 671 suggestion->label = kCreditCardPrefix;
672 suggestion->label.append(credit_card->LastFourDigits()); 672 suggestion->label.append(credit_card->LastFourDigits());
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 // Populates |auxiliary_profiles_|. 1094 // Populates |auxiliary_profiles_|.
1095 LoadAuxiliaryProfiles(record_metrics); 1095 LoadAuxiliaryProfiles(record_metrics);
1096 1096
1097 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end()); 1097 profiles_.insert(profiles_.end(), web_profiles_.begin(), web_profiles_.end());
1098 profiles_.insert( 1098 profiles_.insert(
1099 profiles_.end(), auxiliary_profiles_.begin(), auxiliary_profiles_.end()); 1099 profiles_.end(), auxiliary_profiles_.begin(), auxiliary_profiles_.end());
1100 return profiles_; 1100 return profiles_;
1101 } 1101 }
1102 1102
1103 } // namespace autofill 1103 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698