Index: components/autofill/browser/autofill_data_model.cc |
diff --git a/components/autofill/browser/form_group.cc b/components/autofill/browser/autofill_data_model.cc |
similarity index 72% |
copy from components/autofill/browser/form_group.cc |
copy to components/autofill/browser/autofill_data_model.cc |
index 8e583e5f3c7acc80a6c5b7ab7b726715f5efe7bf..501184dcda37fb588b7bb6a54a94a541db57735f 100644 |
--- a/components/autofill/browser/form_group.cc |
+++ b/components/autofill/browser/autofill_data_model.cc |
@@ -1,17 +1,16 @@ |
-// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// 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. |
-#include "components/autofill/browser/form_group.h" |
- |
-#include <algorithm> |
-#include <iterator> |
+#include "components/autofill/browser/autofill_data_model.h" |
#include "base/basictypes.h" |
#include "base/logging.h" |
+#include "base/string_util.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/utf_string_conversions.h" |
#include "components/autofill/browser/autofill_country.h" |
+#include "components/autofill/browser/autofill_field.h" |
#include "components/autofill/browser/state_names.h" |
#include "components/autofill/browser/validation.h" |
#include "components/autofill/common/form_field_data.h" |
@@ -121,64 +120,12 @@ bool FillCreditCardTypeSelectControl(const base::string16& value, |
} // namespace |
-std::string FormGroup::GetGUID() const { |
- NOTREACHED(); |
- return std::string(); |
-} |
- |
-void FormGroup::GetMatchingTypes(const base::string16& text, |
- const std::string& app_locale, |
- FieldTypeSet* matching_types) const { |
- if (text.empty()) { |
- matching_types->insert(EMPTY_TYPE); |
- return; |
- } |
- |
- FieldTypeSet types; |
- GetSupportedTypes(&types); |
- for (FieldTypeSet::const_iterator type = types.begin(); |
- type != types.end(); ++type) { |
- // TODO(isherman): Matches are case-sensitive for now. Let's keep an eye on |
- // this and decide whether there are compelling reasons to add case- |
- // insensitivity. |
- if (GetInfo(*type, app_locale) == text) |
- matching_types->insert(*type); |
- } |
-} |
- |
-void FormGroup::GetNonEmptyTypes(const std::string& app_locale, |
- FieldTypeSet* non_empty_types) const { |
- FieldTypeSet types; |
- GetSupportedTypes(&types); |
- for (FieldTypeSet::const_iterator type = types.begin(); |
- type != types.end(); ++type) { |
- if (!GetInfo(*type, app_locale).empty()) |
- non_empty_types->insert(*type); |
- } |
-} |
- |
-base::string16 FormGroup::GetInfo(AutofillFieldType type, |
- const std::string& app_locale) const { |
- return GetRawInfo(type); |
-} |
- |
-bool FormGroup::SetInfo(AutofillFieldType type, |
- const base::string16& value, |
- const std::string& app_locale) { |
- SetRawInfo(type, value); |
- return true; |
-} |
- |
-void FormGroup::FillFormField(const AutofillField& field, |
- size_t variant, |
- const std::string& app_locale, |
- FormFieldData* field_data) const { |
- NOTREACHED(); |
-} |
+AutofillDataModel::AutofillDataModel(const std::string& guid) : guid_(guid) {} |
+AutofillDataModel::~AutofillDataModel() {} |
-void FormGroup::FillSelectControl(AutofillFieldType type, |
- const std::string& app_locale, |
- FormFieldData* field) const { |
+void AutofillDataModel::FillSelectControl(AutofillFieldType type, |
+ const std::string& app_locale, |
+ FormFieldData* field) const { |
DCHECK(field); |
DCHECK_EQ("select-one", field->form_control_type); |
DCHECK_EQ(field->option_values.size(), field->option_contents.size()); |
@@ -226,8 +173,9 @@ void FormGroup::FillSelectControl(AutofillFieldType type, |
} |
} |
-bool FormGroup::FillCountrySelectControl(const std::string& app_locale, |
- FormFieldData* field_data) const { |
+bool AutofillDataModel::FillCountrySelectControl( |
+ const std::string& app_locale, |
+ FormFieldData* field_data) const { |
return false; |
} |