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

Unified Diff: chrome/browser/autofill/autofill-inl.h

Issue 6082001: Autofill saves duplicate profiles and credit card info in preferences (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Credit card and GUID functor. Created 10 years 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 | « no previous file | chrome/browser/autofill/autofill_dialog_controller_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill-inl.h
diff --git a/chrome/browser/autofill/autofill-inl.h b/chrome/browser/autofill/autofill-inl.h
new file mode 100644
index 0000000000000000000000000000000000000000..66e0df2183c3f73c3b05af6625ec022b88f4ddcc
--- /dev/null
+++ b/chrome/browser/autofill/autofill-inl.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2010 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 CHROME_BROWSER_AUTOFILL_AUTOFILL_INL_H_
+#define CHROME_BROWSER_AUTOFILL_AUTOFILL_INL_H_
+#pragma once
+
+template<typename T>
+class FormGroupMatchesByCompareFunctor {
+ public:
+ explicit FormGroupMatchesByCompareFunctor(const T& form_group)
+ : form_group_(form_group) {
+ }
+
+ bool operator()(const T* form_group) {
+ return form_group->Compare(form_group_) == 0;
+ }
+
+ bool operator()(const T& form_group) {
+ return form_group.Compare(form_group_) == 0;
+ }
+
+ private:
+ const T& form_group_;
+};
+
+template<typename C, typename T>
+bool FindByContents(const C& container, const T& form_group) {
+ return std::find_if(
+ container.begin(),
+ container.end(),
+ FormGroupMatchesByCompareFunctor<T>(form_group)) != container.end();
+}
+
+#endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_INL_H_
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_dialog_controller_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698