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

Unified Diff: components/autofill/browser/credit_card.h

Issue 14096009: [Autofill] Split off AutofillDataModel as a subclass of FormData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android compile 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/browser/contact_info.h ('k') | components/autofill/browser/credit_card.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/browser/credit_card.h
diff --git a/components/autofill/browser/credit_card.h b/components/autofill/browser/credit_card.h
index d3c770d1e827a042f99341f44807988a7194a027..1d9cfbf3868110260da8cba16b6e7fde7b49e200 100644
--- a/components/autofill/browser/credit_card.h
+++ b/components/autofill/browser/credit_card.h
@@ -9,16 +9,17 @@
#include <string>
#include <vector>
+#include "base/compiler_specific.h"
#include "base/string16.h"
+#include "components/autofill/browser/autofill_data_model.h"
#include "components/autofill/browser/field_types.h"
-#include "components/autofill/browser/form_group.h"
namespace autofill {
struct FormFieldData;
// A form group that stores credit card information.
-class CreditCard : public FormGroup {
+class CreditCard : public AutofillDataModel {
public:
explicit CreditCard(const std::string& guid);
@@ -33,8 +34,7 @@ class CreditCard : public FormGroup {
// The user-visible type of the card, e.g. 'Mastercard'.
static base::string16 TypeForDisplay(const std::string& type);
- // FormGroup implementation:
- virtual std::string GetGUID() const OVERRIDE;
+ // FormGroup:
virtual void GetMatchingTypes(const base::string16& text,
const std::string& app_locale,
FieldTypeSet* matching_types) const OVERRIDE;
@@ -46,6 +46,8 @@ class CreditCard : public FormGroup {
virtual bool SetInfo(AutofillFieldType type,
const base::string16& value,
const std::string& app_locale) OVERRIDE;
+
+ // AutofillDataModel:
virtual void FillFormField(const AutofillField& field,
size_t variant,
const std::string& app_locale,
@@ -73,11 +75,6 @@ class CreditCard : public FormGroup {
int expiration_month() const { return expiration_month_; }
int expiration_year() const { return expiration_year_; }
- // The guid is the primary identifier for |CreditCard| objects.
- // TODO(estade): remove this and just use GetGUID().
- const std::string guid() const { return guid_; }
- void set_guid(const std::string& guid) { guid_ = guid; }
-
// For use in STL containers.
void operator=(const CreditCard& credit_card);
@@ -141,9 +138,6 @@ class CreditCard : public FormGroup {
// These members are zero if not present.
int expiration_month_;
int expiration_year_;
-
- // The guid of this credit card.
- std::string guid_;
};
// So we can compare CreditCards with EXPECT_EQ().
« no previous file with comments | « components/autofill/browser/contact_info.h ('k') | components/autofill/browser/credit_card.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698