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

Side by Side Diff: chrome/browser/autofill/autofill-inl.h

Issue 12434004: Move remaining Autofill code to //components/autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix long lines Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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
8 template<typename T>
9 class FormGroupMatchesByCompareFunctor {
10 public:
11 explicit FormGroupMatchesByCompareFunctor(const T& form_group)
12 : form_group_(form_group) {
13 }
14
15 bool operator()(const T* form_group) {
16 return form_group->Compare(form_group_) == 0;
17 }
18
19 bool operator()(const T& form_group) {
20 return form_group.Compare(form_group_) == 0;
21 }
22
23 private:
24 const T& form_group_;
25 };
26
27 template<typename C, typename T>
28 bool FindByContents(const C& container, const T& form_group) {
29 return std::find_if(
30 container.begin(),
31 container.end(),
32 FormGroupMatchesByCompareFunctor<T>(form_group)) != container.end();
33 }
34
35 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_INL_H_
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autocomplete_history_manager_unittest.cc ('k') | chrome/browser/autofill/autofill_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698