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

Unified Diff: components/autofill/browser/autofill_data_model.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/address.h ('k') | components/autofill/browser/autofill_data_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/browser/autofill_data_model.h
diff --git a/components/autofill/browser/autofill_data_model.h b/components/autofill/browser/autofill_data_model.h
new file mode 100644
index 0000000000000000000000000000000000000000..e040cf3cd881e6fa63ac66f22f80021bf5af9ac8
--- /dev/null
+++ b/components/autofill/browser/autofill_data_model.h
@@ -0,0 +1,55 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_DATA_MODEL_H_
+#define COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_DATA_MODEL_H_
+
+#include <string>
+
+#include "components/autofill/browser/field_types.h"
+#include "components/autofill/browser/form_group.h"
+
+namespace autofill {
+
+class AutofillField;
+struct FormFieldData;
+
+// This class is an interface for the primary data models that back Autofill.
+// The information in objects of this class is managed by the
+// PersonalDataManager.
+class AutofillDataModel : public FormGroup {
+ public:
+ explicit AutofillDataModel(const std::string& guid);
+ virtual ~AutofillDataModel();
+
+ // Set |field_data|'s value based on |field| and contents of |this| (using
+ // data variant |variant|).
+ virtual void FillFormField(const AutofillField& field,
+ size_t variant,
+ const std::string& app_locale,
+ FormFieldData* field_data) const = 0;
+
+ // Fills in select control with data matching |type| from |this|.
+ // Public for testing purposes.
+ void FillSelectControl(AutofillFieldType type,
+ const std::string& app_locale,
+ FormFieldData* field_data) const;
+
+ std::string guid() const { return guid_; }
+ void set_guid(const std::string& guid) { guid_ = guid; }
+
+ protected:
+ // Fills in a select control for a country from data in |this|. Returns true
+ // for success.
+ virtual bool FillCountrySelectControl(const std::string& app_locale,
+ FormFieldData* field_data) const;
+
+ private:
+ // A globally unique ID for this object.
+ std::string guid_;
+};
+
+} // namespace autofill
+
+#endif // COMPONENTS_AUTOFILL_BROWSER_AUTOFILL_DATA_MODEL_H_
« no previous file with comments | « components/autofill/browser/address.h ('k') | components/autofill/browser/autofill_data_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698