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

Side by Side Diff: chrome/browser/webdata/autofill_change.cc

Issue 13392014: Move c/b/webdata/ code to components/webdata/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/webdata/autofill_change.h"
6
7 #include "components/autofill/browser/autofill_profile.h"
8 #include "components/autofill/browser/credit_card.h"
9
10 AutofillChange::AutofillChange(Type type, const AutofillKey& key)
11 : GenericAutofillChange<AutofillKey>(type, key) {
12 }
13
14 AutofillChange::~AutofillChange() {
15 }
16
17 AutofillProfileChange::AutofillProfileChange(
18 Type type, const std::string& key, const AutofillProfile* profile)
19 : GenericAutofillChange<std::string>(type, key),
20 profile_(profile) {
21 DCHECK(type == ADD ? (profile && profile->guid() == key) : true);
22 DCHECK(type == UPDATE ? (profile && profile->guid() == key) : true);
23 DCHECK(type == REMOVE ? !profile : true);
24 }
25
26 AutofillProfileChange::~AutofillProfileChange() {
27 }
28
29 bool AutofillProfileChange::operator==(
30 const AutofillProfileChange& change) const {
31 return type() == change.type() &&
32 key() == change.key() &&
33 (type() != REMOVE) ? *profile() == *change.profile() : true;
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698