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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_dialog_controller_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_INL_H_
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_INL_H_
7 #pragma once
8
9 template<typename T>
10 class FormGroupMatchesByCompareFunctor {
11 public:
12 explicit FormGroupMatchesByCompareFunctor(const T& form_group)
13 : form_group_(form_group) {
14 }
15
16 bool operator()(const T* form_group) {
17 return form_group->Compare(form_group_) == 0;
18 }
19
20 bool operator()(const T& form_group) {
21 return form_group.Compare(form_group_) == 0;
22 }
23
24 private:
25 const T& form_group_;
26 };
27
28 template<typename C, typename T>
29 bool FindByContents(const C& container, const T& form_group) {
30 return std::find_if(
31 container.begin(),
32 container.end(),
33 FormGroupMatchesByCompareFunctor<T>(form_group)) != container.end();
34 }
35
36 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_INL_H_
OLDNEW
« 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