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

Unified Diff: chrome/browser/autofill/form_group.cc

Issue 8143007: Move a bunch of non-shared methods out of the FormGroup class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: De-nitting Created 9 years, 2 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 | « chrome/browser/autofill/form_group.h ('k') | chrome/browser/autofill/personal_data_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/form_group.cc
diff --git a/chrome/browser/autofill/form_group.cc b/chrome/browser/autofill/form_group.cc
index b4d0efd1d14f2cf0b155fb65beeb750770e841d4..4a853ebfcf84d8ccf66a5cea106a3eeb2409cb31 100644
--- a/chrome/browser/autofill/form_group.cc
+++ b/chrome/browser/autofill/form_group.cc
@@ -46,71 +46,3 @@ bool FormGroup::SetCanonicalizedInfo(AutofillFieldType type,
SetInfo(type, value);
return true;
}
-
-const string16 FormGroup::Label() const { return string16(); }
-
-bool FormGroup::operator!=(const FormGroup& form_group) const {
- FieldTypeSet a, b, symmetric_difference;
- GetNonEmptyTypes(&a);
- form_group.GetNonEmptyTypes(&b);
- std::set_symmetric_difference(
- a.begin(), a.end(),
- b.begin(), b.end(),
- std::inserter(symmetric_difference, symmetric_difference.begin()));
-
- if (!symmetric_difference.empty())
- return true;
-
- return (!IntersectionOfTypesHasEqualValues(form_group));
-}
-
-bool FormGroup::IsSubsetOf(const FormGroup& form_group) const {
- FieldTypeSet types;
- GetNonEmptyTypes(&types);
-
- for (FieldTypeSet::const_iterator iter = types.begin(); iter != types.end();
- ++iter) {
- if (StringToLowerASCII(GetInfo(*iter)) !=
- StringToLowerASCII(form_group.GetInfo(*iter)))
- return false;
- }
-
- return true;
-}
-
-bool FormGroup::IntersectionOfTypesHasEqualValues(
- const FormGroup& form_group) const {
- FieldTypeSet a, b, intersection;
- GetNonEmptyTypes(&a);
- form_group.GetNonEmptyTypes(&b);
- std::set_intersection(a.begin(), a.end(),
- b.begin(), b.end(),
- std::inserter(intersection, intersection.begin()));
-
- // An empty intersection can't have equal values.
- if (intersection.empty())
- return false;
-
- for (FieldTypeSet::const_iterator iter = intersection.begin();
- iter != intersection.end(); ++iter) {
- if (StringToLowerASCII(GetInfo(*iter)) !=
- StringToLowerASCII(form_group.GetInfo(*iter)))
- return false;
- }
-
- return true;
-}
-
-void FormGroup::MergeWith(const FormGroup& form_group) {
- FieldTypeSet a, b, difference;
- GetNonEmptyTypes(&a);
- form_group.GetNonEmptyTypes(&b);
- std::set_difference(b.begin(), b.end(),
- a.begin(), a.end(),
- std::inserter(difference, difference.begin()));
-
- for (FieldTypeSet::const_iterator iter = difference.begin();
- iter != difference.end(); ++iter) {
- SetInfo(*iter, form_group.GetInfo(*iter));
- }
-}
« no previous file with comments | « chrome/browser/autofill/form_group.h ('k') | chrome/browser/autofill/personal_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698