Chromium Code Reviews| Index: components/autofill/core/browser/webdata/autofill_change.cc |
| diff --git a/components/autofill/core/browser/webdata/autofill_change.cc b/components/autofill/core/browser/webdata/autofill_change.cc |
| index c02bdd8464d8476d974f1cfd0a04e2c60f55af10..ed2a6be114e25aa8c3325977afb91289e9a8f8ad 100644 |
| --- a/components/autofill/core/browser/webdata/autofill_change.cc |
| +++ b/components/autofill/core/browser/webdata/autofill_change.cc |
| @@ -36,4 +36,22 @@ bool AutofillProfileChange::operator==( |
| (type() != REMOVE) ? *profile() == *change.profile() : true; |
| } |
| +CreditCardChange::CreditCardChange(Type type, |
| + const std::string& key, |
| + const CreditCard* card) |
| + : GenericAutofillChange<std::string>(type, key), card_(card) { |
| + DCHECK(type == ADD ? (card && card->guid() == key) : true); |
| + DCHECK(type == UPDATE ? (card && card->guid() == key) : true); |
| + DCHECK(type == REMOVE ? !card : true); |
|
Evan Stade
2015/05/20 21:35:37
change to boolean logic, ditch ternary operator
please use gerrit instead
2015/05/20 22:52:36
Ditched ternary operator in Patch Set 4.
|
| +} |
| + |
| +CreditCardChange::~CreditCardChange() { |
| +} |
| + |
| +bool CreditCardChange::operator==(const CreditCardChange& change) const { |
| + return type() == change.type() && |
| + key() == change.key() && |
| + (type() != REMOVE) ? *card() == *change.card() : true; |
|
Evan Stade
2015/05/20 21:35:36
whitespace update didn't help me understand
please use gerrit instead
2015/05/20 22:52:36
Ditched ternary operator in Patch Set 4.
|
| +} |
| + |
| } // namespace autofill |