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

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

Issue 1110833002: [autofill] Sync server card and address metadata. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on top of https://crrev.com/1125143006 Created 5 years, 7 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 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/webdata/autofill_change.h" 5 #include "components/autofill/core/browser/webdata/autofill_change.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "components/autofill/core/browser/autofill_profile.h" 8 #include "components/autofill/core/browser/autofill_profile.h"
9 #include "components/autofill/core/browser/credit_card.h" 9 #include "components/autofill/core/browser/credit_card.h"
10 10
(...skipping 18 matching lines...) Expand all
29 AutofillProfileChange::~AutofillProfileChange() { 29 AutofillProfileChange::~AutofillProfileChange() {
30 } 30 }
31 31
32 bool AutofillProfileChange::operator==( 32 bool AutofillProfileChange::operator==(
33 const AutofillProfileChange& change) const { 33 const AutofillProfileChange& change) const {
34 return type() == change.type() && 34 return type() == change.type() &&
35 key() == change.key() && 35 key() == change.key() &&
36 (type() != REMOVE) ? *profile() == *change.profile() : true; 36 (type() != REMOVE) ? *profile() == *change.profile() : true;
37 } 37 }
38 38
39 CreditCardChange::CreditCardChange(Type type,
40 const std::string& key,
41 const CreditCard* card)
42 : GenericAutofillChange<std::string>(type, key), card_(card) {
43 DCHECK(type == ADD ? (card && card->guid() == key) : true);
44 DCHECK(type == UPDATE ? (card && card->guid() == key) : true);
45 DCHECK(type == REMOVE ? !card : true);
46 }
47
48 CreditCardChange::~CreditCardChange() {
49 }
50
51 bool CreditCardChange::operator==(const CreditCardChange& change) const {
52 return type() == change.type() && key() == change.key() && (type() != REMOVE)
Evan Stade 2015/05/20 21:07:37 I actually can't figure out what this is supposed
please use gerrit instead 2015/05/20 21:18:02 Done.
53 ? *card() == *change.card()
54 : true;
55 }
56
39 } // namespace autofill 57 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698