| OLD | NEW |
| 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/credit_card.h" | 5 #include "components/autofill/core/browser/credit_card.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 return; | 515 return; |
| 516 | 516 |
| 517 record_type_ = credit_card.record_type_; | 517 record_type_ = credit_card.record_type_; |
| 518 number_ = credit_card.number_; | 518 number_ = credit_card.number_; |
| 519 name_on_card_ = credit_card.name_on_card_; | 519 name_on_card_ = credit_card.name_on_card_; |
| 520 type_ = credit_card.type_; | 520 type_ = credit_card.type_; |
| 521 expiration_month_ = credit_card.expiration_month_; | 521 expiration_month_ = credit_card.expiration_month_; |
| 522 expiration_year_ = credit_card.expiration_year_; | 522 expiration_year_ = credit_card.expiration_year_; |
| 523 server_id_ = credit_card.server_id_; | 523 server_id_ = credit_card.server_id_; |
| 524 server_status_ = credit_card.server_status_; | 524 server_status_ = credit_card.server_status_; |
| 525 billing_address_id_ = credit_card.billing_address_id_; |
| 525 | 526 |
| 526 set_guid(credit_card.guid()); | 527 set_guid(credit_card.guid()); |
| 527 set_origin(credit_card.origin()); | 528 set_origin(credit_card.origin()); |
| 528 } | 529 } |
| 529 | 530 |
| 530 bool CreditCard::UpdateFromImportedCard(const CreditCard& imported_card, | 531 bool CreditCard::UpdateFromImportedCard(const CreditCard& imported_card, |
| 531 const std::string& app_locale) { | 532 const std::string& app_locale) { |
| 532 if (this->GetInfo(AutofillType(CREDIT_CARD_NUMBER), app_locale) != | 533 if (this->GetInfo(AutofillType(CREDIT_CARD_NUMBER), app_locale) != |
| 533 imported_card.GetInfo(AutofillType(CREDIT_CARD_NUMBER), app_locale)) { | 534 imported_card.GetInfo(AutofillType(CREDIT_CARD_NUMBER), app_locale)) { |
| 534 return false; | 535 return false; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 int comparison = | 579 int comparison = |
| 579 GetRawInfo(types[i]).compare(credit_card.GetRawInfo(types[i])); | 580 GetRawInfo(types[i]).compare(credit_card.GetRawInfo(types[i])); |
| 580 if (comparison != 0) | 581 if (comparison != 0) |
| 581 return comparison; | 582 return comparison; |
| 582 } | 583 } |
| 583 | 584 |
| 584 int comparison = server_id_.compare(credit_card.server_id_); | 585 int comparison = server_id_.compare(credit_card.server_id_); |
| 585 if (comparison != 0) | 586 if (comparison != 0) |
| 586 return comparison; | 587 return comparison; |
| 587 | 588 |
| 589 comparison = billing_address_id_.compare(credit_card.billing_address_id_); |
| 590 if (comparison != 0) |
| 591 return comparison; |
| 592 |
| 588 if (static_cast<int>(server_status_) < | 593 if (static_cast<int>(server_status_) < |
| 589 static_cast<int>(credit_card.server_status_)) | 594 static_cast<int>(credit_card.server_status_)) |
| 590 return -1; | 595 return -1; |
| 591 if (static_cast<int>(server_status_) > | 596 if (static_cast<int>(server_status_) > |
| 592 static_cast<int>(credit_card.server_status_)) | 597 static_cast<int>(credit_card.server_status_)) |
| 593 return 1; | 598 return 1; |
| 594 if (static_cast<int>(record_type_) < | 599 if (static_cast<int>(record_type_) < |
| 595 static_cast<int>(credit_card.record_type_)) | 600 static_cast<int>(credit_card.record_type_)) |
| 596 return -1; | 601 return -1; |
| 597 if (static_cast<int>(record_type_) > | 602 if (static_cast<int>(record_type_) > |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 const char kAmericanExpressCard[] = "americanExpressCC"; | 818 const char kAmericanExpressCard[] = "americanExpressCC"; |
| 814 const char kDinersCard[] = "dinersCC"; | 819 const char kDinersCard[] = "dinersCC"; |
| 815 const char kDiscoverCard[] = "discoverCC"; | 820 const char kDiscoverCard[] = "discoverCC"; |
| 816 const char kGenericCard[] = "genericCC"; | 821 const char kGenericCard[] = "genericCC"; |
| 817 const char kJCBCard[] = "jcbCC"; | 822 const char kJCBCard[] = "jcbCC"; |
| 818 const char kMasterCard[] = "masterCardCC"; | 823 const char kMasterCard[] = "masterCardCC"; |
| 819 const char kUnionPay[] = "unionPayCC"; | 824 const char kUnionPay[] = "unionPayCC"; |
| 820 const char kVisaCard[] = "visaCC"; | 825 const char kVisaCard[] = "visaCC"; |
| 821 | 826 |
| 822 } // namespace autofill | 827 } // namespace autofill |
| OLD | NEW |