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

Side by Side Diff: components/autofill/core/browser/webdata/autofill_wallet_syncable_service.cc

Issue 2711543002: Experiment to add bank name in autofill ui. (Closed)
Patch Set: add more unit test Created 3 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/webdata/autofill_wallet_syncable_serv ice.h" 5 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv ice.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 CreditCard CardFromSpecifics(const sync_pb::WalletMaskedCreditCard& card) { 71 CreditCard CardFromSpecifics(const sync_pb::WalletMaskedCreditCard& card) {
72 CreditCard result(CreditCard::MASKED_SERVER_CARD, card.id()); 72 CreditCard result(CreditCard::MASKED_SERVER_CARD, card.id());
73 result.SetNumber(base::UTF8ToUTF16(card.last_four())); 73 result.SetNumber(base::UTF8ToUTF16(card.last_four()));
74 result.SetServerStatus(ServerToLocalStatus(card.status())); 74 result.SetServerStatus(ServerToLocalStatus(card.status()));
75 result.SetTypeForMaskedCard(CardTypeFromWalletCardType(card.type())); 75 result.SetTypeForMaskedCard(CardTypeFromWalletCardType(card.type()));
76 result.SetRawInfo(CREDIT_CARD_NAME_FULL, 76 result.SetRawInfo(CREDIT_CARD_NAME_FULL,
77 base::UTF8ToUTF16(card.name_on_card())); 77 base::UTF8ToUTF16(card.name_on_card()));
78 result.SetExpirationMonth(card.exp_month()); 78 result.SetExpirationMonth(card.exp_month());
79 result.SetExpirationYear(card.exp_year()); 79 result.SetExpirationYear(card.exp_year());
80 if (card.has_bank_name()) {
81 result.SetBankName(base::UTF8ToUTF16(card.bank_name()));
82 }
80 result.set_billing_address_id(card.billing_address_id()); 83 result.set_billing_address_id(card.billing_address_id());
81 return result; 84 return result;
82 } 85 }
83 86
84 AutofillProfile ProfileFromSpecifics( 87 AutofillProfile ProfileFromSpecifics(
85 const sync_pb::WalletPostalAddress& address) { 88 const sync_pb::WalletPostalAddress& address) {
86 AutofillProfile profile(AutofillProfile::SERVER_PROFILE, std::string()); 89 AutofillProfile profile(AutofillProfile::SERVER_PROFILE, std::string());
87 90
88 // AutofillProfile stores multi-line addresses with newline separators. 91 // AutofillProfile stores multi-line addresses with newline separators.
89 std::vector<std::string> street_address(address.street_address().begin(), 92 std::vector<std::string> street_address(address.street_address().begin(),
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 merge_result.set_num_items_after_association( 350 merge_result.set_num_items_after_association(
348 static_cast<int>(wallet_cards.size() + wallet_addresses.size())); 351 static_cast<int>(wallet_cards.size() + wallet_addresses.size()));
349 352
350 if (webdata_backend_ && (changed_cards || changed_addresses)) 353 if (webdata_backend_ && (changed_cards || changed_addresses))
351 webdata_backend_->NotifyOfMultipleAutofillChanges(); 354 webdata_backend_->NotifyOfMultipleAutofillChanges();
352 355
353 return merge_result; 356 return merge_result;
354 } 357 }
355 358
356 } // namespace autofil 359 } // namespace autofil
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698