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

Unified Diff: components/autofill/content/browser/wallet/instrument.cc

Issue 17970003: New encryption/escrow endpoints for Wallet (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebasing again... Created 7 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/content/browser/wallet/instrument.cc
diff --git a/components/autofill/content/browser/wallet/instrument.cc b/components/autofill/content/browser/wallet/instrument.cc
index 5e1c8c73da891162c549e9e3033b6601e5bd07f8..d50bc453638147e40999d6cab07cda1ee188308d 100644
--- a/components/autofill/content/browser/wallet/instrument.cc
+++ b/components/autofill/content/browser/wallet/instrument.cc
@@ -80,7 +80,6 @@ Instrument::Instrument(const base::string16& primary_account_number,
expiration_year_(expiration_year),
form_of_payment_(form_of_payment),
address_(address.Pass()) {
- DCHECK(address_);
Init();
}
@@ -90,7 +89,8 @@ Instrument::Instrument(const Instrument& instrument)
expiration_month_(instrument.expiration_month()),
expiration_year_(instrument.expiration_year()),
form_of_payment_(instrument.form_of_payment()),
- address_(new Address(instrument.address())) {
+ address_(instrument.address() ?
+ new Address(*instrument.address()) : NULL) {
Init();
}
@@ -114,22 +114,6 @@ scoped_ptr<base::DictionaryValue> Instrument::ToDictionary() const {
return dict.Pass();
}
-bool Instrument::IsValid() const {
- if (!IsStringASCII(primary_account_number_))
- return false;
- bool primary_account_number_valid =
- autofill::IsValidCreditCardNumber(primary_account_number_);
- bool card_verification_number_valid = card_verification_number_.size() == 3 ||
- card_verification_number_.size() == 4;
- bool exp_month_valid = expiration_month_ >= 1 && expiration_month_ <= 12;
- bool exp_year_valid = expiration_year_ >= 2013 && expiration_year_ <= 2100;
-
- return primary_account_number_valid &&
- card_verification_number_valid &&
- exp_month_valid &&
- exp_year_valid;
-}
-
void Instrument::Init() {
if (primary_account_number_.size() >= 4) {
last_four_digits_ =

Powered by Google App Engine
This is Rietveld 408576698